Ignore:
Timestamp:
Oct 15, 2009, 2:04:41 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Enabled full font hinting and using bitmap stripes by default.

File:
1 edited

Legend:

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

    r227 r228  
    5050#include FT_TYPES_H
    5151#include FT_TRUETYPE_TABLES_H
     52#include FT_LCD_FILTER_H
    5253
    5354QT_BEGIN_NAMESPACE
     
    195196            family->fixedPitch = face->face_flags & FT_FACE_FLAG_FIXED_WIDTH;
    196197
    197             if (systems.isEmpty() || familyName == "Workplace Sans") {
     198            if (systems.isEmpty() || familyName.compare("Workplace Sans")) {
    198199                // it was hard or impossible to determine the actual writing system
    199200                // of the font (as in case of OS/2 bitmap and PFB fonts for which it is
     
    347348static QFontEngine *loadEngine(const QFontDef &req, const QtFontDesc &desc)
    348349{
    349     QFontEngineFT *fe = new QFontEnginePMFT(fontDescToFontDef(req, desc));
     350    // @todo all these fixed so far; make configurable through the Registry
     351    // on per-family basis
     352    QFontEnginePMFT::HintStyle hintStyle = QFontEnginePMFT::HintFull;
     353    bool autoHint = true;
     354    QFontEngineFT::SubpixelAntialiasingType subPixel = QFontEngineFT::Subpixel_None;
     355    int lcdFilter = FT_LCD_FILTER_DEFAULT;
     356    bool useEmbeddedBitmap = true;
     357
     358    QFontEngine::FaceId faceId;
     359    faceId.filename = desc.size->fileName;
     360    faceId.index = desc.size->fileIndex;
     361
     362    QFontEngineFT *fe = new QFontEnginePMFT(fontDescToFontDef(req, desc), faceId,
     363                                            desc.style->antialiased, hintStyle,
     364                                            autoHint, subPixel, lcdFilter,
     365                                            useEmbeddedBitmap);
    350366    Q_ASSERT(fe);
    351     if (fe) {
    352         QFontEngine::FaceId faceId;
    353         faceId.filename = desc.size->fileName;
    354         faceId.index = desc.size->fileIndex;
    355         fe->init(faceId, desc.style->antialiased);
    356         if (fe->invalid()) {
    357             FM_DEBUG("   --> invalid!\n");
    358             delete fe;
    359             fe = 0;
    360         }
     367    if (fe && fe->invalid()) {
     368        FM_DEBUG("   --> invalid!\n");
     369        delete fe;
     370        fe = 0;
    361371    }
    362372    return fe;
Note: See TracChangeset for help on using the changeset viewer.