60 |
60 |
61 class CFont; |
61 class CFont; |
62 |
62 |
63 QT_BEGIN_NAMESPACE |
63 QT_BEGIN_NAMESPACE |
64 |
64 |
65 // ..gives us access to truetype tables, UTF-16<->GlyphID mapping, and glyph outlines |
65 // ..gives us access to truetype tables |
66 class QFontEngineS60Extensions |
66 class QSymbianTypeFaceExtras |
67 { |
67 { |
68 public: |
68 public: |
69 QFontEngineS60Extensions(CFont* fontOwner, COpenFont *font); |
69 QSymbianTypeFaceExtras(CFont* fontOwner, COpenFont *font); |
70 |
70 |
71 QByteArray getSfntTable(uint tag) const; |
71 QByteArray getSfntTable(uint tag) const; |
72 bool getSfntTableData(uint tag, uchar *buffer, uint *length) const; |
72 bool getSfntTableData(uint tag, uchar *buffer, uint *length) const; |
73 const unsigned char *cmap() const; |
73 const unsigned char *cmap() const; |
74 QPainterPath glyphOutline(glyph_t glyph) const; |
|
75 CFont *fontOwner() const; |
74 CFont *fontOwner() const; |
76 |
75 |
77 private: |
76 private: |
78 COpenFont *m_font; |
77 COpenFont *m_font; |
79 const MOpenFontShapingExtension *m_shapingExtension; |
|
80 mutable MOpenFontTrueTypeExtension *m_trueTypeExtension; |
78 mutable MOpenFontTrueTypeExtension *m_trueTypeExtension; |
81 mutable const unsigned char *m_cmap; |
79 mutable const unsigned char *m_cmap; |
82 mutable bool m_symbolCMap; |
80 mutable bool m_symbolCMap; |
83 mutable QByteArray m_cmapTable; |
81 mutable QByteArray m_cmapTable; |
84 CFont* m_fontOwner; |
82 CFont* m_fontOwner; |
85 }; |
83 }; |
86 |
84 |
87 class QFontEngineS60 : public QFontEngine |
85 class QFontEngineS60 : public QFontEngine |
88 { |
86 { |
89 public: |
87 public: |
90 QFontEngineS60(const QFontDef &fontDef, const QFontEngineS60Extensions *extensions); |
88 QFontEngineS60(const QFontDef &fontDef, const QSymbianTypeFaceExtras *extras); |
91 ~QFontEngineS60(); |
89 ~QFontEngineS60(); |
92 |
90 |
93 bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const; |
91 bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const; |
94 void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const; |
92 void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const; |
95 |
93 |
126 |
124 |
127 QFixed glyphAdvance(HB_Glyph glyph) const; |
125 QFixed glyphAdvance(HB_Glyph glyph) const; |
128 CFont *fontWithSize(qreal size) const; |
126 CFont *fontWithSize(qreal size) const; |
129 static void releaseFont(CFont *&font); |
127 static void releaseFont(CFont *&font); |
130 |
128 |
131 const QFontEngineS60Extensions *m_extensions; |
129 const QSymbianTypeFaceExtras *m_extras; |
132 CFont* m_originalFont; |
130 CFont* m_originalFont; |
133 const qreal m_originalFontSizeInPixels; |
131 const qreal m_originalFontSizeInPixels; |
134 CFont* m_scaledFont; |
132 CFont* m_scaledFont; |
135 qreal m_scaledFontSizeInPixels; |
133 qreal m_scaledFontSizeInPixels; |
136 CFont* m_activeFont; |
134 CFont* m_activeFont; |