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

gui: Added enumeration of installed PM fonts.

File:
1 edited

Legend:

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

    r124 r220  
    5454#include <locale.h>
    5555#endif
     56#ifdef Q_WS_PM
     57#include "qt_os2.h"
     58#endif
     59
    5660#include <stdlib.h>
    5761#include <limits.h>
     
    7478#  define for if(0){}else for
    7579#endif
     80
     81#define SMOOTH_SCALABLE 0xffff
    7682
    7783QT_BEGIN_NAMESPACE
     
    146152    int fileIndex;
    147153#endif
     154#ifdef Q_WS_PM
     155    unsigned short pointSize; // in deca-points
     156    LONG lMatch;
     157#endif
    148158};
    149159
     
    209219        weightName = setwidthName = 0;
    210220#endif // Q_WS_X11
     221#if defined(Q_WS_PM)
     222        faceName[0] = 0;
     223#endif
    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#endif
    246267};
    247268
     
    259280}
    260281
     282#ifdef Q_WS_PM
     283QtFontSize *QtFontStyle::pixelSize(unsigned short size, bool add,
     284                                   unsigned short pointSize)
     285#else
    261286QtFontSize *QtFontStyle::pixelSize(unsigned short size, bool add)
     287#endif
    262288{
    263289    for (int i = 0; i < count; i++) {
     290#ifdef Q_WS_PM
     291        if (pixelSizes[i].pixelSize == size &&
     292        (size == SMOOTH_SCALABLE || !pointSize ||
     293         pixelSizes[i].pointSize == pointSize))
     294        return pixelSizes + i;
     295#else
    264296        if (pixelSizes[i].pixelSize == size)
    265297            return pixelSizes + i;
     298#endif
    266299    }
    267300    if (!add)
     
    280313    new (&pixelSizes[count].fileName) QByteArray;
    281314    pixelSizes[count].fileIndex = 0;
     315#endif
     316#ifdef Q_WS_PM
     317    pixelSizes[count].pointSize = pointSize;
     318    pixelSizes[count].lMatch = 0;
    282319#endif
    283320    return pixelSizes + (count++);
     
    364401    {
    365402        memset(writingSystems, 0, sizeof(writingSystems));
     403#ifdef Q_WS_PM
     404        // the concept of writing systems isn't used, let's support just Any
     405        writingSystems[QFontDatabase::Any] = Supported;
     406#endif
    366407    }
    367408    ~QtFontFamily() {
     
    867908}
    868909
    869 #define SMOOTH_SCALABLE 0xffff
    870 
    871910QT_BEGIN_INCLUDE_NAMESPACE
    872911#if defined(Q_WS_X11)
Note: See TracChangeset for help on using the changeset viewer.