Changeset 8 for trunk/src/kernel/qfontengine_p.h
- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel/qfontengine_p.h
r7 r8 40 40 #endif 41 41 42 #ifdef Q_WS_PM 43 #include "qt_os2.h" 44 #endif 45 42 46 #include "qtextengine_p.h" 43 47 44 48 class QPaintDevice; 45 49 46 struct glyph_metrics_t; 47 class QChar; 48 typedef unsigned short glyph_t; 49 struct qoffset_t; 50 typedef int advance_t; 51 class QOpenType; 50 //@@TODO (dmik): these all are defined in the included "qtextengine_p.h", 51 // what do we need it here for? 52 //struct glyph_metrics_t; 53 //class QChar; 54 //typedef unsigned short glyph_t; 55 //struct qoffset_t; 56 //typedef int advance_t; 57 //class QOpenType; 52 58 struct TransformedFont; 53 59 54 #if defined( Q_WS_X11 ) || defined( Q_WS_WIN) || defined( Q_WS_ MAC )60 #if defined( Q_WS_X11 ) || defined( Q_WS_WIN) || defined( Q_WS_PM) || defined( Q_WS_MAC ) 55 61 class QFontEngine : public QShared 56 62 { … … 71 77 Win, 72 78 Uniscribe, 79 80 // OS/2 types 81 PM, 73 82 74 83 // Apple MacOS types … … 151 160 short rbearing; 152 161 #endif // Q_WS_WIN 162 #ifdef Q_WS_PM 163 HPS ps() const; 164 void selectTo( HPS ps ) const; 165 166 HPS hps; 167 FATTRS fa; 168 PFONTMETRICS pfm; 169 #endif 153 170 #ifdef Q_WS_X11 154 171 TransformedFont *transformed_fonts; … … 605 622 #endif 606 623 607 #endif // Q_WS_WIN 608 609 #endif 624 #elif defined( Q_WS_PM ) 625 626 class QFontEnginePM : public QFontEngine 627 { 628 public: 629 QFontEnginePM( HPS ps, PFATTRS pfa, int pixelSize, int pointSize ); 630 virtual ~QFontEnginePM() { delete[] widthCache; } 631 632 Error stringToCMap( const QChar *str, int len, glyph_t *glyphs, advance_t *advances, int *nglyphs, bool mirrored ) const; 633 634 void draw( QPainter *p, int x, int y, const QTextEngine *engine, const QScriptItem *si, int textFlags ); 635 636 glyph_metrics_t boundingBox( const glyph_t *glyphs, 637 const advance_t *advances, const qoffset_t *offsets, int numGlyphs ); 638 glyph_metrics_t boundingBox( glyph_t glyph ); 639 640 int ascent() const; 641 int descent() const; 642 int leading() const; 643 int maxCharWidth() const; 644 int minLeftBearing() const; 645 int minRightBearing() const; 646 647 //@@TODO (dmik): need other implementation? 648 const char *name() const { return 0; } 649 650 bool canRender( const QChar *string, int len ); 651 652 Type type() const; 653 654 //@@TODO (dmik): the current implementation of font-related code does not 655 // support true unicode (chars and strings are converted using 656 // QString::local8bit), so 256 is enough. It will be changed later (when, 657 // for example, ft2lib will be used). See also stringToCMap() implementation. 658 enum { widthCacheSize = 256 }; 659 unsigned char *widthCache; 660 }; 661 662 #endif 663 664 #endif
Note:
See TracChangeset
for help on using the changeset viewer.