Changeset 220


Ignore:
Timestamp:
Oct 12, 2009, 11:37:39 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Added enumeration of installed PM fonts.

Location:
trunk/src/gui/text
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/text/qfontdatabase.cpp

    r124 r220  
    5454#include <locale.h>
    5555#endif
     56
     57
     58
     59
    5660#include <stdlib.h>
    5761#include <limits.h>
     
    7478#  define for if(0){}else for
    7579#endif
     80
     81
    7682
    7783QT_BEGIN_NAMESPACE
     
    146152    int fileIndex;
    147153#endif
     154
     155
     156
     157
    148158};
    149159
     
    209219        weightName = setwidthName = 0;
    210220#endif // Q_WS_X11
     221
     222
     223
    211224    }
    212225
     
    242255    bool antialiased;
    243256#endif
    244 
     257#ifdef Q_WS_PM
     258    CHAR faceName[FACESIZE];
     259#endif
     260
     261#ifdef Q_WS_PM
     262    QtFontSize *pixelSize(unsigned short size, bool = false,
     263                          unsigned short pointSize = 0);
     264#else
    245265    QtFontSize *pixelSize(unsigned short size, bool = false);
     266
    246267};
    247268
     
    259280}
    260281
     282
     283
     284
     285
    261286QtFontSize *QtFontStyle::pixelSize(unsigned short size, bool add)
     287
    262288{
    263289    for (int i = 0; i < count; i++) {
     290
     291
     292
     293
     294
     295
    264296        if (pixelSizes[i].pixelSize == size)
    265297            return pixelSizes + i;
     298
    266299    }
    267300    if (!add)
     
    280313    new (&pixelSizes[count].fileName) QByteArray;
    281314    pixelSizes[count].fileIndex = 0;
     315
     316
     317
     318
    282319#endif
    283320    return pixelSizes + (count++);
     
    364401    {
    365402        memset(writingSystems, 0, sizeof(writingSystems));
     403
     404
     405
     406
    366407    }
    367408    ~QtFontFamily() {
     
    867908}
    868909
    869 #define SMOOTH_SCALABLE 0xffff
    870 
    871910QT_BEGIN_INCLUDE_NAMESPACE
    872911#if defined(Q_WS_X11)
  • trunk/src/gui/text/qfontdatabase_pm.cpp

    r125 r220  
    4848QT_BEGIN_NAMESPACE
    4949
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61
     62
     63
     64
     65
     66
     67
     68
     69
     70
     71
     72
     73
     74
     75
     76
     77
     78
     79
     80
     81
     82
     83
     84
     85
     86
     87
     88
     89
     90
     91
     92
     93
     94
     95
     96
     97
     98
     99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
     132
     133
     134
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
    50173static void initializeDb()
    51174{
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
     208
     209
     210
     211
     212
     213
     214
     215
     216
     217
     218
    52219    // @todo implement
    53220}
    54221
    55 static inline void load(const QString &family = QString(), int = -1)
    56 {
    57     // @todo implement
    58 }
    59 
    60 static void registerFont(QFontDatabasePrivate::ApplicationFont *fnt)
    61 {
    62     // @todo implement
     222static QFontEngine *loadPM(const QFontPrivate *d, int script, const QFontDef &req)
     223{
     224    // @todo initializeDb() and stuff, get the engine
     225    QFontDef fd = req;
     226    QFontEngine *fe = new QFontEnginePMFT(fd);
     227    return fe;
    63228}
    64229
     
    95260            fe->fontDef = req;
    96261        } else {
    97             // @todo initializeDb() and stuff, get the engine
    98             QFontDef fd = req;
    99             fe = new QFontEnginePMFT(fd);
     262            QMutexLocker locker(fontDatabaseMutex());
     263            if (!privateDb()->count)
     264                initializeDb();
     265            fe = loadPM(d, script, req);
    100266        }
    101267        if (!fe) {
  • trunk/src/gui/text/text.pri

    r125 r220  
    189189contains(QT_CONFIG, fontconfig) {
    190190    CONFIG += opentype
     191
     192
    191193}
    192194
Note: See TracChangeset for help on using the changeset viewer.