Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qfontengine_ft.cpp File Reference
#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 <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 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)

Definition at line 59 of file qfontengine_ft.cpp.

◆ FLOOR

#define FLOOR (   x)    ((x) & -64)

Definition at line 58 of file qfontengine_ft.cpp.

◆ GLYPH2PATH_DEBUG

#define GLYPH2PATH_DEBUG   QT_NO_QDEBUG_MACRO

Definition at line 484 of file qfontengine_ft.cpp.

◆ QT_MAX_CACHED_GLYPH_SIZE

#define QT_MAX_CACHED_GLYPH_SIZE   64

Definition at line 51 of file qfontengine_ft.cpp.

◆ ROUND

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

Definition at line 61 of file qfontengine_ft.cpp.

◆ TRUNC

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

Definition at line 60 of file qfontengine_ft.cpp.

Function Documentation

◆ alphaMapFromGlyphData()

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

Definition at line 1866 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::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 941 of file qfontengine_ft.cpp.

References info.

Referenced by QFontEngineFT::loadGlyph().

+ Here is the caller graph for this function:

◆ computeFaceIndex()

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

Definition at line 326 of file qfontengine_ft.cpp.

References QByteArray::constData(), error, QString::fromLatin1(), 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 590 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 607 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 748 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 63 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 1917 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

◆ qHash()

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

Definition at line 126 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 
)

Definition at line 677 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)

Definition at line 2152 of file qfontdatabase.cpp.

References QFontDatabasePrivate::applicationFonts, and 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 149 of file qfontengine_ft.cpp.

References QtFreetypeData::library, Q_ASSERT, and qt_getFreetypeData().

Referenced by QFreeTypeFontDatabase::addTTFile(), computeFaceIndex(), 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 133 of file qfontengine_ft.cpp.

References QtFreetypeData::library.

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 1380 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 471 of file qfontengine_ft.cpp.

References e.

Referenced by QFreetypeFace::addGlyphToPath().

+ Here is the caller graph for this function:

◆ subpixelAntialiasingTypeHint()

static QFontEngine::SubpixelAntialiasingType subpixelAntialiasingTypeHint ( )
static

Definition at line 621 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 947 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