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
qfontengine_ft.cpp File Reference

(1593b1f6d610ce9bdb9dff4104f7f447e03a9585)

#include "qdir.h"
#include "qmetatype.h"
#include "qtextstream.h"
#include "qvariant.h"
#include "qfontengine_ft_p.h"
#include "private/qimage_p.h"
#include <private/qstringiterator_p.h>
#include <qguiapplication.h>
#include <qscreen.h>
#include <qpa/qplatformscreen.h>
#include <QtCore/QUuid>
#include <QtCore/QLoggingCategory>
#include <QtGui/QPainterPath>
#include "qfile.h"
#include "qfileinfo.h"
#include <qscopedvaluerollback.h>
#include "qthreadstorage.h"
#include <qmath.h>
#include <qendian.h>
#include <memory>
#include <ft2build.h>
+ Include dependency graph for qfontengine_ft.cpp:

Go to the source code of this file.

Classes

class  QtFreetypeData
 
struct  QtFreetypeData::FaceStyle
 

Macros

#define QT_MAX_CACHED_GLYPH_SIZE   64
 
#define FLOOR(x)   ((x) & -64)
 
#define CEIL(x)   (((x)+63) & -64)
 
#define TRUNC(x)   ((x) >> 6)
 
#define ROUND(x)   (((x)+32) & -64)
 
#define GLYPH2PATH_DEBUG   QT_NO_QDEBUG_MACRO
 

Functions

static bool ft_getSfntTable (void *user_data, uint tag, uchar *buffer, uint *length)
 
bool operator== (const QtFreetypeData::FaceStyle &style1, const QtFreetypeData::FaceStyle &style2)
 
size_t qHash (const QtFreetypeData::FaceStyle &style, size_t seed)
 
QtFreetypeDataqt_getFreetypeData ()
 
FT_Library qt_getFreetype ()
 
QByteArray qt_fontdata_from_index (int)
 
static int computeFaceIndex (const QString &faceFileName, const QString &styleName)
 
static void scaleOutline (FT_Face face, FT_GlyphSlot g, FT_Fixed x_scale, FT_Fixed y_scale)
 
void qt_addBitmapToPath (qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path)
 
static void convertRGBToARGB (const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr)
 
static void convertRGBToARGB_V (const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr)
 
static QFontEngine::SubpixelAntialiasingType subpixelAntialiasingTypeHint ()
 
static void dont_delete (void *)
 
static FT_UShort calculateActualWeight (QFreetypeFace *freetypeFace, FT_Face face, QFontEngine::FaceId faceId)
 
static bool calculateActualItalic (QFreetypeFace *freetypeFace, FT_Face face, QFontEngine::FaceId faceId)
 
static bool areMetricsTooLarge (const QFontEngineFT::GlyphInfo &info)
 
static void transformBoundingBox (int *left, int *top, int *right, int *bottom, FT_Matrix *matrix)
 
static FT_Matrix QTransformToFTMatrix (const QTransform &matrix)
 
static QImage alphaMapFromGlyphData (QFontEngineFT::Glyph *glyph, QFontEngine::GlyphFormat glyphFormat)
 
static bool is2dRotation (const QTransform &t)
 

Variables

static QFontEngineFT::Glyph emptyGlyph
 
static const QFontEngine::HintStyle ftInitialDefaultHintStyle
 

Macro Definition Documentation

◆ CEIL

#define CEIL ( x)    (((x)+63) & -64)

◆ FLOOR

◆ GLYPH2PATH_DEBUG

#define GLYPH2PATH_DEBUG   QT_NO_QDEBUG_MACRO

Definition at line 565 of file qfontengine_ft.cpp.

Referenced by QFreetypeFace::addGlyphToPath().

◆ QT_MAX_CACHED_GLYPH_SIZE

#define QT_MAX_CACHED_GLYPH_SIZE   64

Definition at line 53 of file qfontengine_ft.cpp.

