![]() |
Qt 6.x
The Qt SDK
|
#include <qfontengine_coretext_p.h>
Public Types | |
enum | FontSmoothing { Disabled , Subpixel , Grayscale } |
![]() | |
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 } |
Static Public Member Functions | |
static FontSmoothing | fontSmoothing () |
static qreal | fontSmoothingGamma () |
static bool | ct_getSfntTable (void *user_data, uint tag, uchar *buffer, uint *length) |
static QFont::Weight | qtWeightFromCFWeight (float value) |
static QCoreTextFontEngine * | create (const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) |
![]() | |
static bool | scriptRequiresOpenType (QChar::Script script) |
static const uchar * | getCMap (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 | |
QCoreTextFontEngine (const QFontDef &def) | |
void | init () |
QImage | imageForGlyph (glyph_t glyph, const QFixedPoint &subPixelPosition, const QTransform &m, const QColor &color=QColor()) |
void | loadAdvancesForGlyphs (QVarLengthArray< CGGlyph > &cgGlyphs, QGlyphLayout *glyphs) const |
bool | hasColorGlyphs () const |
bool | shouldAntialias () const |
bool | shouldSmoothFont () const |
void | initializeHeightMetrics () const override |
![]() | |
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 |
Protected Attributes | |
QCFType< CTFontRef > | ctfont |
QCFType< CGFontRef > | cgFont |
int | synthesisFlags |
CGAffineTransform | transform |
QFixed | avgCharWidth |
QFixed | underlineThickness |
QFixed | underlinePos |
QFontEngine::FaceId | face_id |
bool | kerningPairsLoaded |
![]() | |
QFixed | m_ascent |
QFixed | m_descent |
QFixed | m_leading |
bool | m_heightMetricsQueried |
Additional Inherited Members | |
![]() | |
QAtomicInt | ref |
QFontDef | fontDef |
Holder | font_ |
Holder | face_ |
struct QFontEngine::FaceData | faceData |
uint | cache_cost |
uint | fsType: 16 |
bool | symbol |
bool | isSmoothlyScalable |
QList< KernPair > | kerning_pairs |
GlyphFormat | glyphFormat |
int | m_subPixelPositionCount |
Definition at line 31 of file qfontengine_coretext_p.h.
Enumerator | |
---|---|
Disabled | |
Subpixel | |
Grayscale |
Definition at line 85 of file qfontengine_coretext_p.h.
QCoreTextFontEngine::QCoreTextFontEngine | ( | CTFontRef | font, |
const QFontDef & | def | ||
) |
Definition at line 154 of file qfontengine_coretext.mm.
References cgFont, QCFType< T >::constructFromGet(), ctfont, font, and init().
QCoreTextFontEngine::QCoreTextFontEngine | ( | CGFontRef | font, |
const QFontDef & | def | ||
) |
Definition at line 162 of file qfontengine_coretext.mm.
References cgFont, QCFType< T >::constructFromGet(), ctfont, font, QFontEngine::fontDef, init(), and QFontDef::pixelSize.
QCoreTextFontEngine::~QCoreTextFontEngine | ( | ) |
Definition at line 177 of file qfontengine_coretext.mm.
|
protected |
Definition at line 170 of file qfontengine_coretext.mm.
References QFontEngine::fontDef, and qt_transform_from_fontdef().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 470 of file qfontengine_coretext.mm.
References convertCGPathToQPainterPath(), ctfont, QFontEngine::fontDef, hasColorGlyphs(), i, info, positions, QFontDef::stretch, synthesisFlags, QFontEngine::SynthesizedItalic, and SYNTHETIC_ITALIC_SKEW.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 502 of file qfontengine_coretext.mm.
References QFontEngine::alphaMapBoundingBox(), QFont::AnyStretch, boundingBox(), QFontEngine::fontDef, QFontEngine::Format_A32, QFontEngine::Format_A8, glyph_metrics_t::height, qcoretextfontengine_scaleMetrics(), QTransform::scale(), QFontDef::stretch, QTransform::TxScale, glyph_metrics_t::width, glyph_metrics_t::x, xform, and glyph_metrics_t::y.
Referenced by imageForGlyph().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 804 of file qfontengine_coretext.mm.
References QFontEngine::alphaMapForGlyph(), QImage::Format_Alpha8, QImage::height(), imageForGlyph(), qGray(), QImage::scanLine(), QTransform::TxScale, and QImage::width().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 799 of file qfontengine_coretext.mm.
References alphaMapForGlyph().
Referenced by alphaMapForGlyph().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 826 of file qfontengine_coretext.mm.
References QFontEngine::alphaRGBMapForGlyph(), imageForGlyph(), and QTransform::TxScale.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 347 of file qfontengine_coretext.mm.
References avgCharWidth.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 834 of file qfontengine_coretext.mm.
References QFontEngine::bitmapForGlyph(), imageForGlyph(), and QTransform::TxScale.
|
overridevirtual |
Implements QFontEngine.
Definition at line 304 of file qfontengine_coretext.mm.
References ctfont, QFixed::fromReal(), rect, ret, synthesisFlags, QFontEngine::SynthesizedItalic, and SYNTHETIC_ITALIC_SKEW.
Referenced by alphaMapBoundingBox(), getUnscaledGlyph(), and maxCharWidth().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 873 of file qfontengine_coretext.mm.
References ctfont, and QVarLengthArray< T, Prealloc >::data().
|
overridevirtual |
Implements QFontEngine.
Definition at line 333 of file qfontengine_coretext.mm.
References QFontEngine::calculatedCapHeight(), ctfont, and QFixed::fromReal().
|
overridevirtual |
Reimplemented from QFontEngine.
Reimplemented in QCoreTextRawFontEngine.
Definition at line 911 of file qfontengine_coretext.mm.
References cgFont, QFontEngine::fontDef, QFontDef::pixelSize, QFontDef::pointSize, and qt_defaultDpi().
|
static |
Definition at line 128 of file qfontengine_coretext.mm.
References cgFont, QFontDef::pixelSize, QFontDef::pointSize, Q_UNUSED, qt_defaultDpi(), and qWarning.
|
static |
Definition at line 55 of file qfontengine_coretext.mm.
References ctfont, Q_ASSERT, tag, and user_data.
Referenced by getFontDescription(), and getSfntTableData().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 976 of file qfontengine_coretext.mm.
References ctfont, QFontEngine::doKerning(), QFixed::fromReal(), kerningPairsLoaded, and QFontEngine::loadKerningPairs().
void QCoreTextFontEngine::draw | ( | CGContextRef | ctx, |
qreal | x, | ||
qreal | y, | ||
const QTextItemInt & | ti, | ||
int | paintDeviceHeight | ||
) |
Definition at line 366 of file qfontengine_coretext.mm.
References ctfont, QVarLengthArray< T, Prealloc >::data(), QTextItemInt::flags, QFontEngine::fontDef, QFontEngine::getGlyphPositions(), QTextItemInt::glyphs, i, lineThickness(), QFontDef::pixelSize, positions, Q_UNUSED, qt_scaleForTransform(), QVLABaseBase::size(), synthesisFlags, QFontEngine::SynthesizedBold, QFontEngine::SynthesizedItalic, SYNTHETIC_ITALIC_SKEW, and QFixed::toReal().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 906 of file qfontengine_coretext.mm.
References ctfont.
Referenced by properties().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 678 of file qfontengine_coretext.mm.
References fontSmoothing(), shouldSmoothFont(), and Subpixel.
Referenced by imageForGlyph().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 868 of file qfontengine_coretext.mm.
References face_id.
|
static |
Definition at line 599 of file qfontengine_coretext.mm.
References defaults, Disabled, font, fontSmoothing(), QImage::Format_RGB32, Grayscale, QImage::pixel(), qBlue(), qCDebug, qGreen(), qRed(), QRgb, sp, and Subpixel.
Referenced by expectsGammaCorrectedBlending(), fontSmoothing(), QCocoaTheme::handleSystemThemeChange(), imageForGlyph(), init(), and shouldSmoothFont().
|
static |
Definition at line 683 of file qfontengine_coretext.mm.
Referenced by QCocoaIntegration::styleHint().
|
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 879 of file qfontengine_coretext.mm.
References ct_getSfntTable(), ctfont, and tag.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 884 of file qfontengine_coretext.mm.
References boundingBox(), convertCGPathToQPainterPath(), ctfont, QFixed::fromReal(), glyph_metrics_t::height, info, QFixed::toReal(), glyph_metrics_t::width, glyph_metrics_t::x, glyph_metrics_t::xoff, glyph_metrics_t::y, and glyph_metrics_t::yoff.
Implements QFontEngine.
Definition at line 251 of file qfontengine_coretext.mm.
References ctfont, QChar::highSurrogate(), QChar::lowSurrogate(), Q_UNLIKELY, QChar::requiresSurrogates(), and str.
Referenced by maxCharWidth().
|
inlineoverridevirtual |
Reimplemented from QFontEngine.
Definition at line 81 of file qfontengine_coretext_p.h.
References Q_UNUSED.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 920 of file qfontengine_coretext.mm.
References ctfont.
|
protected |
Definition at line 360 of file qfontengine_coretext.mm.
References QFontEngine::Format_ARGB, and QFontEngine::glyphFormat.
Referenced by addGlyphsToPath(), imageForGlyph(), and shouldSmoothFont().
|
protected |
Definition at line 688 of file qfontengine_coretext.mm.
References alphaMapBoundingBox(), QImage::bits(), QImage::bytesPerLine(), QFixed::ceil(), ctfont, expectsGammaCorrectedBlending(), QImage::fill(), QFontEngine::fontDef, fontSmoothing(), QImage::Format_ARGB32_Premultiplied, QImage::Format_RGB32, QFontEngine::glyphFormat, Grayscale, hasColorGlyphs(), QImage::height(), glyph_metrics_t::height, QImage::invertPixels(), lineThickness(), QFontDef::pixelSize, Q_ASSERT, qGamma_correct_back_to_linear_cs(), qt_mac_bitmapInfoForImage(), qt_scaleForTransform(), shouldAntialias(), shouldSmoothFont(), synthesisFlags, QFontEngine::SynthesizedBold, QFontEngine::SynthesizedItalic, SYNTHETIC_ITALIC_SKEW, QFixed::toInt(), QFixed::toReal(), QFixed::truncate(), Qt::white, QImage::width(), glyph_metrics_t::width, QFixedPoint::x, glyph_metrics_t::x, QFixedPoint::y, and glyph_metrics_t::y.
Referenced by alphaMapForGlyph(), alphaRGBMapForGlyph(), and bitmapForGlyph().
|
protected |
Definition at line 181 of file qfontengine_coretext.mm.
References QFontEngine::averageCharWidth(), avgCharWidth, QFont::Bold, QFontEngine::cache_cost, cgFont, QByteArray::constData(), ctfont, face_id, QFontDef::families, QFontEngine::FaceId::filename, QFontEngine::fontDef, fontSmoothing(), QFontEngine::Format_A32, QFontEngine::Format_A8, QFontEngine::Format_ARGB, QFixed::fromReal(), QFontEngine::fsType, QFontEngine::getSfntTable(), QFontEngine::glyphFormat, QFontEngine::FaceId::index, kerningPairsLoaded, MAKE_TAG, QFontDef::pixelSize, Q_ASSERT, qAbs(), qEnvironmentVariableIsSet(), qtWeightFromCFWeight(), shouldSmoothFont(), QByteArray::size(), QFontDef::style, QFont::StyleItalic, QFontDef::styleName, QFont::StyleNormal, QFont::StyleOblique, Subpixel, synthesisFlags, QFontEngine::SynthesizedBold, QFontEngine::SynthesizedItalic, QFixed::toInt(), underlinePos, underlineThickness, and QFontDef::weight.
Referenced by QCoreTextFontEngine(), and QCoreTextFontEngine().
|
overrideprotectedvirtual |
Reimplemented from QFontEngine.
Definition at line 324 of file qfontengine_coretext.mm.
References ctfont, QFixed::fromReal(), QFontEngine::m_ascent, QFontEngine::m_descent, QFontEngine::m_heightMetricsQueried, and QFontEngine::m_leading.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 936 of file qfontengine_coretext.mm.
References underlineThickness.
Referenced by draw(), and imageForGlyph().
|
protected |
Definition at line 857 of file qfontengine_coretext.mm.
References QGlyphLayout::advances, QFont::AnyStretch, ctfont, QVarLengthArray< T, Prealloc >::data(), QFontEngine::fontDef, QFixed::fromReal(), i, QGlyphLayout::numGlyphs, and QFontDef::stretch.
Referenced by recalcAdvances(), and stringToCMap().
|
overridevirtual |
Implements QFontEngine.
Definition at line 352 of file qfontengine_coretext.mm.
References boundingBox(), glyphIndex(), QFixed::toReal(), and glyph_metrics_t::xoff.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 946 of file qfontengine_coretext.mm.
References ctfont, emSquareSize(), and QFixed::fromReal().
QCoreTextFontEngine::Q_ENUM | ( | FontSmoothing | ) |
|
static |
Definition at line 71 of file qfontengine_coretext.mm.
References QFont::Black, QFont::Bold, COMPARE_WEIGHT_DISTANCE, QFont::DemiBold, QFont::ExtraBold, QFont::ExtraLight, QFont::Light, QFont::Medium, QFont::Normal, qAbs(), ret, and QFont::Thin.
Referenced by getFontDescription(), and init().
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 842 of file qfontengine_coretext.mm.
References QGlyphLayout::glyphs, QFontEngineMulti::highByte(), i, loadAdvancesForGlyphs(), QGlyphLayout::numGlyphs, Q_ASSERT, and Q_UNUSED.
|
protected |
Definition at line 656 of file qfontengine_coretext.mm.
References QFontEngine::fontDef, QFont::NoAntialias, and QFontDef::styleStrategy.
Referenced by imageForGlyph(), and shouldSmoothFont().
|
protected |
Definition at line 661 of file qfontengine_coretext.mm.
References Disabled, QFontEngine::fontDef, fontSmoothing(), Grayscale, hasColorGlyphs(), QFont::NoSubpixelAntialias, shouldAntialias(), QFontDef::styleStrategy, and Subpixel.
Referenced by expectsGammaCorrectedBlending(), imageForGlyph(), and init().
|
overridevirtual |
Implements QFontEngine.
Definition at line 270 of file qfontengine_coretext.mm.
References ctfont, QVarLengthArray< T, Prealloc >::data(), QFontEngine::GlyphIndicesOnly, QGlyphLayout::glyphs, i, loadAdvancesForGlyphs(), QGlyphLayout::numGlyphs, Q_ASSERT, and str.
|
inlineoverridevirtual |
Reimplemented from QFontEngine.
Definition at line 57 of file qfontengine_coretext_p.h.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 925 of file qfontengine_coretext.mm.
References QTransform::TxScale.
|
inlineoverridevirtual |
Reimplemented from QFontEngine.
Definition at line 58 of file qfontengine_coretext_p.h.
|
inlineoverridevirtual |
Reimplemented from QFontEngine.
Definition at line 56 of file qfontengine_coretext_p.h.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 941 of file qfontengine_coretext.mm.
References underlinePos.
|
overridevirtual |
Reimplemented from QFontEngine.
Definition at line 342 of file qfontengine_coretext.mm.
References ctfont, and QFixed::fromReal().
|
protected |
Definition at line 110 of file qfontengine_coretext_p.h.
Referenced by averageCharWidth(), and init().
|
protected |
Definition at line 107 of file qfontengine_coretext_p.h.
Referenced by QCoreTextFontEngine(), QCoreTextFontEngine(), QCoreTextRawFontEngine::cloneWithSize(), cloneWithSize(), create(), and init().
|
protected |
Definition at line 106 of file qfontengine_coretext_p.h.
Referenced by QCoreTextFontEngine(), QCoreTextFontEngine(), addGlyphsToPath(), boundingBox(), canRender(), capHeight(), ct_getSfntTable(), doKerning(), draw(), emSquareSize(), getSfntTableData(), getUnscaledGlyph(), glyphIndex(), handle(), imageForGlyph(), init(), initializeHeightMetrics(), loadAdvancesForGlyphs(), properties(), stringToCMap(), and xHeight().
|
protected |
Definition at line 113 of file qfontengine_coretext_p.h.
|
mutableprotected |
Definition at line 114 of file qfontengine_coretext_p.h.
Referenced by doKerning(), and init().
|
protected |
Definition at line 108 of file qfontengine_coretext_p.h.
Referenced by addGlyphsToPath(), boundingBox(), draw(), imageForGlyph(), and init().
|
protected |
Definition at line 109 of file qfontengine_coretext_p.h.
|
protected |
Definition at line 112 of file qfontengine_coretext_p.h.
Referenced by init(), and underlinePosition().
|
protected |
Definition at line 111 of file qfontengine_coretext_p.h.
Referenced by init(), and lineThickness().