Qt 4.8
qfontengine_win_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QFONTENGINE_WIN_P_H
43 #define QFONTENGINE_WIN_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 <QtCore/qconfig.h>
57 
59 
60 class QNativeImage;
61 
63 {
64 public:
65  QFontEngineWin(const QString &name, HFONT, bool, LOGFONT);
67 
68  virtual QFixed lineThickness() const;
69  virtual Properties properties() const;
70  virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics);
71  virtual FaceId faceId() const;
72  virtual bool getSfntTableData(uint tag, uchar *buffer, uint *length) const;
73  virtual int synthesized() const;
74  virtual QFixed emSquareSize() const;
75 
76  virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const;
77  virtual void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags) const;
78 
79  virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags);
80  virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs,
81  QPainterPath *path, QTextItem::RenderFlags flags);
82 
83  HGDIOBJ selectDesignFont() const;
84 
85  virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
87  virtual glyph_metrics_t boundingBox(glyph_t g, const QTransform &t);
88 
89 
90  virtual QFixed ascent() const;
91  virtual QFixed descent() const;
92  virtual QFixed leading() const;
93  virtual QFixed xHeight() const;
94  virtual QFixed averageCharWidth() const;
95  virtual qreal maxCharWidth() const;
96  virtual qreal minLeftBearing() const;
97  virtual qreal minRightBearing() const;
98 
99  virtual const char *name() const;
100 
101  bool canRender(const QChar *string, int len);
102 
103  Type type() const;
104 
106  virtual QImage alphaMapForGlyph(glyph_t, const QTransform &xform);
107  virtual QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform);
108 
109  virtual QFontEngine *cloneWithSize(qreal pixelSize) const;
110 
111 #ifndef Q_CC_MINGW
112  virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing = 0, qreal *rightBearing = 0);
113 #endif
114 
115  int getGlyphIndexes(const QChar *ch, int numChars, QGlyphLayout *glyphs, bool mirrored) const;
116  void getCMap();
117 
118 #ifndef Q_WS_WINCE
119  bool getOutlineMetrics(glyph_t glyph, const QTransform &t, glyph_metrics_t *metrics) const;
120 #endif
121 
124  HFONT hfont;
125  LOGFONT logfont;
127  uint ttf : 1;
129  TEXTMETRIC tm;
130  int lw;
131  const unsigned char *cmap;
133  mutable qreal lbearing;
134  mutable qreal rbearing;
139 
140  mutable int synthesized_flags;
141  mutable QFixed lineWidth;
142  mutable unsigned char *widthCache;
145  mutable int designAdvancesSize;
146 
147 private:
148  QNativeImage *drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform,
149  QImage::Format mask_format);
150 
151 };
152 
154 {
155 public:
156  QFontEngineMultiWin(QFontEngine *first, const QStringList &fallbacks);
157  void loadEngine(int at);
158 
160 };
161 
163 
164 #endif // QFONTENGINE_WIN_P_H
virtual void getGlyphBearings(glyph_t glyph, qreal *leftBearing=0, qreal *rightBearing=0)
virtual qreal minRightBearing() const
Format
The following image formats are available in Qt.
Definition: qimage.h:91
double qreal
Definition: qglobal.h:1193
virtual QFixed lineThickness() const
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
virtual QFixed ascent() const
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
virtual glyph_metrics_t boundingBox(glyph_t g)
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
bool canRender(const QChar *string, int len)
#define at(className, varName)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
virtual QImage alphaMapForGlyph(glyph_t t)
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
virtual QFixed descent() const
virtual qreal minLeftBearing() const
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
HGDIOBJ selectDesignFont() const
virtual QFixed xHeight() const
virtual void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags) const
unsigned char uchar
Definition: qglobal.h:994
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
virtual QImage alphaRGBMapForGlyph(glyph_t t, QFixed subPixelPosition, int margin, const QTransform &xform)
virtual QFixed leading() const
static float pixelSize(const QFontDef &request, int dpi)
Definition: qfont_win.cpp:80
QNativeImage * drawGDIGlyph(HFONT font, glyph_t, int margin, const QTransform &xform, QImage::Format mask_format)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
Definition: qcssparser.cpp:329
static QFontEngine * loadEngine(int script, const QFontDef &request, QtFontFamily *family, QtFontFoundry *foundry, QtFontStyle *style, QtFontSize *size)
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
const unsigned char * cmap
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
virtual const char * name() const
unsigned int uint
Definition: qglobal.h:996
unsigned char * widthCache
virtual QFixed averageCharWidth() const
Type type() const
QFontEngineWin(const QString &name, HFONT, bool, LOGFONT)
virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags)
virtual qreal maxCharWidth() const
int getGlyphIndexes(const QChar *ch, int numChars, QGlyphLayout *glyphs, bool mirrored) const
virtual QFixed emSquareSize() const
virtual bool getSfntTableData(uint tag, uchar *buffer, uint *length) const
virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
virtual QFontEngine * cloneWithSize(qreal pixelSize) const
virtual Properties properties() const
virtual int synthesized() const
unsigned int glyph_t
virtual FaceId faceId() const
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65
QByteArray cmapTable