Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QFontEngineFT Class Reference

#include <qfontengine_ft_p.h>

+ Inheritance diagram for QFontEngineFT:
+ Collaboration diagram for QFontEngineFT:

Classes

struct  GlyphAndSubPixelPosition
 
struct  GlyphInfo
 
struct  QGlyphSet
 

Public Types

enum  Scaling { Scaled , Unscaled }
 
- Public Types inherited from QFontEngine
enum  Type {
  Box , Multi , Win , Mac ,
  Freetype , QPF1 , QPF2 , Proxy ,
  DirectWrite , TestFontEngine = 0x1000
}
 
enum  GlyphFormat {
  Format_None , Format_Render = Format_None , Format_Mono , Format_A8 ,
  Format_A32 , Format_ARGB
}
 
enum  ShaperFlag { DesignMetrics = 0x0002 , GlyphIndicesOnly = 0x0004 }
 
enum  SynthesizedFlags { SynthesizedItalic = 0x1 , SynthesizedBold = 0x2 , SynthesizedStretch = 0x4 }
 
enum  HintStyle { HintNone , HintLight , HintMedium , HintFull }
 
enum  SubpixelAntialiasingType {
  Subpixel_None , Subpixel_RGB , Subpixel_BGR , Subpixel_VRGB ,
  Subpixel_VBGR
}
 

Public Member Functions

QFontEngine::FaceId faceId () const override
 
QFontEngine::Properties properties () const override
 
QFixed emSquareSize () const override
 
bool supportsHorizontalSubPixelPositions () const override
 
bool supportsVerticalSubPixelPositions () const override
 
bool getSfntTableData (uint tag, uchar *buffer, uint *length) const override
 Returns true if the font table idetified by tag exists in the font; returns false otherwise.
 
int synthesized () const override
 
void initializeHeightMetrics () const override
 
QFixed capHeight () const override
 
QFixed xHeight () const override
 
QFixed averageCharWidth () const override
 
qreal maxCharWidth () const override
 
QFixed lineThickness () const override
 
QFixed underlinePosition () const override
 
glyph_t glyphIndex (uint ucs4) const override
 
void doKerning (QGlyphLayout *, ShaperFlags) const override
 
void getUnscaledGlyph (glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics) override
 
bool supportsTransformation (const QTransform &transform) const override
 
void addGlyphsToPath (glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags) override
 
void addOutlineToPath (qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags) override
 
