Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qfontengine.cpp File Reference
#include <qdebug.h>
#include <private/qfontengine_p.h>
#include <private/qfontengineglyphcache_p.h>
#include <private/qguiapplication_p.h>
#include <qpa/qplatformfontdatabase.h>
#include <qpa/qplatformintegration.h>
#include "qbitmap.h"
#include "qpainter.h"
#include "qpainterpath.h"
#include "qvarlengtharray.h"
#include <qmath.h>
#include <qendian.h>
#include <private/qstringiterator_p.h>
#include <algorithm>
#include <limits.h>
+ Include dependency graph for qfontengine.cpp:

Go to the source code of this file.

Macros

#define kBearingNotInitialized   std::numeric_limits<qreal>::max()
 
#define q16Dot16ToFloat(i)   ((i) / 65536.0)
 
#define kMinLeftSideBearingOffset   12
 
#define kMinRightSideBearingOffset   14
 
#define GRID(x, y)   grid[(y)*(w+1) + (x)]
 
#define SET(x, y)   (*(image_data + (y)*bpl + ((x) >> 3)) & (0x80 >> ((x) & 7)))
 

Enumerations

enum  { EdgeRight = 0x1 , EdgeDown = 0x2 , EdgeLeft = 0x4 , EdgeUp = 0x8 }
 

Functions

static QT_BEGIN_NAMESPACE bool qtransform_equals_no_translate (const QTransform &a, const QTransform &b)
 
template<typename T >
static bool qSafeFromBigEndian (const uchar *source, const uchar *end, T *output)
 
static bool qt_get_font_table_default (void *user_data, uint tag, uchar *buffer, uint *length)
 
static void collectSingleContour (qreal x0, qreal y0, uint *grid, int x, int y, int w, int h, QPainterPath *path)
 
Q_GUI_EXPORT void qt_addBitmapToPath (qreal x0, qreal y0, const uchar *image_data, int bpl, int w, int h, QPainterPath *path)
 
static QFixed kerning (int left, int right, const QFontEngine::KernPair *pairs, int numPairs)
 
static glyph_t stripped (glyph_t glyph)
 
QStringList qt_fallbacksForFamily (const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script)
 

Macro Definition Documentation

◆ GRID

#define GRID (   x,
  y 
)    grid[(y)*(w+1) + (x)]

Definition at line 622 of file qfontengine.cpp.

◆ kBearingNotInitialized

#define kBearingNotInitialized   std::numeric_limits<qreal>::max()

Definition at line 98 of file qfontengine.cpp.

◆ kMinLeftSideBearingOffset

#define kMinLeftSideBearingOffset   12

Definition at line 500 of file qfontengine.cpp.

◆ kMinRightSideBearingOffset

#define kMinRightSideBearingOffset   14

Definition at line 501 of file qfontengine.cpp.

◆ q16Dot16ToFloat

#define q16Dot16ToFloat (   i)    ((i) / 65536.0)

Definition at line 498 of file qfontengine.cpp.

◆ SET

#define SET (   x,
  y 
)    (*(image_data + (y)*bpl + ((x) >> 3)) & (0x80 >> ((x) & 7)))

Definition at line 623 of file qfontengine.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EdgeRight 
EdgeDown 
EdgeLeft 
EdgeUp 

Definition at line 625 of file qfontengine.cpp.

Function Documentation

◆ collectSingleContour()

static void collectSingleContour ( qreal  x0,
qreal  y0,
uint grid,
int  x,
int  y,
int  w,
int  h,
QPainterPath path 
)
static

Definition at line 631 of file qfontengine.cpp.

References EdgeDown, EdgeLeft, EdgeRight, EdgeUp, GRID, Q_ASSERT, and Q_UNUSED.

Referenced by qt_addBitmapToPath().

+ Here is the caller graph for this function:

◆ kerning()

static QFixed kerning ( int  left,
int  right,
const QFontEngine::KernPair pairs,
int  numPairs 
)
inlinestatic

Definition at line 1008 of file qfontengine.cpp.

References QFontEngine::KernPair::adjust.

Referenced by CPP::FontHandle::compare(), and QFontEngine::doKerning().

+ Here is the caller graph for this function:

◆ qSafeFromBigEndian()

template<typename T >
static bool qSafeFromBigEndian ( const uchar source,
const uchar end,
T *  output 
)
inlinestatic

Definition at line 48 of file qfontengine.cpp.

References output.

Referenced by QFontEngine::getCMap(), QFontEngine::getTrueTypeGlyphIndex(), QFontEngine::glyphCount(), and QFontEngine::loadKerningPairs().

+ Here is the caller graph for this function:

◆ qt_addBitmapToPath()

Q_GUI_EXPORT 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_fallbacksForFamily()

QStringList qt_fallbacksForFamily ( const QString family,
QFont::Style  style,
QFont::StyleHint  styleHint,
QChar::Script  script 
)

Definition at line 695 of file qfontdatabase.cpp.

◆ qt_get_font_table_default()

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

Definition at line 68 of file qfontengine.cpp.

References QFontEngine::getSfntTableData(), tag, and user_data.

Referenced by QFontEngine::QFontEngine().

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

◆ qtransform_equals_no_translate()

static QT_BEGIN_NAMESPACE bool qtransform_equals_no_translate ( const QTransform a,
const QTransform b 
)
inlinestatic

Definition at line 30 of file qfontengine.cpp.

References Q_ASSERT, QTransform::TxProject, and QTransform::TxTranslate.

Referenced by QFontEngine::glyphCache().

+ Here is the caller graph for this function:

◆ stripped()