Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/text/qfontdatabase_x11.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation ([email protected])
     
    4242#include <qplatformdefs.h>
    4343
    44 #include <qdatetime.h>
    4544#include <qdebug.h>
    4645#include <qpaintdevice.h>
     46
    4747
    4848#include <private/qt_x11_p.h>
     
    7878extern double qt_pointSize(double pixelSize, int dpi);
    7979extern double qt_pixelSize(double pointSize, int dpi);
     80
     81
     82
    8083
    8184static inline void capitalize (char *s)
     
    12191222
    12201223#ifdef QFONTDATABASE_DEBUG
    1221     QTime t;
     1224    Q t;
    12221225    t.start();
    12231226#endif
     
    13021305        return;
    13031306
    1304     QTime t;
     1307    Q t;
    13051308    t.start();
    13061309
     
    13151318
    13161319    loadFontConfig();
    1317     FD_DEBUG("QFontDatabase: loaded FontConfig: %d ms", t.elapsed());
     1320    FD_DEBUG("QFontDatabase: loaded FontConfig: %d ms", ));
    13181321#endif
    13191322
     
    18891892}
    18901893
     1894
     1895
     1896
     1897
     1898
     1899
     1900
     1901
     1902
     1903
     1904
     1905
    18911906/*! \internal
    18921907  Loads a QFontEngine for the specified \a script that matches the
     
    19001915    QFontDef req = d->request;
    19011916    if (req.pixelSize <= 0)
    1902         req.pixelSize = floor(qt_pixelSize(req.pointSize, d->dpi) * 100 + 0.5) / 100;
     1917        req.pixelSize = ;
    19031918    if (req.pixelSize < 1)
    19041919        req.pixelSize = 1;
     1920
     1921
     1922
     1923
     1924
     1925
    19051926    if (req.weight == 0)
    19061927        req.weight = QFont::Normal;
     
    19381959        } else if (X11->has_fontconfig) {
    19391960            fe = loadFc(d, script, req);
    1940 
    1941             if (fe != 0 && fe->fontDef.pixelSize != req.pixelSize) {
    1942                 delete fe;
    1943                 fe = loadXlfd(d->screen, script, req);
     1961            if (fe != 0 && fe->fontDef.pixelSize != req.pixelSize && mainThread && qt_is_gui_used) {
     1962                QFontEngine *xlfdFontEngine = loadXlfd(d->screen, script, req);
     1963                if (xlfdFontEngine->fontDef.family == fe->fontDef.family) {
     1964                    delete fe;
     1965                    fe = xlfdFontEngine;
     1966                } else {
     1967                    delete xlfdFontEngine;
     1968                }
    19441969            }
    19451970
    19461971
    19471972#endif
    1948         } else if (mainThread) {
     1973        } else if (mainThread) {
    19491974            fe = loadXlfd(d->screen, script, req);
    19501975        }
     
    19822007    FcFontSet *set = FcConfigGetFonts(config, FcSetApplication);
    19832008    if (!set) {
    1984         FcConfigAppFontAddFile(config, (const FcChar8 *)":/non-existant");
     2009        FcConfigAppFontAddFile(config, (const FcChar8 *)":/non-existnt");
    19852010        set = FcConfigGetFonts(config, FcSetApplication); // try again
    19862011        if (!set)
Note: See TracChangeset for help on using the changeset viewer.