author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 15 Mar 2010 12:43:09 +0200 | |
branch | RCL_3 |
changeset 6 | dee5afe5301f |
parent 5 | d3bac044e0f0 |
child 13 | c0432d11811c |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
7 |
** This file is part of the QtGui module of the Qt Toolkit. |
0 | 8 |
** |
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QFONTENGINE_S60_P_H |
|
43 |
#define QFONTENGINE_S60_P_H |
|
44 |
||
45 |
// |
|
46 |
// W A R N I N G |
|
47 |
// ------------- |
|
48 |
// |
|
49 |
// This file is not part of the Qt API. It exists purely as an |
|
50 |
// implementation detail. This header file may change from version to |
|
51 |
// version without notice, or even be removed. |
|
52 |
// |
|
53 |
// We mean it. |
|
54 |
// |
|
55 |
||
56 |
#include "qconfig.h" |
|
57 |
#include "qfontengine_p.h" |
|
58 |
#include "qsize.h" |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
59 |
#include <openfont.h> |
0 | 60 |
|
61 |
class CFont; |
|
62 |
||
63 |
QT_BEGIN_NAMESPACE |
|
64 |
||
65 |
// ..gives us access to truetype tables, UTF-16<->GlyphID mapping, and glyph outlines |
|
66 |
class QFontEngineS60Extensions |
|
67 |
{ |
|
68 |
public: |
|
69 |
QFontEngineS60Extensions(CFont* fontOwner, COpenFont *font); |
|
70 |
||
71 |
QByteArray getSfntTable(uint tag) const; |
|
72 |
const unsigned char *cmap() const; |
|
73 |
QPainterPath glyphOutline(glyph_t glyph) const; |
|
74 |
CFont *fontOwner() const; |
|
75 |
||
76 |
private: |
|
77 |
COpenFont *m_font; |
|
78 |
const MOpenFontShapingExtension *m_shapingExtension; |
|
79 |
mutable MOpenFontTrueTypeExtension *m_trueTypeExtension; |
|
80 |
mutable const unsigned char *m_cmap; |
|
81 |
mutable bool m_symbolCMap; |
|
82 |
mutable QByteArray m_cmapTable; |
|
83 |
CFont* m_fontOwner; |
|
84 |
}; |
|
85 |
||
86 |
class QFontEngineS60 : public QFontEngine |
|
87 |
{ |
|
88 |
public: |
|
89 |
QFontEngineS60(const QFontDef &fontDef, const QFontEngineS60Extensions *extensions); |
|
90 |
~QFontEngineS60(); |
|
91 |
||
92 |
bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const; |
|
93 |
void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const; |
|
94 |
||
95 |
QImage alphaMapForGlyph(glyph_t glyph); |
|
96 |
||
97 |
glyph_metrics_t boundingBox(const QGlyphLayout &glyphs); |
|
98 |
glyph_metrics_t boundingBox_const(glyph_t glyph) const; // Const correctnes quirk. |
|
99 |
glyph_metrics_t boundingBox(glyph_t glyph); |
|
100 |
||
101 |
QFixed ascent() const; |
|
102 |
QFixed descent() const; |
|
103 |
QFixed leading() const; |
|
104 |
qreal maxCharWidth() const; |
|
105 |
qreal minLeftBearing() const { return 0; } |
|
106 |
qreal minRightBearing() const { return 0; } |
|
107 |
||
108 |
QByteArray getSfntTable(uint tag) const; |
|
109 |
||
110 |
static qreal pixelsToPoints(qreal pixels, Qt::Orientation orientation = Qt::Horizontal); |
|
111 |
static qreal pointsToPixels(qreal points, Qt::Orientation orientation = Qt::Horizontal); |
|
112 |
||
113 |
const char *name() const; |
|
114 |
||
115 |
bool canRender(const QChar *string, int len); |
|
116 |
||
117 |
Type type() const; |
|
118 |
||
119 |
void getCharacterData(glyph_t glyph, TOpenFontCharMetrics& metrics, const TUint8*& bitmap, TSize& bitmapSize) const; |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
120 |
void setFontScale(qreal scale); |
0 | 121 |
|
122 |
private: |
|
123 |
friend class QFontPrivate; |
|
124 |
||
125 |
QFixed glyphAdvance(HB_Glyph glyph) const; |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
126 |
CFont *fontWithSize(qreal size) const; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
127 |
static void releaseFont(CFont *&font); |
0 | 128 |
|
129 |
const QFontEngineS60Extensions *m_extensions; |
|
5
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
130 |
CFont* m_originalFont; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
131 |
const qreal m_originalFontSizeInPixels; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
132 |
CFont* m_scaledFont; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
133 |
qreal m_scaledFontSizeInPixels; |
d3bac044e0f0
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
4
diff
changeset
|
134 |
CFont* m_activeFont; |
0 | 135 |
}; |
136 |
||
137 |
class QFontEngineMultiS60 : public QFontEngineMulti |
|
138 |
{ |
|
139 |
public: |
|
140 |
QFontEngineMultiS60(QFontEngine *first, int script, const QStringList &fallbackFamilies); |
|
141 |
void loadEngine(int at); |
|
142 |
||
143 |
int m_script; |
|
144 |
QStringList m_fallbackFamilies; |
|
145 |
}; |
|
146 |
||
147 |
QT_END_NAMESPACE |
|
148 |
||
149 |
#endif // QFONTENGINE_S60_P_H |