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

(1593b1f6d610ce9bdb9dff4104f7f447e03a9585)

#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 "qtextengine_p.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 625 of file qfontengine.cpp.

Referenced by collectSingleContour(), and qt_addBitmapToPath().

◆ kBearingNotInitialized

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

Definition at line 99 of file qfontengine.cpp.

Referenced by QFontEngine::minLeftBearing(), and QFontEngine::minRightBearing().

◆ kMinLeftSideBearingOffset

#define kMinLeftSideBearingOffset   12

Definition at line 503 of file qfontengine.cpp.

Referenced by QFontEngine::minRightBearing().

◆ kMinRightSideBearingOffset

#define kMinRightSideBearingOffset   14

Definition at line 504 of file qfontengine.cpp.

Referenced by QFontEngine::minRightBearing().

◆ q16Dot16ToFloat

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

Definition at line 501 of file qfontengine.cpp.

Referenced by QFontEngine::minRightBearing().

◆ SET

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

Definition at line 626 of file qfontengine.cpp.

Referenced by qt_addBitmapToPath().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
EdgeRight 
EdgeDown 
EdgeLeft 
EdgeUp 

Definition at line 628 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 634 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 1011 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 49 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 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_fallbacksForFamily()

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

Definition at line 696 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 69 of file qfontengine.cpp.

References tag, and user_data.

Referenced by QFontEngine::QFontEngine().

+ 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 31 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()