Qt 4.8
qfontengine_x11_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_X11_P_H
43 #define QFONTENGINE_X11_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 #include <private/qt_x11_p.h>
56 
57 #include <private/qfontengine_ft_p.h>
58 
60 
61 class QFreetypeFace;
62 
63 // --------------------------------------------------------------------------
64 
66 {
67 public:
68  QFontEngineMultiXLFD(const QFontDef &r, const QList<int> &l, int s);
70 
71  void loadEngine(int at);
72 
73 private:
75  int screen;
77 };
78 
83 {
84 public:
85  QFontEngineXLFD(XFontStruct *f, const QByteArray &name, int mib);
86  ~QFontEngineXLFD();
87 
88  virtual QFontEngine::FaceId faceId() const;
90  virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics);
91  virtual bool getSfntTableData(uint tag, uchar *buffer, uint *length) const;
92  virtual int synthesized() const;
93 
94  virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs,
95  QTextEngine::ShaperFlags flags) const;
96  virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
97 
98  virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs);
99  virtual glyph_metrics_t boundingBox(glyph_t glyph);
100 
101  virtual void addOutlineToPath(qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags);
102  virtual QFixed ascent() const;
103  virtual QFixed descent() const;
104  virtual QFixed leading() const;
105  virtual qreal maxCharWidth() const;
106  virtual qreal minLeftBearing() const;
107  virtual qreal minRightBearing() const;
109 
110  virtual inline Type type() const
111  { return QFontEngine::XLFD; }
112 
113  virtual bool canRender(const QChar *string, int len);
114  virtual const char *name() const;
115 
116  inline XFontStruct *fontStruct() const
117  { return _fs; }
118 
119 #ifndef QT_NO_FREETYPE
120  FT_Face non_locked_face() const;
121  glyph_t glyphIndexToFreetypeGlyphIndex(glyph_t g) const;
122 #endif
123  uint toUnicode(glyph_t g) const;
124 
125 private:
126  QBitmap bitmapForGlyphs(const QGlyphLayout &glyphs, const glyph_metrics_t &metrics, QTextItem::RenderFlags flags = 0);
127 
128  XFontStruct *_fs;
131  int _cmap;
132  int lbearing, rbearing;
135  mutable int synth;
136 };
137 
138 #ifndef QT_NO_FONTCONFIG
139 
141 {
142 public:
143  QFontEngineMultiFT(QFontEngine *fe, FcPattern *firstEnginePattern, FcPattern *p, int s, const QFontDef &request);
145 
146  void loadEngine(int at);
147 
148 private:
150  FcPattern *pattern;
151  FcPattern *firstEnginePattern;
152  FcFontSet *fontSet;
153  int screen;
154  int firstFontIndex; // first font in fontset
155 };
156 
158 {
159 public:
160  explicit QFontEngineX11FT(const QFontDef &fontDef) : QFontEngineFT(fontDef) {}
161  explicit QFontEngineX11FT(FcPattern *pattern, const QFontDef &fd, int screen);
162  ~QFontEngineX11FT();
163 
165 
166 #ifndef QT_NO_XRENDER
168 #endif
169 
170 protected:
171  virtual bool uploadGlyphToServer(QGlyphSet *set, uint glyphid, Glyph *g, GlyphInfo *info, int glyphDataSize) const;
172  virtual unsigned long allocateServerGlyphSet();
173  virtual void freeServerGlyphSet(unsigned long id);
174 };
175 
176 #endif // QT_NO_FONTCONFIG
177 
179 
180 #endif // QFONTENGINE_X11_P_H
virtual qreal minRightBearing() const
double qreal
Definition: qglobal.h:1193
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
Definition: qpainterpath.h:67
#define Q_GUI_EXPORT
Definition: qglobal.h:1450
#define at(className, varName)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
virtual int synthesized() const
virtual QImage alphaMapForGlyph(glyph_t)
FcPattern * firstEnginePattern
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
XFontStruct * _fs
virtual QFontEngine * cloneWithSize(qreal) const
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
unsigned char uchar
Definition: qglobal.h:994
The QBitmap class provides monochrome (1-bit depth) pixmaps.
Definition: qbitmap.h:55
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
QFreetypeFace * freetype
static float pixelSize(const QFontDef &request, int dpi)
Definition: qfont_win.cpp:80
XGlyphInfo GlyphInfo
virtual qreal maxCharWidth() const
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
unsigned int uint
Definition: qglobal.h:996
int mib
virtual Type type() const
virtual FaceId faceId() const
virtual bool getSfntTableData(uint, uchar *, uint *) const
virtual bool canRender(const QChar *string, int len)
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
virtual void getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
QTextCodec * _codec
QFontEngine::FaceId face_id
static QString toUnicode(QTextCodec *tc, const char *str)
Definition: qsql_mysql.cpp:95
virtual QFixed leading() const
virtual const char * name() const
virtual qreal minLeftBearing() const
QFontEngineX11FT(const QFontDef &fontDef)
virtual QFixed ascent() const
virtual Properties properties() const
XFontStruct * fontStruct() const
virtual QFixed descent() const
QFactoryLoader * l
QFontEngineMultiXLFD(const QFontDef &r, const QList< int > &l, int s)
QFontDef fontDef
The QTextCodec class provides conversions between text encodings.
Definition: qtextcodec.h:62
unsigned int glyph_t
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const