Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qfontsubset.cpp File Reference

(61ceff89f79f277ee1050b2633b9e3bfee1a876c)

#include "qfontsubset_p.h"
#include <qdebug.h>
#include <qendian.h>
#include <qpainterpath.h>
#include "private/qpdf_p.h"
#include "qfontsubset_agl.cpp"
#include <algorithm>
+ Include dependency graph for qfontsubset.cpp:

Go to the source code of this file.

Classes

class  QTtfStream
 
struct  QTtfTable
 
struct  qttf_head_table
 
struct  qttf_hhea_table
 
struct  qttf_maxp_table
 
struct  qttf_name_table
 
struct  qttf_font_tables
 
struct  QTtfGlyph
 
struct  QTtfNameRecord
 
struct  TTF_POINT
 

Macros

#define TAG(x)
 
#define TO_TTF(x)
 

Typedefs

typedef qint16 F2DOT14
 
typedef quint32 Tag
 
typedef quint16 GlyphID
 
typedef quint16 Offset
 

Enumerations

enum  Flags {
  OffCurve = 0 , OnCurve = (1 << 0) , XShortVector = (1 << 1) , YShortVector = (1 << 2) ,
  Repeat = (1 << 3) , XSame = (1 << 4) , XShortPositive = (1 << 4) , YSame = (1 << 5) ,
  YShortPositive = (1 << 5) , OffCurve = 0 , OnCurve = (1 << 0) , XShortVector = (1 << 1) ,
  YShortVector = (1 << 2) , Repeat = (1 << 3) , XSame = (1 << 4) , XShortPositive = (1 << 4) ,
  YSame = (1 << 5) , YShortPositive = (1 << 5)
}
 [1] More...
 
enum  Flags {
  OffCurve = 0 , OnCurve = (1 << 0) , XShortVector = (1 << 1) , YShortVector = (1 << 2) ,
  Repeat = (1 << 3) , XSame = (1 << 4) , XShortPositive = (1 << 4) , YSame = (1 << 5) ,
  YShortPositive = (1 << 5) , OffCurve = 0 , OnCurve = (1 << 0) , XShortVector = (1 << 1) ,
  YShortVector = (1 << 2) , Repeat = (1 << 3) , XSame = (1 << 4) , XShortPositive = (1 << 4) ,
  YSame = (1 << 5) , YShortPositive = (1 << 5)
}
 

Functions

