42 #ifndef QFONTENGINE_P_H 43 #define QFONTENGINE_P_H 56 #include "QtCore/qglobal.h" 57 #include "QtCore/qatomic.h" 58 #include <QtCore/qvarlengtharray.h> 59 #include <QtCore/QLinkedList> 60 #include "private/qtextengine_p.h" 61 #include "private/qfont_p.h" 64 # include "QtCore/qt_windows.h" 68 # include "private/qt_mac_p.h" 69 # include "QtCore/qmap.h" 70 # include "QtCore/qcache.h" 71 # include "private/qcore_mac_p.h" 74 #include <private/qfontengineglyphcache_p.h> 87 #define MAKE_TAG(ch1, ch2, ch3, ch4) (\ 88 (((quint32)(ch1)) << 24) | \ 89 (((quint32)(ch2)) << 16) | \ 90 (((quint32)(ch3)) << 8) | \ 122 TestFontEngine = 0x1000
127 Format_Render = Format_None,
164 SynthesizedItalic = 0x1,
165 SynthesizedBold = 0x2,
166 SynthesizedStretch = 0x4
174 virtual bool stringToCMap(
const QChar *str,
int len,
QGlyphLayout *glyphs,
int *nglyphs, QTextEngine::ShaperFlags flags)
const = 0;
181 virtual void doKerning(
QGlyphLayout *, QTextEngine::ShaperFlags)
const;
183 #if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN) && !defined(Q_WS_QPA) 189 void getGlyphPositions(
const QGlyphLayout &glyphs,
const QTransform &matrix, QTextItem::RenderFlags flags,
206 return boundingBox(glyph, matrix);
209 virtual void removeGlyphFromCache(
glyph_t);
216 virtual QFixed ascent()
const = 0;
217 virtual QFixed descent()
const = 0;
218 virtual QFixed leading()
const = 0;
219 virtual QFixed xHeight()
const;
220 virtual QFixed averageCharWidth()
const;
222 virtual QFixed lineThickness()
const;
223 virtual QFixed underlinePosition()
const;
225 virtual qreal maxCharWidth()
const = 0;
229 virtual void getGlyphBearings(
glyph_t glyph,
qreal *leftBearing = 0,
qreal *rightBearing = 0);
231 virtual const char *
name()
const = 0;
233 virtual bool canRender(
const QChar *
string,
int len) = 0;
237 virtual int glyphCount()
const;
241 HB_Font harfbuzzFont()
const;
242 HB_Face harfbuzzFace()
const;
244 virtual HB_Error getPointInOutline(HB_Glyph glyph,
int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints);
249 static const uchar *getCMap(
const uchar *table,
uint tableSize,
bool *isSymbolFont,
int *cmapSize);
262 #if defined(Q_WS_WIN) || defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_WS_QPA) || defined(Q_OS_SYMBIAN) 273 void loadKerningPairs(
QFixed scalingFactor);
305 #if defined(Q_WS_QWS) 307 #ifndef QT_NO_QWS_QPF 317 virtual bool stringToCMap(
const QChar *str,
int len,
QGlyphLayout *glyphs,
int *nglyphs, QTextEngine::ShaperFlags flags)
const;
318 virtual void recalcAdvances(
QGlyphLayout *, QTextEngine::ShaperFlags)
const;
326 virtual QFixed ascent()
const;
327 virtual QFixed descent()
const;
328 virtual QFixed leading()
const;
329 virtual qreal maxCharWidth()
const;
330 virtual qreal minLeftBearing()
const;
331 virtual qreal minRightBearing()
const;
332 virtual QFixed underlinePosition()
const;
333 virtual QFixed lineThickness()
const;
337 virtual bool canRender(
const QChar *
string,
int len);
338 inline const char *
name()
const {
return 0; }
344 #endif // QT_NO_QWS_QPF 355 virtual bool stringToCMap(
const QChar *str,
int len,
QGlyphLayout *glyphs,
int *nglyphs, QTextEngine::ShaperFlags flags)
const;
356 virtual void recalcAdvances(
QGlyphLayout *, QTextEngine::ShaperFlags)
const;
358 #if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC) && !defined(Q_OS_SYMBIAN) 366 virtual QFixed ascent()
const;
367 virtual QFixed descent()
const;
368 virtual QFixed leading()
const;
369 virtual qreal maxCharWidth()
const;
377 virtual const char *
name()
const;
379 virtual bool canRender(
const QChar *
string,
int len);
382 inline int size()
const {
return _size; }
395 virtual bool stringToCMap(
const QChar *str,
int len,
QGlyphLayout *glyphs,
int *nglyphs,
396 QTextEngine::ShaperFlags flags)
const;
401 virtual void recalcAdvances(
QGlyphLayout *, QTextEngine::ShaperFlags)
const;
402 virtual void doKerning(
QGlyphLayout *, QTextEngine::ShaperFlags)
const;
404 virtual void getGlyphBearings(
glyph_t glyph,
qreal *leftBearing = 0,
qreal *rightBearing = 0);
406 virtual QFixed ascent()
const;
407 virtual QFixed descent()
const;
408 virtual QFixed leading()
const;
409 virtual QFixed xHeight()
const;
410 virtual QFixed averageCharWidth()
const;
413 virtual QFixed lineThickness()
const;
414 virtual QFixed underlinePosition()
const;
415 virtual qreal maxCharWidth()
const;
416 virtual qreal minLeftBearing()
const;
417 virtual qreal minRightBearing()
const;
422 virtual bool canRender(
const QChar *
string,
int len);
423 inline virtual const char *
name()
const 432 friend class QPSPrintEngineFontMulti;
442 virtual Type type()
const {
return TestFontEngine; }
448 # include "private/qfontengine_win_p.h" 451 #if defined(Q_OS_SYMBIAN) && !defined(QT_NO_FREETYPE) 452 # include "private/qfontengine_ft_p.h" 455 #endif // QFONTENGINE_P_H
bool operator==(const GlyphCacheEntry &other)
virtual Type type() const
virtual qreal minRightBearing() const
#define QT_END_NAMESPACE
This macro expands to.
The QAtomicInt class provides platform-independent atomic operations on integers. ...
bool operator==(const QFontEngine::FaceId &f1, const QFontEngine::FaceId &f2)
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
virtual qreal minLeftBearing() const
#define at(className, varName)
The QByteArray class provides an array of bytes.
virtual int synthesized() const
QLinkedList< GlyphCacheEntry > m_glyphCaches
The QString class provides a Unicode character string.
The QVector class is a template class that provides a dynamic array.
The QObject class is the base class of all Qt objects.
virtual QFontEngine * cloneWithSize(qreal) const
The QChar class provides a 16-bit Unicode character.
bool operator<(const KernPair &other) const
const char * name() const
The QLinkedList class is a template class that provides linked lists.
virtual qreal minRightBearing() const
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
static QList< QAxEngineDescriptor > engines
static const QCssKnownValue positions[NumKnownPositionModes - 1]
QExplicitlySharedDataPointer< QFontEngineGlyphCache > cache
static QFontEngine * loadEngine(int script, const QFontDef &request, QtFontFamily *family, QtFontFoundry *foundry, QtFontStyle *style, QtFontSize *size)
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
virtual FaceId faceId() const
virtual bool getSfntTableData(uint, uchar *, uint *) const
virtual qreal minLeftBearing() const
The QPaintEngine class provides an abstract definition of how QPainter draws to a given device on a g...
QVector< QFontEngine * > engines
QByteArray postscriptName
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
virtual const char * name() const
QTestFontEngine(int size)
virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat)
The QRawFont class provides access to a single physical instance of a font.
virtual QFixed emSquareSize() const
static const QCssKnownValue properties[NumProperties - 1]
QVector< KernPair > kerning_pairs
virtual Type type() const
uint qHash(const QFontEngine::FaceId &f)
QFontEngine * engine(int at) const
virtual bool supportsSubPixelPositions() const