bool stringToCMap (const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override
 
glyph_metrics_t boundingBox (const QGlyphLayout &glyphs) override
 
glyph_metrics_t boundingBox (glyph_t glyph) override
 
glyph_metrics_t boundingBox (glyph_t glyph, const QTransform &matrix) override
 
void recalcAdvances (QGlyphLayout *glyphs, ShaperFlags flags) const override
 
QImage alphaMapForGlyph (glyph_t g) override
 
QImage alphaMapForGlyph (glyph_t, const QFixedPoint &) override
 
QImage alphaMapForGlyph (glyph_t glyph, const QFixedPoint &subPixelPosition, const QTransform &t) override
 
QImage alphaRGBMapForGlyph (glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t) override
 
QImage bitmapForGlyph (glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t, const QColor &color) override
 
glyph_metrics_t alphaMapBoundingBox (glyph_t glyph, const QFixedPoint &subPixelPosition, const QTransform &matrix, QFontEngine::GlyphFormat format) override
 
GlyphglyphData (glyph_t glyph, const QFixedPoint &subPixelPosition, GlyphFormat neededFormat, const QTransform &t) override
 
bool hasInternalCaching () const override
 
bool expectsGammaCorrectedBlending () const override
 
void removeGlyphFromCache (glyph_t glyph) override
 
int glyphMargin (QFontEngine::GlyphFormat) override
 
int glyphCount () const override
 
FT_Face lockFace (Scaling scale=Scaled) const
 
void unlockFace () const
 
FT_Face non_locked_face () const
 
bool drawAntialiased () const
 
bool invalid () const
 
bool isBitmapFont () const
 
bool isScalableBitmap () const
 
GlyphloadGlyph (uint glyph, const QFixedPoint &subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false, bool disableOutlineDrawing=false) const
 
GlyphloadGlyph (QGlyphSet *set, uint glyph, const QFixedPoint &subPixelPosition, GlyphFormat=Format_None, bool fetchMetricsOnly=false, bool disableOutlineDrawing=false) const
 
GlyphloadGlyphFor (glyph_t g, const QFixedPoint &subPixelPosition, GlyphFormat format, const QTransform &t, bool fetchBoundingBox=false, bool disableOutlineDrawing=false)
 
QGlyphSetloadGlyphSet (const QTransform &matrix)
 
 QFontEngineFT (const QFontDef &fd)
 
virtual ~QFontEngineFT ()
 
bool init (FaceId faceId, bool antiaalias, GlyphFormat defaultFormat=Format_None, const QByteArray &fontData=QByteArray())
 
bool init (FaceId faceId, bool antialias, GlyphFormat format, QFreetypeFace *freetypeFace)
 
int getPointInOutline (glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints) override
 
void setQtDefaultHintStyle (QFont::HintingPreference hintingPreference)
 
void setDefaultHintStyle (HintStyle style) override
 
QFontEnginecloneWithSize (qreal pixelSize) const override
 
Qt::HANDLE handle () const override
 
bool initFromFontEngine (const QFontEngineFT *fontEngine)
 
HintStyle defaultHintStyle () const
 
- Public Member Functions inherited from QFontEngine
virtual ~QFontEngine ()
 
Type type () const
 
virtual Properties properties () const
 
virtual void getUnscaledGlyph (glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
 
QByteArray getSfntTable (uint tag) const
 
virtual bool getSfntTableData (uint tag, uchar *buffer, uint *length) const
 Returns true if the font table idetified by tag exists in the font; returns false otherwise.
 
virtual FaceId faceId () const
 
virtual int synthesized () const
 
bool supportsSubPixelPositions () const
 
virtual bool supportsHorizontalSubPixelPositions () const
 
virtual bool supportsVerticalSubPixelPositions () const
 
virtual QFixedPoint subPixelPositionFor (const QFixedPoint &position) const
 
QFixed subPixelPositionForX (QFixed x) const
 
virtual QFixed emSquareSize () const
 
virtual glyph_t glyphIndex (uint ucs4) const =0
 
virtual bool stringToCMap (const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const =0
 
virtual void recalcAdvances (QGlyphLayout *, ShaperFlags) const
 
virtual void doKerning (QGlyphLayout *, ShaperFlags) const
 
virtual void addGlyphsToPath (glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
 
void getGlyphPositions (const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
 
virtual void addOutlineToPath (qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
 
void addBitmapFontToPath (qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)
 
virtual QImage alphaMapForGlyph (glyph_t)
 
virtual QImage alphaMapForGlyph (glyph_t glyph, const QFixedPoint &subPixelPosition)
 
virtual QImage alphaMapForGlyph (glyph_t, const QTransform &t)
 
virtual QImage alphaMapForGlyph (glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t)
 
virtual QImage alphaRGBMapForGlyph (glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t)
 
virtual QImage bitmapForGlyph (glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t, const QColor &color=QColor())
 
virtual GlyphglyphData (glyph_t glyph, const QFixedPoint &subPixelPosition, GlyphFormat neededFormat, const QTransform &t)
 
virtual bool hasInternalCaching () const
 
virtual glyph_metrics_t alphaMapBoundingBox (glyph_t glyph, const QFixedPoint &, const QTransform &matrix, GlyphFormat)
 
virtual void removeGlyphFromCache (glyph_t)
 
virtual glyph_metrics_t boundingBox (const QGlyphLayout &glyphs)
 
virtual glyph_metrics_t boundingBox (glyph_t glyph)=0
 
virtual glyph_metrics_t boundingBox (glyph_t glyph, const QTransform &matrix)
 
glyph_metrics_t tightBoundingBox (const QGlyphLayout &glyphs)
 
virtual QFixed ascent () const
 
virtual QFixed capHeight () const =0
 
virtual QFixed descent () const
 
virtual QFixed leading () const
 
virtual QFixed xHeight () const
 
virtual QFixed averageCharWidth () const
 
virtual QFixed lineThickness () const
 
virtual QFixed underlinePosition () const
 
virtual qreal maxCharWidth () const =0
 
virtual qreal minLeftBearing () const
 
virtual qreal minRightBearing () const
 
virtual void getGlyphBearings (glyph_t glyph, qreal *leftBearing=nullptr, qreal *rightBearing=nullptr)
 
bool canRender (uint ucs4) const
 
virtual bool canRender (const QChar *str, int len) const
 
virtual bool supportsTransformation (const QTransform &transform) const
 
virtual int glyphCount () const
 
virtual int glyphMargin (GlyphFormat format)
 
virtual QFontEnginecloneWithSize (qreal) const
 
virtual Qt::HANDLE handle () const
 
voidharfbuzzFont () const
 
voidharfbuzzFace () const
 
bool supportsScript (QChar::Script script) const
 
virtual int getPointInOutline (glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints)
 
void clearGlyphCache (const void *key)
 
void setGlyphCache (const void *key, QFontEngineGlyphCache *data)
 
QFontEngineGlyphCacheglyphCache (const void *key, GlyphFormat format, const QTransform &transform, const QColor &color=QColor()) const
 
virtual bool hasUnreliableGlyphOutline () const
 
virtual bool expectsGammaCorrectedBlending () const
 
virtual void setDefaultHintStyle (HintStyle)
 
void loadKerningPairs (QFixed scalingFactor)
 

Static Public Member Functions

static QFontEngineFTcreate (const QFontDef &fontDef, FaceId faceId, const QByteArray &fontData=QByteArray())
 
static QFontEngineFTcreate (const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference)
 
- Static Public Member Functions inherited from QFontEngine
static bool scriptRequiresOpenType (QChar::Script script)
 
static const uchargetCMap (const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
 
static quint32 getTrueTypeGlyphIndex (const uchar *cmap, int cmapSize, uint unicode)
 
static QByteArray convertToPostscriptFontFamilyName (const QByteArray &fontFamily)
 

Protected Attributes

QFreetypeFacefreetype
 
int default_load_flags
 
HintStyle default_hint_style
 
bool antialias
 
bool transform
 
bool embolden
 
bool obliquen
 
SubpixelAntialiasingType subpixelType
 
int lcdFilterType
 
bool embeddedbitmap
 
bool cacheEnabled
 
bool forceAutoHint
 
bool stemDarkeningDriver
 
- Protected Attributes inherited from QFontEngine
QFixed m_ascent
 
QFixed m_descent
 
QFixed m_leading
 
bool m_heightMetricsQueried
 

Friends

class QFontEngineFTRawFont
 
class QFontconfigDatabase
 
class QFreeTypeFontDatabase
 
class QFontEngineMultiFontConfig
 

Additional Inherited Members

- Public Attributes inherited from QFontEngine
QAtomicInt ref
 
QFontDef fontDef
 
Holder font_
 
Holder face_
 
struct QFontEngine::FaceData faceData
 
uint cache_cost
 
uint fsType: 16
 
bool symbol
 
bool isSmoothlyScalable
 
QList< KernPairkerning_pairs
 
GlyphFormat glyphFormat
 
int m_subPixelPositionCount
 
- Protected Member Functions inherited from QFontEngine
 QFontEngine (Type type)
 
QFixed firstLeftBearing (const QGlyphLayout &glyphs)
 
QFixed lastRightBearing (const QGlyphLayout &glyphs)
 
QFixed calculatedCapHeight () const
 
virtual void initializeHeightMetrics () const
 
bool processHheaTable () const
 
bool processOS2Table () const
 

Detailed Description

Definition at line 96 of file qfontengine_ft_p.h.

Member Enumeration Documentation

◆ Scaling

Enumerator
Scaled 
Unscaled 

Definition at line 214 of file qfontengine_ft_p.h.

Constructor & Destructor Documentation

◆ QFontEngineFT()

QFontEngineFT::QFontEngineFT ( const QFontDef fd)

◆ ~QFontEngineFT()

QFontEngineFT::~QFontEngineFT ( )
virtual

Definition at line 736 of file qfontengine_ft.cpp.

References freetype, and QFreetypeFace::release().

+ Here is the call graph for this function:

Member Function Documentation

◆ addGlyphsToPath()

void QFontEngineFT::addGlyphsToPath ( glyph_t glyphs,
QFixedPoint positions,
int  nglyphs,
QPainterPath path,
QTextItem::RenderFlags  flags 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1510 of file qfontengine_ft.cpp.

References QFreetypeFace::addGlyphToPath(), embolden, lockFace(), obliquen, positions, unlockFace(), and Unscaled.

+ Here is the call graph for this function:

◆ addOutlineToPath()

void QFontEngineFT::addOutlineToPath ( qreal  x,
qreal  y,
const QGlyphLayout glyphs,
QPainterPath path,
QTextItem::RenderFlags  flags 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1486 of file qfontengine_ft.cpp.

References QFreetypeFace::addBitmapToPath(), QFontEngine::addOutlineToPath(), QFreetypeFace::face, freetype, QFontEngine::getGlyphPositions(), lockFace(), QGlyphLayout::numGlyphs, positions, QTransform::translate(), unlockFace(), and Unscaled.

+ Here is the call graph for this function:

◆ alphaMapBoundingBox()

glyph_metrics_t QFontEngineFT::alphaMapBoundingBox ( glyph_t  glyph,
const QFixedPoint subPixelPosition,
const QTransform matrix,
QFontEngine::GlyphFormat  format 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1822 of file qfontengine_ft.cpp.

References cacheEnabled, CEIL, emptyGlyph, QFreetypeFace::face, FLOOR, QFontEngine::Format_A8, QFontEngine::Format_Mono, freetype, glyph_metrics_t::height, isScalableBitmap(), loadGlyphFor(), lockFace(), ROUND, TRUNC, QTransform::TxTranslate, unlockFace(), glyph_metrics_t::width, glyph_metrics_t::x, glyph_metrics_t::xoff, and glyph_metrics_t::y.

Referenced by boundingBox().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ alphaMapForGlyph() [1/3]

QImage QFontEngineFT::alphaMapForGlyph ( glyph_t  glyph)
inlineoverridevirtual

Create a qimage with the alpha values for the glyph. Returns an image indexed_8 with index values ranging from 0=fully transparent to 255=opaque

Reimplemented from QFontEngine.

Definition at line 193 of file qfontengine_ft_p.h.

References alphaMapForGlyph().

Referenced by alphaMapForGlyph(), and alphaMapForGlyph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ alphaMapForGlyph() [2/3]

QImage QFontEngineFT::alphaMapForGlyph ( glyph_t  glyph,
const QFixedPoint subPixelPosition,
const QTransform t 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1957 of file qfontengine_ft.cpp.

References alphaMapFromGlyphData(), antialias, cacheEnabled, emptyGlyph, QFreetypeFace::face, QFontEngine::Format_A8, QFontEngine::Format_Mono, freetype, loadGlyphFor(), Qt::SmoothTransformation, and QTransform::TxTranslate.

+ Here is the call graph for this function:

◆ alphaMapForGlyph() [3/3]

QImage QFontEngineFT::alphaMapForGlyph ( glyph_t  g,
const QFixedPoint subPixelPosition 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1952 of file qfontengine_ft.cpp.

References alphaMapForGlyph().

+ Here is the call graph for this function:

◆ alphaRGBMapForGlyph()

QImage QFontEngineFT::alphaRGBMapForGlyph ( glyph_t  g,
const QFixedPoint subPixelPosition,
const QTransform t 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1979 of file qfontengine_ft.cpp.

References alphaMapFromGlyphData(), QFontEngine::alphaRGBMapForGlyph(), cacheEnabled, emptyGlyph, QFontEngine::Format_A32, loadGlyphFor(), and QTransform::TxRotate.

+ Here is the call graph for this function:

◆ averageCharWidth()

QFixed QFontEngineFT::averageCharWidth ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1327 of file qfontengine_ft.cpp.

References QFontEngine::averageCharWidth(), emSquareSize(), QFreetypeFace::face, freetype, lockFace(), and unlockFace().

+ Here is the call graph for this function:

◆ bitmapForGlyph()

QImage QFontEngineFT::bitmapForGlyph ( glyph_t  g,
const QFixedPoint subPixelPosition,
const QTransform t,
const QColor color 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2002 of file qfontengine_ft.cpp.

References cacheEnabled, QImage::copy(), QFontEngine::Glyph::data, emptyGlyph, QFontEngine::Format_ARGB, QImage::Format_ARGB32_Premultiplied, QImage::Format_Mono, QFontEngine::Format_Mono, QFontEngine::Glyph::height, loadGlyphFor(), Q_UNUSED, QTransform::scale(), Qt::SmoothTransformation, QFixed::toReal(), and QFontEngine::Glyph::width.

+ Here is the call graph for this function:

◆ boundingBox() [1/3]

◆ boundingBox() [2/3]

glyph_metrics_t QFontEngineFT::boundingBox ( glyph_t  glyph)
overridevirtual

Implements QFontEngine.

Definition at line 1776 of file qfontengine_ft.cpp.

References cacheEnabled, CEIL, emptyGlyph, FLOOR, QFontEngine::Format_None, QFontEngineFT::QGlyphSet::getGlyph(), glyph_metrics_t::height, isScalableBitmap(), loadGlyph(), lockFace(), ROUND, TRUNC, unlockFace(), glyph_metrics_t::width, glyph_metrics_t::x, glyph_metrics_t::xoff, and glyph_metrics_t::y.

+ Here is the call graph for this function:

◆ boundingBox() [3/3]

glyph_metrics_t QFontEngineFT::boundingBox ( glyph_t  glyph,
const QTransform matrix 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1817 of file qfontengine_ft.cpp.

References alphaMapBoundingBox(), and QFontEngine::Format_None.

+ Here is the call graph for this function:

◆ capHeight()

QFixed QFontEngineFT::capHeight ( ) const
overridevirtual

Implements QFontEngine.

Definition at line 1302 of file qfontengine_ft.cpp.

References QFontEngine::calculatedCapHeight(), QFreetypeFace::face, freetype, QFixed::fromFixed(), lockFace(), and unlockFace().

+ Here is the call graph for this function:

◆ cloneWithSize()

QFontEngine * QFontEngineFT::cloneWithSize ( qreal  pixelSize) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2176 of file qfontengine_ft.cpp.

References QFontEngine::fontDef, initFromFontEngine(), and QFontDef::pixelSize.

+ Here is the call graph for this function:

◆ create() [1/2]

QFontEngineFT * QFontEngineFT::create ( const QByteArray fontData,
qreal  pixelSize,
QFont::HintingPreference  hintingPreference 
)
static

◆ create() [2/2]

QFontEngineFT * QFontEngineFT::create ( const QFontDef fontDef,
FaceId  faceId,
const QByteArray fontData = QByteArray() 
)
static

Definition at line 631 of file qfontengine_ft.cpp.

References antialias, engine, faceId(), QFontEngine::fontDef, QFontEngine::Format_A32, QFontEngine::Format_A8, QFontEngine::Format_Mono, QFontDef::hintingPreference, QFont::NoAntialias, QFont::NoSubpixelAntialias, qWarning, QFontDef::styleStrategy, QFontEngine::Subpixel_None, subpixelAntialiasingTypeHint(), and subpixelType.

Referenced by QFreeTypeFontDatabase::fontEngine(), QFreeTypeFontDatabase::fontEngine(), and QCoreTextFontDatabaseEngineFactory< T >::fontEngine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ defaultHintStyle()

HintStyle QFontEngineFT::defaultHintStyle ( ) const
inline

Definition at line 266 of file qfontengine_ft_p.h.

◆ doKerning()

void QFontEngineFT::doKerning ( QGlyphLayout ,
ShaperFlags   
) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1358 of file qfontengine_ft.cpp.

References QFontEngine::DesignMetrics, QFontEngine::doKerning(), emSquareSize(), QFreetypeFace::face, freetype, QFontEngine::loadKerningPairs(), lockFace(), and unlockFace().

+ Here is the call graph for this function:

◆ drawAntialiased()

bool QFontEngineFT::drawAntialiased ( ) const
inline

Definition at line 223 of file qfontengine_ft_p.h.

◆ emSquareSize()

QFixed QFontEngineFT::emSquareSize ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1262 of file qfontengine_ft.cpp.

References QFreetypeFace::face, and freetype.

Referenced by averageCharWidth(), doKerning(), and xHeight().

+ Here is the caller graph for this function:

◆ expectsGammaCorrectedBlending()

bool QFontEngineFT::expectsGammaCorrectedBlending ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 901 of file qfontengine_ft.cpp.

References stemDarkeningDriver.

◆ faceId()

QFontEngine::FaceId QFontEngineFT::faceId ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1247 of file qfontengine_ft.cpp.

Referenced by create(), init(), init(), and initFromFontEngine().

+ Here is the caller graph for this function:

◆ getPointInOutline()

int QFontEngineFT::getPointInOutline ( glyph_t  glyph,
int  flags,
quint32  point,
QFixed xpos,
QFixed ypos,
quint32 nPoints 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2143 of file qfontengine_ft.cpp.

References QFontEngine::Format_A8, freetype, QFreetypeFace::getPointInOutline(), lockFace(), and unlockFace().

+ Here is the call graph for this function:

◆ getSfntTableData()

bool QFontEngineFT::getSfntTableData ( uint  tag,
uchar buffer,
uint length 
) const
overridevirtual

Returns true if the font table idetified by tag exists in the font; returns false otherwise.

If buffer is \nullptr, stores the size of the buffer required for the font table data, in bytes, in length. If buffer is not \nullptr and the capacity of the buffer, passed in length, is sufficient to store the font table data, also copies the font table data to buffer.

Note: returning false when the font table exists could lead to an undefined behavior.

Reimplemented from QFontEngine.

Definition at line 1270 of file qfontengine_ft.cpp.

References QFreetypeFace::face, freetype, ft_getSfntTable(), and tag.

+ Here is the call graph for this function:

◆ getUnscaledGlyph()

void QFontEngineFT::getUnscaledGlyph ( glyph_t  glyph,
QPainterPath path,
glyph_metrics_t metrics 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1451 of file qfontengine_ft.cpp.

References QFreetypeFace::addBitmapToPath(), QFreetypeFace::addGlyphToPath(), QFreetypeFace::face, freetype, QFixed::fromFixed(), lockFace(), QFreetypeFace::matrix, unlockFace(), and Unscaled.

+ Here is the call graph for this function:

◆ glyphCount()

int QFontEngineFT::glyphCount ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2037 of file qfontengine_ft.cpp.

References lockFace(), and unlockFace().

+ Here is the call graph for this function:

◆ glyphData()

QFontEngine::Glyph * QFontEngineFT::glyphData ( glyph_t  glyph,
const QFixedPoint subPixelPosition,
QFontEngine::GlyphFormat  neededFormat,
const QTransform t 
)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1896 of file qfontengine_ft.cpp.

References cacheEnabled, QFontEngine::Format_A8, QFontEngine::Format_Mono, QFontEngine::Format_None, glyphIndex(), QFontEngine::Glyph::height, isBitmapFont(), loadGlyphFor(), Q_ASSERT, and QFontEngine::Glyph::width.

+ Here is the call graph for this function:

◆ glyphIndex()

glyph_t QFontEngineFT::glyphIndex ( uint  ucs4) const
overridevirtual

Implements QFontEngine.

Definition at line 1532 of file qfontengine_ft.cpp.

References QFreetypeFace::cmapCache, QFreetypeFace::cmapCacheSize, QFreetypeFace::face, freetype, QChar::Nbsp, QChar::Space, QFontEngine::symbol, QFreetypeFace::symbol_map, QChar::Tabulation, and QFreetypeFace::unicode_map.

Referenced by glyphData().

+ Here is the caller graph for this function:

◆ glyphMargin()

int QFontEngineFT::glyphMargin ( QFontEngine::GlyphFormat  )
inlineoverridevirtual

Reimplemented from QFontEngine.

Definition at line 210 of file qfontengine_ft_p.h.

◆ handle()

Qt::HANDLE QFontEngineFT::handle ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2189 of file qfontengine_ft.cpp.

References non_locked_face().

+ Here is the call graph for this function:

◆ hasInternalCaching()

bool QFontEngineFT::hasInternalCaching ( ) const
inlineoverridevirtual

Reimplemented from QFontEngine.

Definition at line 206 of file qfontengine_ft_p.h.

◆ init() [1/2]

bool QFontEngineFT::init ( FaceId  faceId,
bool  antiaalias,
GlyphFormat  defaultFormat = Format_None,
const QByteArray fontData = QByteArray() 
)

Definition at line 742 of file qfontengine_ft.cpp.

References antialias, faceId(), QFreetypeFace::getFace(), and init().

Referenced by init(), and initFromFontEngine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init() [2/2]

◆ initFromFontEngine()

bool QFontEngineFT::initFromFontEngine ( const QFontEngineFT fontEngine)

Definition at line 2154 of file qfontengine_ft.cpp.

References antialias, default_hint_style, default_load_flags, embeddedbitmap, embolden, faceId(), freetype, init(), lcdFilterType, obliquen, QBasicAtomicInteger< T >::ref(), subpixelType, and transform.

Referenced by cloneWithSize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initializeHeightMetrics()

void QFontEngineFT::initializeHeightMetrics ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1287 of file qfontengine_ft.cpp.

References QFixed::fromFixed(), QFontEngine::initializeHeightMetrics(), QFontEngine::m_ascent, QFontEngine::m_descent, and QFontEngine::m_leading.

+ Here is the call graph for this function:

◆ invalid()

bool QFontEngineFT::invalid ( ) const
inline

Definition at line 224 of file qfontengine_ft_p.h.

◆ isBitmapFont()

bool QFontEngineFT::isBitmapFont ( ) const
inline

Definition at line 225 of file qfontengine_ft_p.h.

Referenced by glyphData().

+ Here is the caller graph for this function:

◆ isScalableBitmap()

bool QFontEngineFT::isScalableBitmap ( ) const
inline

Definition at line 226 of file qfontengine_ft_p.h.

Referenced by alphaMapBoundingBox(), boundingBox(), boundingBox(), init(), and loadGlyph().

+ Here is the caller graph for this function:

◆ lineThickness()

QFixed QFontEngineFT::lineThickness ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1348 of file qfontengine_ft.cpp.

◆ loadGlyph() [1/2]

◆ loadGlyph() [2/2]

Glyph * QFontEngineFT::loadGlyph ( uint  glyph,
const QFixedPoint subPixelPosition,
GlyphFormat  format = Format_None,
bool  fetchMetricsOnly = false,
bool  disableOutlineDrawing = false 
) const
inline

Definition at line 228 of file qfontengine_ft_p.h.

Referenced by boundingBox(), boundingBox(), loadGlyphFor(), and recalcAdvances().

+ Here is the caller graph for this function:

◆ loadGlyphFor()

QFontEngineFT::Glyph * QFontEngineFT::loadGlyphFor ( glyph_t  g,
const QFixedPoint subPixelPosition,
GlyphFormat  format,
const QTransform t,
bool  fetchBoundingBox = false,
bool  disableOutlineDrawing = false 
)

Definition at line 1923 of file qfontengine_ft.cpp.

References QFontEngine::Glyph::data, default_hint_style, QFontEngine::Glyph::format, freetype, QFontEngineFT::QGlyphSet::getGlyph(), QFontEngine::HintNone, is2dRotation(), loadGlyph(), loadGlyphSet(), lockFace(), QFreetypeFace::matrix, QFontEngineFT::QGlyphSet::outline_drawing, QTransformToFTMatrix(), QFontEngineFT::QGlyphSet::transformationMatrix, QTransform::TxScale, and unlockFace().

Referenced by alphaMapBoundingBox(), alphaMapForGlyph(), alphaRGBMapForGlyph(), bitmapForGlyph(), and glyphData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadGlyphSet()

QFontEngineFT::QGlyphSet * QFontEngineFT::loadGlyphSet ( const QTransform matrix)

Definition at line 1439 of file qfontengine_ft.cpp.

References cacheEnabled, QFreetypeFace::face, QFontEngine::fontDef, freetype, QTransform::TxShear, and QTransform::TxTranslate.

Referenced by loadGlyphFor().

+ Here is the caller graph for this function:

◆ lockFace()

FT_Face QFontEngineFT::lockFace ( Scaling  scale = Scaled) const

Definition at line 2048 of file qfontengine_ft.cpp.

References QFreetypeFace::face, freetype, QFreetypeFace::lock(), QFreetypeFace::matrix, Unscaled, QFreetypeFace::xsize, and QFreetypeFace::ysize.

Referenced by addGlyphsToPath(), addOutlineToPath(), alphaMapBoundingBox(), averageCharWidth(), boundingBox(), boundingBox(), capHeight(), doKerning(), getPointInOutline(), getUnscaledGlyph(), glyphCount(), init(), loadGlyphFor(), recalcAdvances(), and xHeight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ maxCharWidth()

qreal QFontEngineFT::maxCharWidth ( ) const
overridevirtual

Implements QFontEngine.

Definition at line 1340 of file qfontengine_ft.cpp.

References QFixed::fromFixed(), and QFixed::toReal().

+ Here is the call graph for this function:

◆ non_locked_face()

FT_Face QFontEngineFT::non_locked_face ( ) const

Definition at line 2078 of file qfontengine_ft.cpp.

References QFreetypeFace::face, and freetype.

Referenced by handle().

+ Here is the caller graph for this function:

◆ properties()

QFontEngine::Properties QFontEngineFT::properties ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1252 of file qfontengine_ft.cpp.

References QFontEngine::convertToPostscriptFontFamilyName(), QFontDef::families, QFontEngine::fontDef, freetype, QFontEngine::Properties::postscriptName, and QFreetypeFace::properties().

+ Here is the call graph for this function:

◆ recalcAdvances()

void QFontEngineFT::recalcAdvances ( QGlyphLayout glyphs,
ShaperFlags  flags 
) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1677 of file qfontengine_ft.cpp.

References QGlyphLayout::advances, cacheEnabled, emptyGlyph, QFontEngine::Format_Mono, QFontEngine::Format_None, QFixed::fromFixed(), QFontEngineFT::QGlyphSet::getGlyph(), QGlyphLayout::glyphs, i, loadGlyph(), lockFace(), QGlyphLayout::numGlyphs, QFixed::round(), and unlockFace().

Referenced by stringToCMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeGlyphFromCache()

void QFontEngineFT::removeGlyphFromCache ( glyph_t  glyph)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2032 of file qfontengine_ft.cpp.

References QFontEngineFT::QGlyphSet::removeGlyphFromCache().

+ Here is the call graph for this function:

◆ setDefaultHintStyle()

void QFontEngineFT::setDefaultHintStyle ( HintStyle  style)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 896 of file qfontengine_ft.cpp.

References default_hint_style.

Referenced by setQtDefaultHintStyle().

+ Here is the caller graph for this function:

◆ setQtDefaultHintStyle()

void QFontEngineFT::setQtDefaultHintStyle ( QFont::HintingPreference  hintingPreference)

Definition at line 878 of file qfontengine_ft.cpp.

References ftInitialDefaultHintStyle, QFontEngine::HintFull, QFontEngine::HintLight, QFontEngine::HintNone, QFont::PreferDefaultHinting, QFont::PreferFullHinting, QFont::PreferNoHinting, QFont::PreferVerticalHinting, and setDefaultHintStyle().

+ Here is the call graph for this function:

◆ stringToCMap()

bool QFontEngineFT::stringToCMap ( const QChar str,
int  len,
QGlyphLayout glyphs,
int *  nglyphs,
ShaperFlags  flags 
) const
overridevirtual

Implements QFontEngine.

Definition at line 1564 of file qfontengine_ft.cpp.

References QFreetypeFace::cmapCache, QFreetypeFace::cmapCacheSize, QFreetypeFace::face, freetype, QFontEngine::GlyphIndicesOnly, QGlyphLayout::glyphs, it, QGlyphLayout::numGlyphs, Q_ASSERT, recalcAdvances(), str, QFontEngine::symbol, QFreetypeFace::symbol_map, and QFreetypeFace::unicode_map.

+ Here is the call graph for this function:

◆ supportsHorizontalSubPixelPositions()

bool QFontEngineFT::supportsHorizontalSubPixelPositions ( ) const
inlineoverridevirtual

Reimplemented from QFontEngine.

Definition at line 151 of file qfontengine_ft_p.h.

◆ supportsTransformation()

bool QFontEngineFT::supportsTransformation ( const QTransform transform) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1481 of file qfontengine_ft.cpp.

References QTransform::TxRotate.

◆ supportsVerticalSubPixelPositions()

bool QFontEngineFT::supportsVerticalSubPixelPositions ( ) const
inlineoverridevirtual

Reimplemented from QFontEngine.

Definition at line 157 of file qfontengine_ft_p.h.

◆ synthesized()

◆ underlinePosition()

QFixed QFontEngineFT::underlinePosition ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1353 of file qfontengine_ft.cpp.

◆ unlockFace()

void QFontEngineFT::unlockFace ( ) const

Definition at line 2073 of file qfontengine_ft.cpp.

References freetype, and QFreetypeFace::unlock().

Referenced by addGlyphsToPath(), addOutlineToPath(), alphaMapBoundingBox(), averageCharWidth(), boundingBox(), boundingBox(), capHeight(), doKerning(), getPointInOutline(), getUnscaledGlyph(), glyphCount(), init(), loadGlyphFor(), recalcAdvances(), and xHeight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ xHeight()

QFixed QFontEngineFT::xHeight ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1314 of file qfontengine_ft.cpp.

References emSquareSize(), QFreetypeFace::face, freetype, lockFace(), unlockFace(), and QFontEngine::xHeight().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ QFontconfigDatabase

friend class QFontconfigDatabase
friend

Definition at line 289 of file qfontengine_ft_p.h.

◆ QFontEngineFTRawFont

friend class QFontEngineFTRawFont
friend

Definition at line 288 of file qfontengine_ft_p.h.

◆ QFontEngineMultiFontConfig

friend class QFontEngineMultiFontConfig
friend

Definition at line 291 of file qfontengine_ft_p.h.

◆ QFreeTypeFontDatabase

friend class QFreeTypeFontDatabase
friend

Definition at line 290 of file qfontengine_ft_p.h.

Member Data Documentation

◆ antialias

bool QFontEngineFT::antialias
protected

◆ cacheEnabled

◆ default_hint_style

HintStyle QFontEngineFT::default_hint_style
protected

◆ default_load_flags

int QFontEngineFT::default_load_flags
mutableprotected

Definition at line 274 of file qfontengine_ft_p.h.

Referenced by QFontEngineFT(), initFromFontEngine(), and loadGlyph().

◆ embeddedbitmap

bool QFontEngineFT::embeddedbitmap
protected

Definition at line 282 of file qfontengine_ft_p.h.

Referenced by QFontEngineFT(), and initFromFontEngine().

◆ embolden

bool QFontEngineFT::embolden
protected

◆ forceAutoHint

bool QFontEngineFT::forceAutoHint
protected

Definition at line 284 of file qfontengine_ft_p.h.

Referenced by QFontEngineFT().

◆ freetype

◆ lcdFilterType

int QFontEngineFT::lcdFilterType
protected

Definition at line 281 of file qfontengine_ft_p.h.

Referenced by QFontEngineFT(), initFromFontEngine(), and loadGlyph().

◆ obliquen

bool QFontEngineFT::obliquen
protected

◆ stemDarkeningDriver

bool QFontEngineFT::stemDarkeningDriver
protected

Definition at line 285 of file qfontengine_ft_p.h.

Referenced by QFontEngineFT(), expectsGammaCorrectedBlending(), and init().

◆ subpixelType

SubpixelAntialiasingType QFontEngineFT::subpixelType
protected

Definition at line 280 of file qfontengine_ft_p.h.

Referenced by QFontEngineFT(), create(), initFromFontEngine(), and loadGlyph().

◆ transform

bool QFontEngineFT::transform
protected

Definition at line 277 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine().


The documentation for this class was generated from the following files: