- Timestamp:
- Oct 15, 2009, 2:04:41 AM (16 years ago)
- Location:
- trunk/src/gui/text
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/text/qfontdatabase_pm.cpp
r227 r228 50 50 #include FT_TYPES_H 51 51 #include FT_TRUETYPE_TABLES_H 52 #include FT_LCD_FILTER_H 52 53 53 54 QT_BEGIN_NAMESPACE … … 195 196 family->fixedPitch = face->face_flags & FT_FACE_FLAG_FIXED_WIDTH; 196 197 197 if (systems.isEmpty() || familyName == "Workplace Sans") {198 if (systems.isEmpty() || familyName.compare("Workplace Sans")) { 198 199 // it was hard or impossible to determine the actual writing system 199 200 // of the font (as in case of OS/2 bitmap and PFB fonts for which it is … … 347 348 static QFontEngine *loadEngine(const QFontDef &req, const QtFontDesc &desc) 348 349 { 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); 350 366 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; 361 371 } 362 372 return fe; -
trunk/src/gui/text/qfontengine_pm.cpp
r222 r228 55 55 // ------------------------------------------------------------------ 56 56 57 QFontEnginePMFT::QFontEnginePMFT(const QFontDef &fd) 57 QFontEnginePMFT::QFontEnginePMFT(const QFontDef &fd, const FaceId &faceId, 58 bool antialias, HintStyle hintStyle, 59 bool autoHint, SubpixelAntialiasingType subPixel, 60 int lcdFilter, bool useEmbeddedBitmap) 58 61 : QFontEngineFT(fd) 59 62 { 63 subpixelType = subPixel; 64 65 default_hint_style = (QFontEngineFT::HintStyle)hintStyle; 66 67 #if defined(FT_LOAD_FORCE_AUTOHINT) 68 if (autoHint) 69 default_load_flags |= FT_LOAD_FORCE_AUTOHINT; 70 #endif 71 72 lcdFilterType = lcdFilter; 73 embeddedbitmap = useEmbeddedBitmap; 74 75 GlyphFormat defaultFormat = Format_None; 76 if (subpixelType != QFontEngineFT::Subpixel_None) 77 defaultFormat = Format_A32; 78 else if (antialias) 79 defaultFormat = Format_A8; 80 else 81 defaultFormat = Format_Mono; 82 83 init(faceId, antialias, defaultFormat); 60 84 } 61 85 -
trunk/src/gui/text/qfontengine_pm_p.h
r222 r228 71 71 { 72 72 public: 73 explicit QFontEnginePMFT(const QFontDef &fd); 73 enum HintStyle { 74 HintNone = QFontEngineFT::HintNone, 75 HintLight = QFontEngineFT::HintLight, 76 HintMedium = QFontEngineFT::HintMedium, 77 HintFull = QFontEngineFT::HintFull 78 }; 79 80 explicit QFontEnginePMFT(const QFontDef &fd, const FaceId &faceId, 81 bool antialias, HintStyle hintStyle, 82 bool autoHint, SubpixelAntialiasingType subPixel, 83 int lcdFilter, bool useEmbeddedBitmap); 74 84 ~QFontEnginePMFT(); 75 85 };
Note:
See TracChangeset
for help on using the changeset viewer.