◆ ROUND

#define ROUND ( x)    (((x)+32) & -64)

◆ TRUNC

#define TRUNC ( x)    ((x) >> 6)

Definition at line 64 of file qfontengine_ft.cpp.

Function Documentation

◆ alphaMapFromGlyphData()

static QImage alphaMapFromGlyphData ( QFontEngineFT::Glyph * glyph,
QFontEngine::GlyphFormat glyphFormat )
inlinestatic

Definition at line 1988 of file qfontengine_ft.cpp.

References QFontEngine::Glyph::data, QFontEngine::Format_A32, QFontEngine::Format_A8, QImage::Format_Alpha8, QImage::Format_Invalid, QImage::Format_Mono, QFontEngine::Format_Mono, QImage::Format_RGB32, QFontEngine::glyphFormat, QFontEngine::Glyph::height, Qt::white, and QFontEngine::Glyph::width.

Referenced by QFontEngineFT::alphaMapForGlyph(), and QFontEngineFT::alphaRGBMapForGlyph().

+ Here is the caller graph for this function:

◆ areMetricsTooLarge()

static bool areMetricsTooLarge ( const QFontEngineFT::GlyphInfo & info)
inlinestatic

Definition at line 1058 of file qfontengine_ft.cpp.

References info.

Referenced by QFontEngineFT::loadGlyph().

+ Here is the caller graph for this function:

◆ calculateActualItalic()

static bool calculateActualItalic ( QFreetypeFace * freetypeFace,
FT_Face face,
QFontEngine::FaceId faceId )
static

Definition at line 853 of file qfontengine_ft.cpp.

References QFontEngine::FaceId::instanceIndex, QFont::Tag::value(), and var.

Referenced by QFontEngineFT::init().

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

◆ calculateActualWeight()

static FT_UShort calculateActualWeight ( QFreetypeFace * freetypeFace,
FT_Face face,
QFontEngine::FaceId faceId )
static

Definition at line 836 of file qfontengine_ft.cpp.

References QFontEngine::FaceId::instanceIndex, QFont::Tag::value(), and var.

Referenced by QFontEngineFT::init().

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

◆ computeFaceIndex()

static int computeFaceIndex ( const QString & faceFileName,
const QString & styleName )
static

Definition at line 407 of file qfontengine_ft.cpp.

References QByteArray::constData(), error, Qt::hex(), qDebug, qt_getFreetype(), and QString::toUtf8().

Referenced by QFreetypeFace::getFaceIndexByStyleName().

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

◆ convertRGBToARGB()

static void convertRGBToARGB ( const uchar * src,
uint * dst,
int width,
int height,
int src_pitch,
bool bgr )
inlinestatic

Definition at line 671 of file qfontengine_ft.cpp.

References red.

Referenced by QFontEngineFT::loadGlyph().

+ Here is the caller graph for this function:

◆ convertRGBToARGB_V()

static void convertRGBToARGB_V ( const uchar * src,
uint * dst,
int width,
int height,
int src_pitch,
bool bgr )
inlinestatic

Definition at line 688 of file qfontengine_ft.cpp.

References red.

Referenced by QFontEngineFT::loadGlyph().

+ Here is the caller graph for this function:

◆ dont_delete()

static void dont_delete ( void * )
static

Definition at line 834 of file qfontengine_ft.cpp.

Referenced by QFontEngineFT::init().

+ Here is the caller graph for this function:

◆ ft_getSfntTable()

static bool ft_getSfntTable ( void * user_data,
uint tag,
uchar * buffer,
uint * length )
static

Definition at line 67 of file qfontengine_ft.cpp.

References Q_ASSERT, tag, and user_data.

Referenced by QFreetypeFace::getSfntTable(), QFontEngineFT::getSfntTableData(), and QFontEngineFT::init().

+ Here is the caller graph for this function:

◆ is2dRotation()

static bool is2dRotation ( const QTransform & t)
inlinestatic

Definition at line 2039 of file qfontengine_ft.cpp.

References qFuzzyCompare().

Referenced by QFontEngineFT::loadGlyphFor().

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

◆ operator==()

bool operator== ( const QtFreetypeData::FaceStyle & style1,
const QtFreetypeData::FaceStyle & style2 )
inline

Definition at line 128 of file qfontengine_ft.cpp.

◆ qHash()

size_t qHash ( const QtFreetypeData::FaceStyle & style,
size_t seed )
inline

Definition at line 133 of file qfontengine_ft.cpp.

References QtFreetypeData::FaceStyle::faceFileName, qHashMulti(), seed, and QtFreetypeData::FaceStyle::styleName.

+ Here is the call graph for this function:

◆ qt_addBitmapToPath()

void qt_addBitmapToPath ( qreal x0,
qreal y0,
const uchar * image_data,
int bpl,
int w,
int h,
QPainterPath * path )
extern

Definition at line 680 of file qfontengine.cpp.

References collectSingleContour(), EdgeDown, EdgeLeft, EdgeRight, EdgeUp, GRID, and SET.

Referenced by QFontEngine::addBitmapFontToPath(), and QFreetypeFace::addBitmapToPath().

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

◆ qt_fontdata_from_index()

QByteArray qt_fontdata_from_index ( int index)
extern

Definition at line 2153 of file qfontdatabase.cpp.

References QFontDatabasePrivate::instance().

Referenced by QFreetypeFace::getFace().

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

◆ qt_getFreetype()

FT_Library qt_getFreetype ( )

Definition at line 156 of file qfontengine_ft.cpp.

References Q_ASSERT, and qt_getFreetypeData().

Referenced by QFreeTypeFontDatabase::addNamedInstancesForFace(), QFreeTypeFontDatabase::addTTFile(), computeFaceIndex(), QFreetypeFace::getFace(), QFontEngineFT::init(), and queryFont().

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

◆ qt_getFreetypeData()

QtFreetypeData * qt_getFreetypeData ( )

Definition at line 140 of file qfontengine_ft.cpp.

Referenced by QFreetypeFace::getFace(), QFreetypeFace::getFaceIndexByStyleName(), qt_getFreetype(), and QFreetypeFace::release().

+ Here is the caller graph for this function:

◆ QTransformToFTMatrix()

static FT_Matrix QTransformToFTMatrix ( const QTransform & matrix)
inlinestatic

Definition at line 1497 of file qfontengine_ft.cpp.

Referenced by QFontEngineFT::loadGlyphFor().

+ Here is the caller graph for this function:

◆ scaleOutline()

static void scaleOutline ( FT_Face face,
FT_GlyphSlot g,
FT_Fixed x_scale,
FT_Fixed y_scale )
static

Definition at line 552 of file qfontengine_ft.cpp.

Referenced by QFreetypeFace::addGlyphToPath().

+ Here is the caller graph for this function:

◆ subpixelAntialiasingTypeHint()

static QFontEngine::SubpixelAntialiasingType subpixelAntialiasingTypeHint ( )
static

Definition at line 702 of file qfontengine_ft.cpp.

References QScreen::handle(), QGuiApplication::primaryScreen, screen, and QPlatformScreen::subpixelAntialiasingTypeHint().

Referenced by QFontEngineFT::create().

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

◆ transformBoundingBox()

static void transformBoundingBox ( int * left,
int * top,
int * right,
int * bottom,
FT_Matrix * matrix )
inlinestatic

Definition at line 1064 of file qfontengine_ft.cpp.

References vector.

Referenced by QFontEngineFT::loadGlyph().

+ Here is the caller graph for this function:

Variable Documentation

◆ emptyGlyph

◆ ftInitialDefaultHintStyle

const QFontEngine::HintStyle ftInitialDefaultHintStyle
static