Remove all references to XLFD fonts
authorLars Knoll <lars.knoll@nokia.com>
Sun, 24 Jun 2012 22:18:10 +0000 (00:18 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 26 Jun 2012 22:46:35 +0000 (00:46 +0200)
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>
src/gui/painting/qpainter.h
src/gui/text/qfont.cpp
src/gui/text/qfontdatabase.cpp
src/gui/text/qfontengine_p.h
src/gui/text/qtextengine.cpp
src/gui/text/qtextformat.cpp

index 5ea3868..2c8e19e 100644 (file)
@@ -474,14 +474,9 @@ private:
     friend class QFontEngineFT;
     friend class QFontEngineMac;
     friend class QFontEngineWin;
-    friend class QFontEngineXLFD;
-    friend class QWSManager;
     friend class QPaintEngine;
     friend class QPaintEngineExPrivate;
     friend class QOpenGLPaintEngine;
-    friend class QVGPaintEngine;
-    friend class QX11PaintEngine;
-    friend class QX11PaintEnginePrivate;
     friend class QWin32PaintEngine;
     friend class QWin32PaintEnginePrivate;
     friend class QRasterPaintEngine;
index 71c060e..7b2288c 100644 (file)
@@ -549,9 +549,7 @@ QFontEngineData::~QFontEngineData()
 
     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
-    FontConfig support; otherwise the XLFD (X Logical Font Description) is
-    returned.
+    On X11, this function will return an empty string.
 
     Using the return value of this function is usually \e not \e
     portable.
@@ -562,11 +560,7 @@ QFontEngineData::~QFontEngineData()
 /*!
     \fn void QFont::setRawName(const QString &name)
 
-    Sets a font by its system specific name. The function is
-    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.
+    Sets a font by its system specific name.
 
     A font set with setRawName() is still a full-featured QFont. It can
     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
     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()
 */
 
@@ -1425,10 +1415,6 @@ int QFont::stretch() const
     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 stretch(), QFont::Stretch
 */
 void QFont::setStretch(int factor)
index b8e1e0c..4b8a18d 100644 (file)
@@ -322,8 +322,7 @@ struct  QtFontFamily
         Unknown         = 0,
         Supported       = 1,
         UnsupportedFT  = 2,
-        UnsupportedXLFD = 4,
-        Unsupported     = UnsupportedFT | UnsupportedXLFD
+        Unsupported     = UnsupportedFT
     };
 
     QtFontFamily(const QString &n)
@@ -724,7 +723,7 @@ struct QtFontDesc
 
 static void match(int script, const QFontDef &request,
                   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)
 {
@@ -965,8 +964,7 @@ unsigned int bestFoundry(int script, unsigned int score, int styleStrategy,
             PitchMismatch       = 0x4000,
             StyleMismatch       = 0x2000,
             BitmapScaledPenalty = 0x1000,
-            EncodingMismatch    = 0x0002,
-            XLFDPenalty         = 0x0001
+            EncodingMismatch    = 0x0002
         };
         if (pitch != '*') {
 #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,
                   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);
 
@@ -1056,7 +1054,6 @@ static void match(int script, const QFontDef &request,
 
     unsigned int score = ~0u;
 
-    Q_UNUSED(forceXLFD);
     load(family_name, script);
 
     QFontDatabasePrivate *db = privateDb();
index bcf763d..0d635c4 100644 (file)
@@ -91,9 +91,6 @@ public:
         Box,
         Multi,
 
-        // X11 types
-        XLFD,
-
         // MS Windows types
         Win,
 
index 18cc34c..11dded8 100644 (file)
@@ -2417,12 +2417,10 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int
             if (feForEllipsis->type() == QFontEngine::Mac)
                 feForEllipsis = fe;
 
-            // the lookup can be really slow when we use XLFD fonts
-            if (feForEllipsis->type() != QFontEngine::XLFD
-                && feForEllipsis->canRender(&ellipsisChar, 1)) {
-                    int nGlyphs = 1;
-                    feForEllipsis->stringToCMap(&ellipsisChar, 1, &ellipsisGlyph, &nGlyphs, 0);
-                }
+            if (feForEllipsis->canRender(&ellipsisChar, 1)) {
+                int nGlyphs = 1;
+                feForEllipsis->stringToCMap(&ellipsisChar, 1, &ellipsisGlyph, &nGlyphs, 0);
+            }
         }
 
         if (ellipsisGlyph.glyphs[0]) {
index 9995110..a7f9de0 100644 (file)
@@ -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.
 
-    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()
 */