static void checkRanges (QPdf::ByteStream &ts, QByteArray &ranges, int &nranges)
 
 Q_DECLARE_TYPEINFO (QTtfTable, Q_RELOCATABLE_TYPE)
 
 Q_DECLARE_TYPEINFO (qttf_head_table, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (qttf_hhea_table, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (qttf_maxp_table, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (qttf_name_table, Q_RELOCATABLE_TYPE)
 
static QTtfTable generateHead (const qttf_head_table &head)
 
static QTtfTable generateHhea (const qttf_hhea_table &hhea)
 
static QTtfTable generateMaxp (const qttf_maxp_table &maxp)
 
static QTtfTable generateName (const qttf_name_table &name)
 
 Q_DECLARE_TYPEINFO (QTtfGlyph, Q_RELOCATABLE_TYPE)
 
static QTtfGlyph generateGlyph (int index, const QPainterPath &path, qreal advance, qreal lsb, qreal ppem)
 
static QList< QTtfTablegenerateGlyphTables (qttf_font_tables &tables, const QList< QTtfGlyph > &_glyphs)
 
static QByteArray bindFont (const QList< QTtfTable > &_tables)
 
static quint32 checksum (const QByteArray &table)
 
 Q_DECLARE_TYPEINFO (QTtfNameRecord, Q_RELOCATABLE_TYPE)
 
static QTtfTable generateName (const QList< QTtfNameRecord > &name)
 
 Q_DECLARE_TYPEINFO (TTF_POINT, Q_PRIMITIVE_TYPE)
 
static void convertPath (const QPainterPath &path, QList< TTF_POINT > *points, QList< int > *endPoints, qreal ppem)
 
static void getBounds (const QList< TTF_POINT > &points, qint16 *xmin, qint16 *xmax, qint16 *ymin, qint16 *ymax)
 
static int convertToRelative (QList< TTF_POINT > *points)
 
static void getGlyphData (QTtfGlyph *glyph, const QList< TTF_POINT > &points, const QList< int > &endPoints, int point_array_size)
 
static bool operator< (const QTtfGlyph &g1, const QTtfGlyph &g2)
 
static bool operator< (const QTtfTable &t1, const QTtfTable &t2)
 

Variables

static const unsigned short symbol_map [0x100]
 

Macro Definition Documentation

◆ TAG

#define TAG ( x)
Value:
char(t.tag >> 24) << char((t.tag >> 16) & 0xff) << char((t.tag >> 8) & 0xff) << char(t.tag & 0xff)
GLdouble GLdouble t
Definition qopenglext.h:243

Referenced by org.qtproject.qt.android.QtQuickViewContent::disconnectSignalListener(), and org.qtproject.qt.android.QtQuickViewContent::setProperty().

◆ TO_TTF

#define TO_TTF ( x)
Value:
qRound(x * 2048. / ppem)
int qRound(qfloat16 d) noexcept
Definition qfloat16.h:318
GLint GLint GLint GLint GLint x
[0]

Typedef Documentation

◆ F2DOT14

typedef qint16 F2DOT14

Definition at line 265 of file qfontsubset.cpp.

◆ GlyphID

typedef quint16 GlyphID

Definition at line 267 of file qfontsubset.cpp.

◆ Offset

typedef quint16 Offset

Definition at line 268 of file qfontsubset.cpp.

◆ Tag

typedef quint32 Tag

Definition at line 266 of file qfontsubset.cpp.

Enumeration Type Documentation

◆ Flags [1/2]

enum typedef QFlags< Enum > Flags

[1]

[meta-object flags] [meta-object flags] [2]

Enumerator
OffCurve 
OnCurve 
XShortVector 
YShortVector 
Repeat 
XSame 
XShortPositive 
YSame 
YShortPositive 
OffCurve 
OnCurve 
XShortVector 
YShortVector 
Repeat 
XSame 
XShortPositive 
YSame 
YShortPositive 

Definition at line 650 of file qfontsubset.cpp.

◆ Flags [2/2]

enum Flags
Enumerator
OffCurve 
OnCurve 
XShortVector 
YShortVector 
Repeat 
XSame 
XShortPositive 
YSame 
YShortPositive 
OffCurve 
OnCurve 
XShortVector 
YShortVector 
Repeat 
XSame 
XShortPositive 
YSame 
YShortPositive 

Definition at line 650 of file qfontsubset.cpp.

Function Documentation

◆ bindFont()

static QByteArray bindFont ( const QList< QTtfTable > & _tables)
static

Definition at line 1023 of file qfontsubset.cpp.

◆ checkRanges()

static void checkRanges ( QPdf::ByteStream & ts,
QByteArray & ranges,
int & nranges )
static

Definition at line 138 of file qfontsubset.cpp.

◆ checksum()

static quint32 checksum ( const QByteArray & table)
static

Definition at line 379 of file qfontsubset.cpp.

◆ convertPath()

static void convertPath ( const QPainterPath & path,
QList< TTF_POINT > * points,
QList< int > * endPoints,
qreal ppem )
static

Definition at line 668 of file qfontsubset.cpp.

References OffCurve, and OnCurve.

◆ convertToRelative()

static int convertToRelative ( QList< TTF_POINT > * points)
static

Definition at line 805 of file qfontsubset.cpp.

References XSame, XShortPositive, XShortVector, YSame, YShortPositive, and YShortVector.

◆ generateGlyph()

static QTtfGlyph generateGlyph ( int index,
const QPainterPath & path,
qreal advance,
qreal lsb,
qreal ppem )
static

Definition at line 906 of file qfontsubset.cpp.

◆ generateGlyphTables()

static QList< QTtfTable > generateGlyphTables ( qttf_font_tables & tables,
const QList< QTtfGlyph > & _glyphs )
static

Definition at line 944 of file qfontsubset.cpp.

References QTtfStream::offset().

+ Here is the call graph for this function:

◆ generateHead()

static QTtfTable generateHead ( const qttf_head_table & head)
static

Definition at line 400 of file qfontsubset.cpp.

References QTtfStream::offset().

+ Here is the call graph for this function:

◆ generateHhea()

static QTtfTable generateHhea ( const qttf_hhea_table & hhea)
static

Definition at line 471 of file qfontsubset.cpp.

References QTtfStream::offset().

+ Here is the call graph for this function:

◆ generateMaxp()

static QTtfTable generateMaxp ( const qttf_maxp_table & maxp)
static

Definition at line 522 of file qfontsubset.cpp.

References QTtfStream::offset().

+ Here is the call graph for this function:

◆ generateName() [1/2]

static QTtfTable generateName ( const QList< QTtfNameRecord > & name)
static

Definition at line 601 of file qfontsubset.cpp.

◆ generateName() [2/2]

static QTtfTable generateName ( const qttf_name_table & name)
static

Definition at line 574 of file qfontsubset.cpp.

Referenced by QFontSubset::toTruetype().

+ Here is the caller graph for this function:

◆ getBounds()

static void getBounds ( const QList< TTF_POINT > & points,
qint16 * xmin,
qint16 * xmax,
qint16 * ymin,
qint16 * ymax )
static

Definition at line 790 of file qfontsubset.cpp.

◆ getGlyphData()

static void getGlyphData ( QTtfGlyph * glyph,
const QList< TTF_POINT > & points,
const QList< int > & endPoints,
int point_array_size )
static

Definition at line 858 of file qfontsubset.cpp.

References QTtfStream::offset(), XSame, XShortVector, YSame, and YShortVector.

+ Here is the call graph for this function:

◆ operator<() [1/2]

static bool operator< ( const QTtfGlyph & g1,
const QTtfGlyph & g2 )
static

Definition at line 939 of file qfontsubset.cpp.

◆ operator<() [2/2]

static bool operator< ( const QTtfTable & t1,
const QTtfTable & t2 )
static

Definition at line 1018 of file qfontsubset.cpp.

References QTtfTable::tag.

◆ Q_DECLARE_TYPEINFO() [1/8]

Q_DECLARE_TYPEINFO ( qttf_head_table ,
Q_PRIMITIVE_TYPE  )

◆ Q_DECLARE_TYPEINFO() [2/8]

Q_DECLARE_TYPEINFO ( qttf_hhea_table ,
Q_PRIMITIVE_TYPE  )

◆ Q_DECLARE_TYPEINFO() [3/8]

Q_DECLARE_TYPEINFO ( qttf_maxp_table ,
Q_PRIMITIVE_TYPE  )

◆ Q_DECLARE_TYPEINFO() [4/8]

Q_DECLARE_TYPEINFO ( qttf_name_table ,
Q_RELOCATABLE_TYPE  )

◆ Q_DECLARE_TYPEINFO() [5/8]

Q_DECLARE_TYPEINFO ( QTtfGlyph ,
Q_RELOCATABLE_TYPE  )

◆ Q_DECLARE_TYPEINFO() [6/8]

Q_DECLARE_TYPEINFO ( QTtfNameRecord ,
Q_RELOCATABLE_TYPE  )

◆ Q_DECLARE_TYPEINFO() [7/8]

Q_DECLARE_TYPEINFO ( QTtfTable ,
Q_RELOCATABLE_TYPE  )

◆ Q_DECLARE_TYPEINFO() [8/8]

Q_DECLARE_TYPEINFO ( TTF_POINT ,
Q_PRIMITIVE_TYPE  )

Variable Documentation

◆ symbol_map

static const unsigned short symbol_map
static

Definition at line 21 of file qfontsubset.cpp.

Referenced by QFontSubset::glyphName().