mirror of https://github.com/qt/qtbase.git
Remove all references to XLFD fonts
XLFD fonts are no longer supported in Qt 5. Change-Id: I83400dab417c933d5cd956c0d168c45b9d79dab7 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
parent
989cada8cc
commit
3a8d7b0b9a
|
@ -474,14 +474,9 @@ private:
|
||||||
friend class QFontEngineFT;
|
friend class QFontEngineFT;
|
||||||
friend class QFontEngineMac;
|
friend class QFontEngineMac;
|
||||||
friend class QFontEngineWin;
|
friend class QFontEngineWin;
|
||||||
friend class QFontEngineXLFD;
|
|
||||||
friend class QWSManager;
|
|
||||||
friend class QPaintEngine;
|
friend class QPaintEngine;
|
||||||
friend class QPaintEngineExPrivate;
|
friend class QPaintEngineExPrivate;
|
||||||
friend class QOpenGLPaintEngine;
|
friend class QOpenGLPaintEngine;
|
||||||
friend class QVGPaintEngine;
|
|
||||||
friend class QX11PaintEngine;
|
|
||||||
friend class QX11PaintEnginePrivate;
|
|
||||||
friend class QWin32PaintEngine;
|
friend class QWin32PaintEngine;
|
||||||
friend class QWin32PaintEnginePrivate;
|
friend class QWin32PaintEnginePrivate;
|
||||||
friend class QRasterPaintEngine;
|
friend class QRasterPaintEngine;
|
||||||
|
|
|
@ -549,9 +549,7 @@ QFontEngineData::~QFontEngineData()
|
||||||
|
|
||||||
Returns the name of the font within the underlying window system.
|
Returns the name of the font within the underlying window system.
|
||||||
|
|
||||||
On X11, this function will return an empty string if Qt is built with
|
On X11, this function will return an empty string.
|
||||||
FontConfig support; otherwise the XLFD (X Logical Font Description) is
|
|
||||||
returned.
|
|
||||||
|
|
||||||
Using the return value of this function is usually \e not \e
|
Using the return value of this function is usually \e not \e
|
||||||
portable.
|
portable.
|
||||||
|
@ -562,11 +560,7 @@ QFontEngineData::~QFontEngineData()
|
||||||
/*!
|
/*!
|
||||||
\fn void QFont::setRawName(const QString &name)
|
\fn void QFont::setRawName(const QString &name)
|
||||||
|
|
||||||
Sets a font by its system specific name. The function is
|
Sets a font by its system specific name.
|
||||||
particularly useful under X, where system font settings (for
|
|
||||||
example X resources) are usually available in XLFD (X Logical Font
|
|
||||||
Description) form only. You can pass an XLFD as \a name to this
|
|
||||||
function.
|
|
||||||
|
|
||||||
A font set with setRawName() is still a full-featured QFont. It can
|
A font set with setRawName() is still a full-featured QFont. It can
|
||||||
be queried (for example with italic()) or modified (for example with
|
be queried (for example with italic()) or modified (for example with
|
||||||
|
@ -575,10 +569,6 @@ QFontEngineData::~QFontEngineData()
|
||||||
If Qt's internal font database cannot resolve the raw name, the
|
If Qt's internal font database cannot resolve the raw name, the
|
||||||
font becomes a raw font with \a name as its family.
|
font becomes a raw font with \a name as its family.
|
||||||
|
|
||||||
Note that the present implementation does not handle wildcards in
|
|
||||||
XLFDs well, and that font aliases (file \c fonts.alias in the font
|
|
||||||
directory on X11) are not supported.
|
|
||||||
|
|
||||||
\sa rawName(), setRawMode(), setFamily()
|
\sa rawName(), setRawMode(), setFamily()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -1425,10 +1415,6 @@ int QFont::stretch() const
|
||||||
The stretch factor is only applied to outline fonts. The stretch
|
The stretch factor is only applied to outline fonts. The stretch
|
||||||
factor is ignored for bitmap fonts.
|
factor is ignored for bitmap fonts.
|
||||||
|
|
||||||
NOTE: QFont cannot stretch XLFD fonts. When loading XLFD fonts on
|
|
||||||
X11, the stretch factor is matched against a predefined set of
|
|
||||||
values for the SETWIDTH_NAME field of the XLFD.
|
|
||||||
|
|
||||||
\sa stretch(), QFont::Stretch
|
\sa stretch(), QFont::Stretch
|
||||||
*/
|
*/
|
||||||
void QFont::setStretch(int factor)
|
void QFont::setStretch(int factor)
|
||||||
|
|
|
@ -322,8 +322,7 @@ struct QtFontFamily
|
||||||
Unknown = 0,
|
Unknown = 0,
|
||||||
Supported = 1,
|
Supported = 1,
|
||||||
UnsupportedFT = 2,
|
UnsupportedFT = 2,
|
||||||
UnsupportedXLFD = 4,
|
Unsupported = UnsupportedFT
|
||||||
Unsupported = UnsupportedFT | UnsupportedXLFD
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QtFontFamily(const QString &n)
|
QtFontFamily(const QString &n)
|
||||||
|
@ -724,7 +723,7 @@ struct QtFontDesc
|
||||||
|
|
||||||
static void match(int script, const QFontDef &request,
|
static void match(int script, const QFontDef &request,
|
||||||
const QString &family_name, const QString &foundry_name, int force_encoding_id,
|
const QString &family_name, const QString &foundry_name, int force_encoding_id,
|
||||||
QtFontDesc *desc, const QList<int> &blacklistedFamilies = QList<int>(), bool forceXLFD=false);
|
QtFontDesc *desc, const QList<int> &blacklistedFamilies = QList<int>());
|
||||||
|
|
||||||
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
|
static void initFontDef(const QtFontDesc &desc, const QFontDef &request, QFontDef *fontDef, bool multi)
|
||||||
{
|
{
|
||||||
|
@ -965,8 +964,7 @@ unsigned int bestFoundry(int script, unsigned int score, int styleStrategy,
|
||||||
PitchMismatch = 0x4000,
|
PitchMismatch = 0x4000,
|
||||||
StyleMismatch = 0x2000,
|
StyleMismatch = 0x2000,
|
||||||
BitmapScaledPenalty = 0x1000,
|
BitmapScaledPenalty = 0x1000,
|
||||||
EncodingMismatch = 0x0002,
|
EncodingMismatch = 0x0002
|
||||||
XLFDPenalty = 0x0001
|
|
||||||
};
|
};
|
||||||
if (pitch != '*') {
|
if (pitch != '*') {
|
||||||
#if !defined(QWS) && defined(Q_OS_MAC)
|
#if !defined(QWS) && defined(Q_OS_MAC)
|
||||||
|
@ -1025,7 +1023,7 @@ static bool matchFamilyName(const QString &familyName, QtFontFamily *f)
|
||||||
*/
|
*/
|
||||||
static void match(int script, const QFontDef &request,
|
static void match(int script, const QFontDef &request,
|
||||||
const QString &family_name, const QString &foundry_name, int force_encoding_id,
|
const QString &family_name, const QString &foundry_name, int force_encoding_id,
|
||||||
QtFontDesc *desc, const QList<int> &blacklistedFamilies, bool forceXLFD)
|
QtFontDesc *desc, const QList<int> &blacklistedFamilies)
|
||||||
{
|
{
|
||||||
Q_UNUSED(force_encoding_id);
|
Q_UNUSED(force_encoding_id);
|
||||||
|
|
||||||
|
@ -1056,7 +1054,6 @@ static void match(int script, const QFontDef &request,
|
||||||
|
|
||||||
unsigned int score = ~0u;
|
unsigned int score = ~0u;
|
||||||
|
|
||||||
Q_UNUSED(forceXLFD);
|
|
||||||
load(family_name, script);
|
load(family_name, script);
|
||||||
|
|
||||||
QFontDatabasePrivate *db = privateDb();
|
QFontDatabasePrivate *db = privateDb();
|
||||||
|
|
|
@ -91,9 +91,6 @@ public:
|
||||||
Box,
|
Box,
|
||||||
Multi,
|
Multi,
|
||||||
|
|
||||||
// X11 types
|
|
||||||
XLFD,
|
|
||||||
|
|
||||||
// MS Windows types
|
// MS Windows types
|
||||||
Win,
|
Win,
|
||||||
|
|
||||||
|
|
|
@ -2417,9 +2417,7 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int
|
||||||
if (feForEllipsis->type() == QFontEngine::Mac)
|
if (feForEllipsis->type() == QFontEngine::Mac)
|
||||||
feForEllipsis = fe;
|
feForEllipsis = fe;
|
||||||
|
|
||||||
// the lookup can be really slow when we use XLFD fonts
|
if (feForEllipsis->canRender(&ellipsisChar, 1)) {
|
||||||
if (feForEllipsis->type() != QFontEngine::XLFD
|
|
||||||
&& feForEllipsis->canRender(&ellipsisChar, 1)) {
|
|
||||||
int nGlyphs = 1;
|
int nGlyphs = 1;
|
||||||
feForEllipsis->stringToCMap(&ellipsisChar, 1, &ellipsisGlyph, &nGlyphs, 0);
|
feForEllipsis->stringToCMap(&ellipsisChar, 1, &ellipsisGlyph, &nGlyphs, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3129,7 +3129,6 @@ QTextImageFormat::QTextImageFormat(const QTextFormat &fmt)
|
||||||
|
|
||||||
The stretch factor is only applied to outline fonts. The stretch factor is ignored for bitmap fonts.
|
The stretch factor is only applied to outline fonts. The stretch factor is ignored for bitmap fonts.
|
||||||
|
|
||||||
NOTE: QFont cannot stretch XLFD fonts. When loading XLFD fonts on X11, the stretch factor is matched against a predefined set of values for the SETWIDTH_NAME field of the XLFD.
|
|
||||||
\sa fontStretch()
|
\sa fontStretch()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue