Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QFontEngineMulti Class Reference

#include <qfontengine_p.h>

+ Inheritance diagram for QFontEngineMulti:
+ Collaboration diagram for QFontEngineMulti:

Public Member Functions

 QFontEngineMulti (QFontEngine *engine, int script, const QStringList &fallbackFamilies=QStringList())
 
 ~QFontEngineMulti ()
 
virtual glyph_t glyphIndex (uint ucs4) const override
 
virtual int stringToCMap (const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, ShaperFlags flags) const override
 
virtual glyph_metrics_t boundingBox (const QGlyphLayout &glyphs) override
 
virtual glyph_metrics_t boundingBox (glyph_t glyph) override
 
virtual void recalcAdvances (QGlyphLayout *, ShaperFlags) const override
 
virtual void doKerning (QGlyphLayout *, ShaperFlags) const override
 
virtual void addOutlineToPath (qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags) override
 
virtual void getGlyphBearings (glyph_t glyph, qreal *leftBearing=nullptr, qreal *rightBearing=nullptr) override
 
virtual QFixed ascent () const override
 
virtual QFixed capHeight () const override
 
virtual QFixed descent () const override
 
virtual QFixed leading () const override
 
virtual QFixed xHeight () const override
 
virtual QFixed averageCharWidth () const override
 
virtual QImage alphaMapForGlyph (glyph_t) override
 
virtual QImage alphaMapForGlyph (glyph_t glyph, const QFixedPoint &subPixelPosition) override
 
virtual QImage alphaMapForGlyph (glyph_t, const QTransform &t) override
 
virtual QImage alphaMapForGlyph (glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t) override
 
virtual QImage alphaRGBMapForGlyph (glyph_t, const QFixedPoint &subPixelPosition, const QTransform &t) override
 
virtual QFixed lineThickness () const override
 
virtual QFixed underlinePosition () const override
 
virtual qreal maxCharWidth () const override
 
virtual qreal minLeftBearing () const override
 
virtual qreal minRightBearing () const override
 
virtual bool canRender (const QChar *string, int len) const override
 
int fallbackFamilyCount () const
 
QString fallbackFamilyAt (int at) const
 
void setFallbackFamiliesList (const QStringList &fallbackFamilies)
 
QFontEngineengine (int at) const
 
void ensureEngineAt (int at)
 
- 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
 
bool isColorFont () const
 
virtual QFixed emSquareSize () 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)
 
void addBitmapFontToPath (qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)
 
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 (glyph_t glyph, const QTransform &matrix)
 
glyph_metrics_t tightBoundingBox (const QGlyphLayout &glyphs)
 
bool canRender (uint ucs4) 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 uchar highByte (glyph_t glyph)
 
static QFontEnginecreateMultiFontEngine (QFontEngine *fe, int script)
 
- Static Public Member Functions inherited from QFontEngine
static bool isIgnorableChar (char32_t ucs4)
 
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 Member Functions

virtual void ensureFallbackFamiliesQueried ()
 
virtual bool shouldLoadFontEngineForCharacter (int at, uint ucs4) const
 
virtual QFontEngineloadEngine (int at)
 
- 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
 

Additional Inherited Members

- 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 , FullStringFallback = 0x008 }
 
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 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 Attributes inherited from QFontEngine
QFixed m_ascent
 
QFixed m_descent
 
QFixed m_leading
 
bool m_heightMetricsQueried
 

Detailed Description

Definition at line 436 of file qfontengine_p.h.

Constructor & Destructor Documentation

◆ QFontEngineMulti()

QFontEngineMulti::QFontEngineMulti ( QFontEngine * engine,
int script,
const QStringList & fallbackFamilies = QStringList() )
explicit

Definition at line 1695 of file qfontengine.cpp.

References QFontEngine::cache_cost, engine, QFontEngine::fontDef, QFontEngine::Multi, Q_ASSERT, and QList< T >::resize().

+ Here is the call graph for this function:

◆ ~QFontEngineMulti()

QFontEngineMulti::~QFontEngineMulti ( )

Definition at line 1717 of file qfontengine.cpp.

References QList< T >::at(), QBasicAtomicInteger< T >::deref(), i, QFontEngine::ref, and QList< T >::size().

+ Here is the call graph for this function:

Member Function Documentation

◆ addOutlineToPath()

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

Reimplemented from QFontEngine.

Definition at line 2063 of file qfontengine.cpp.

References QGlyphLayout::advances, engine, QGlyphLayout::glyphs, highByte(), i, QGlyphLayout::mid(), QGlyphLayout::numGlyphs, QTextItem::RightToLeft, stripped(), and QFixed::toReal().

+ Here is the call graph for this function:

◆ alphaMapForGlyph() [1/4]

QImage QFontEngineMulti::alphaMapForGlyph ( glyph_t glyph,
const QFixedPoint & subPixelPosition )
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2295 of file qfontengine.cpp.

References engine, highByte(), and stripped().

+ Here is the call graph for this function:

◆ alphaMapForGlyph() [2/4]

QImage QFontEngineMulti::alphaMapForGlyph ( glyph_t glyph)
overridevirtual

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 2289 of file qfontengine.cpp.

References engine, highByte(), and stripped().

+ Here is the call graph for this function:

◆ alphaMapForGlyph() [3/4]

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

Reimplemented from QFontEngine.

Definition at line 2307 of file qfontengine.cpp.

References engine, highByte(), and stripped().

+ Here is the call graph for this function:

◆ alphaMapForGlyph() [4/4]

QImage QFontEngineMulti::alphaMapForGlyph ( glyph_t glyph,
const QTransform & t )
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2301 of file qfontengine.cpp.

References engine, highByte(), and stripped().

+ Here is the call graph for this function:

◆ alphaRGBMapForGlyph()

QImage QFontEngineMulti::alphaRGBMapForGlyph ( glyph_t glyph,
const QFixedPoint & subPixelPosition,
const QTransform & t )
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2315 of file qfontengine.cpp.

References engine, highByte(), and stripped().

+ Here is the call graph for this function:

◆ ascent()

QFixed QFontEngineMulti::ascent ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2214 of file qfontengine.cpp.

References engine.

◆ averageCharWidth()

QFixed QFontEngineMulti::averageCharWidth ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2233 of file qfontengine.cpp.

References engine.

◆ boundingBox() [1/2]

glyph_metrics_t QFontEngineMulti::boundingBox ( const QGlyphLayout & glyphs)
overridevirtual

Reimplemented from QFontEngine.

Definition at line 1993 of file qfontengine.cpp.

References engine, QGlyphLayout::glyphs, highByte(), i, QGlyphLayout::mid(), QGlyphLayout::numGlyphs, qMax(), qMin(), and stripped().

+ Here is the call graph for this function:

◆ boundingBox() [2/2]

glyph_metrics_t QFontEngineMulti::boundingBox ( glyph_t glyph)
overridevirtual

Implements QFontEngine.

Definition at line 2208 of file qfontengine.cpp.

References engine, highByte(), and stripped().

+ Here is the call graph for this function:

◆ canRender()

bool QFontEngineMulti::canRender ( const QChar * string,
int len ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2263 of file qfontengine.cpp.

References canRender(), engine, QFontEngine::GlyphIndicesOnly, i, QGlyphLayout::numGlyphs, and stringToCMap().

Referenced by canRender().

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

◆ capHeight()

QFixed QFontEngineMulti::capHeight ( ) const
overridevirtual

Implements QFontEngine.

Definition at line 2217 of file qfontengine.cpp.

References engine.

◆ createMultiFontEngine()

QFontEngine * QFontEngineMulti::createMultiFontEngine ( QFontEngine * fe,
int script )
static

Definition at line 2331 of file qfontengine.cpp.

References engine, QSet< T >::find(), QGuiApplicationPrivate::instance(), QFontCache::instance(), it, QFontEngine::Multi, and Q_ASSERT.

Referenced by QTextEngine::fontEngine().

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

◆ descent()

QFixed QFontEngineMulti::descent ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2220 of file qfontengine.cpp.

References engine.

◆ doKerning()

void QFontEngineMulti::doKerning ( QGlyphLayout * ,
ShaperFlags  ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2165 of file qfontengine.cpp.

References engine, QGlyphLayout::glyphs, highByte(), i, QGlyphLayout::mid(), QGlyphLayout::numGlyphs, and stripped().

+ Here is the call graph for this function:

◆ engine()

QFontEngine * QFontEngineMulti::engine ( int at) const
inline

Definition at line 480 of file qfontengine_p.h.

References at, and Q_ASSERT.

Referenced by QPainterPrivate::drawTextItem(), and QRawFont::fromFont().

+ Here is the caller graph for this function:

◆ ensureEngineAt()

void QFontEngineMulti::ensureEngineAt ( int at)

Definition at line 1758 of file qfontengine.cpp.

References QList< T >::at(), at, engine, ensureFallbackFamiliesQueried(), QFontEngine::fontDef, loadEngine(), QFontEngine::Multi, QFontDef::pixelSize, Q_ASSERT, and QList< T >::size().

Referenced by QPainterPrivate::drawTextItem(), QTextEngine::elidedText(), getGlyphBearings(), glyphIndex(), and stringToCMap().

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

◆ ensureFallbackFamiliesQueried()

void QFontEngineMulti::ensureFallbackFamiliesQueried ( )
protectedvirtual

Definition at line 1728 of file qfontengine.cpp.

References QFont::AnyStyle, QFontDef::families, QFontDef::fixedPitch, QFontEngine::fontDef, qt_fallbacksForFamily(), setFallbackFamiliesList(), QFontDef::style, QFontDef::styleHint, and QFont::TypeWriter.

Referenced by ensureEngineAt(), glyphIndex(), and stringToCMap().

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

◆ fallbackFamilyAt()

QString QFontEngineMulti::fallbackFamilyAt ( int at) const
inline

Definition at line 474 of file qfontengine_p.h.

References QString::at(), and at.

Referenced by loadEngine().

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

◆ fallbackFamilyCount()

int QFontEngineMulti::fallbackFamilyCount ( ) const
inline

Definition at line 473 of file qfontengine_p.h.

◆ getGlyphBearings()

void QFontEngineMulti::getGlyphBearings ( glyph_t glyph,
qreal * leftBearing = nullptr,
qreal * rightBearing = nullptr )
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2056 of file qfontengine.cpp.

References engine, ensureEngineAt(), highByte(), and stripped().

+ Here is the call graph for this function:

◆ glyphIndex()

glyph_t QFontEngineMulti::glyphIndex ( uint ucs4) const
overridevirtual

Implements QFontEngine.

Definition at line 1794 of file qfontengine.cpp.

References QList< T >::at(), QFontEngine::Box, engine, ensureEngineAt(), ensureFallbackFamiliesQueried(), QFontEngine::isIgnorableChar(), Q_ASSERT, qMin(), shouldLoadFontEngineForCharacter(), and QList< T >::size().

+ Here is the call graph for this function:

◆ highByte()

uchar QFontEngineMulti::highByte ( glyph_t glyph)
static

Definition at line 1688 of file qfontengine.cpp.

Referenced by addOutlineToPath(), alphaMapForGlyph(), alphaMapForGlyph(), alphaMapForGlyph(), alphaMapForGlyph(), alphaRGBMapForGlyph(), boundingBox(), boundingBox(), doKerning(), getGlyphBearings(), QCoreTextFontEngine::recalcAdvances(), and recalcAdvances().

+ Here is the caller graph for this function:

◆ leading()

QFixed QFontEngineMulti::leading ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2223 of file qfontengine.cpp.

References engine.

◆ lineThickness()

QFixed QFontEngineMulti::lineThickness ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2238 of file qfontengine.cpp.

References engine.

◆ loadEngine()

QFontEngine * QFontEngineMulti::loadEngine ( int at)
protectedvirtual

Definition at line 1773 of file qfontengine.cpp.

References at, engine, fallbackFamilyAt(), QFontDatabasePrivate::findFont(), QFontEngine::fontDef, QFont::NoFontMerging, request, and QFont::StyleNormal.

Referenced by ensureEngineAt().

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

◆ maxCharWidth()

qreal QFontEngineMulti::maxCharWidth ( ) const
overridevirtual

Implements QFontEngine.

Definition at line 2248 of file qfontengine.cpp.

References engine.

◆ minLeftBearing()

qreal QFontEngineMulti::minLeftBearing ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2253 of file qfontengine.cpp.

References engine.

◆ minRightBearing()

qreal QFontEngineMulti::minRightBearing ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2258 of file qfontengine.cpp.

References engine.

◆ recalcAdvances()

void QFontEngineMulti::recalcAdvances ( QGlyphLayout * ,
ShaperFlags  ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2122 of file qfontengine.cpp.

References engine, QGlyphLayout::glyphs, highByte(), i, QGlyphLayout::mid(), QGlyphLayout::numGlyphs, and stripped().

+ Here is the call graph for this function:

◆ setFallbackFamiliesList()

void QFontEngineMulti::setFallbackFamiliesList ( const QStringList & fallbackFamilies)

Definition at line 1739 of file qfontengine.cpp.

References QList< T >::at(), engine, QFontDef::families, QFontEngine::fontDef, Q_ASSERT, QList< T >::resize(), and QList< T >::size().

Referenced by ensureFallbackFamiliesQueried().

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

◆ shouldLoadFontEngineForCharacter()

bool QFontEngineMulti::shouldLoadFontEngineForCharacter ( int at,
uint ucs4 ) const
protectedvirtual

Reimplemented in QFontEngineMultiFontConfig.

Definition at line 1986 of file qfontengine.cpp.

References at, and Q_UNUSED.

Referenced by glyphIndex(), and stringToCMap().

+ Here is the caller graph for this function:

◆ stringToCMap()

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

Implements QFontEngine.

Definition at line 1824 of file qfontengine.cpp.

References QList< T >::at(), QFontEngine::Box, QFont::ContextFontMerging, QGlyphLayout::copy(), engine, ensureEngineAt(), ensureFallbackFamiliesQueried(), QFontEngine::fontDef, QFontEngine::GlyphIndicesOnly, QGlyphLayout::glyphs, QFontEngine::isColorFont(), QFontEngine::isIgnorableChar(), it, QGlyphLayout::mid(), QGlyphLayout::numGlyphs, Q_ASSERT, qMin(), shouldLoadFontEngineForCharacter(), QList< T >::size(), str, and QFontDef::styleStrategy.

Referenced by canRender().

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

◆ underlinePosition()

QFixed QFontEngineMulti::underlinePosition ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2243 of file qfontengine.cpp.

References engine.

◆ xHeight()

QFixed QFontEngineMulti::xHeight ( ) const
overridevirtual

Reimplemented from QFontEngine.

Definition at line 2228 of file qfontengine.cpp.

References engine.


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