Qt 4.8
Classes | Macros | Typedefs | Enumerations | Functions | Variables
qfontsubset.cpp File Reference
#include <qdebug.h>
#include "qfontsubset_p.h"
#include <qendian.h>
#include <qpainterpath.h>
#include "private/qpdf_p.h"
#include "private/qfunctions_p.h"
#include "private/qfontengine_x11_p.h"
#include "private/qfontengine_ft_p.h"
#include <ft2build.h>
#include <FT_FREETYPE_H>

Go to the source code of this file.

Classes

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

Macros

#define TAG(x)   char(t.tag >> 24) << char((t.tag >> 16) & 0xff) << char((t.tag >> 8) & 0xff) << char(t.tag & 0xff)
 
#define TO_TTF(x)   qRound(x * 2048. / ppem)
 

Typedefs

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

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)
}
 

Functions

static QByteArray bindFont (const QList< QTtfTable > &_tables)
 
static QByteArray charString (const QPainterPath &path, qreal advance, qreal lsb, qreal ppem)
 
static void checkRanges (QPdf::ByteStream &ts, QByteArray &ranges, int &nranges)
 
static quint32 checksum (const QByteArray &table)
 
static void convertPath (const QPainterPath &path, QList< TTF_POINT > *points, QList< int > *endPoints, qreal ppem)
 
static int convertToRelative (QList< TTF_POINT > *points)
 
static const char * encodeNumber (int num, char *tmp)
 
static FT_Face ft_face (const QFontEngine *engine)
 
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 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)
 
static QTtfTable generateName (const QList< QTtfNameRecord > &name)
 
static void getBounds (const QList< TTF_POINT > &points, qint16 *xmin, qint16 *xmax, qint16 *ymin, qint16 *ymax)
 
static void getGlyphData (QTtfGlyph *glyph, const QList< TTF_POINT > &points, const QList< int > &endPoints, int point_array_size)
 
Q_STATIC_GLOBAL_OPERATOR bool operator< (const QTtfGlyph &g1, const QTtfGlyph &g2)
 
Q_STATIC_GLOBAL_OPERATOR bool operator< (const QTtfTable &t1, const QTtfTable &t2)
 
 Q_DECLARE_TYPEINFO (QTtfTable, Q_MOVABLE_TYPE)
 
 Q_DECLARE_TYPEINFO (QTtfGlyph, Q_MOVABLE_TYPE)
 
 Q_DECLARE_TYPEINFO (TTF_POINT, Q_PRIMITIVE_TYPE)
 

Variables

static const char *const agl
 
static const char * courier_styles [4]
 
static const char * helvetica_styles [4]
 
static const unsigned short symbol_map [0x100]
 
static const char * times_styles [4]
 
struct {
   quint16   index
 
   quint16   u
 
unicode_to_aglindex []
 

Macro Definition Documentation

◆ TAG

#define TAG (   x)    char(t.tag >> 24) << char((t.tag >> 16) & 0xff) << char((t.tag >> 8) & 0xff) << char(t.tag & 0xff)

◆ TO_TTF

#define TO_TTF (   x)    qRound(x * 2048. / ppem)

Referenced by QFontSubset::toTruetype().

Typedef Documentation

◆ F2DOT14

typedef qint16 F2DOT14

Definition at line 544 of file qfontsubset.cpp.

◆ GlyphID

typedef quint16 GlyphID

Definition at line 546 of file qfontsubset.cpp.

◆ Offset

typedef quint16 Offset

Definition at line 547 of file qfontsubset.cpp.

◆ Tag

typedef quint32 Tag

Definition at line 545 of file qfontsubset.cpp.

Enumeration Type Documentation

◆ Flags

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

Definition at line 927 of file qfontsubset.cpp.

927  {
928  OffCurve = 0,
929  OnCurve = (1 << 0),
930  XShortVector = (1 << 1),
931  YShortVector = (1 << 2),
932  Repeat = (1 << 3),
933  XSame = (1 << 4),
934  XShortPositive = (1 << 4),
935  YSame = (1 << 5),
936  YShortPositive = (1 << 5)
937 };

Function Documentation

◆ bindFont()

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

Definition at line 1299 of file qfontsubset.cpp.

Referenced by QFontSubset::toTruetype().

1300 {
1301  QList<QTtfTable> tables = _tables;
1302 
1303  qSort(tables);
1304 
1305  QByteArray font;
1306  const int header_size = sizeof(qint32) + 4*sizeof(quint16);
1307  const int directory_size = 4*sizeof(quint32)*tables.size();
1308  font.resize(header_size + directory_size);
1309 
1310  int log2 = 0;
1311  int pow = 1;
1312  int n = tables.size() >> 1;
1313  while (n) {
1314  ++log2;
1315  pow <<= 1;
1316  n >>= 1;
1317  }
1318 
1319  quint32 head_offset = 0;
1320  {
1321  QTtfStream f(font);
1322 // Offset Table
1323 // Type Name Description
1324 // qint32 sfnt version 0x00010000 for version 1.0.
1325 // quint16 numTables Number of tables.
1326 // quint16 searchRange (Maximum power of 2 <= numTables) x 16.
1327 // quint16 entrySelector Log2(maximum power of 2 <= numTables).
1328 // quint16 rangeShift NumTables x 16-searchRange.
1329  f << qint32(0x00010000)
1330  << quint16(tables.size())
1331  << quint16(16*pow)
1332  << quint16(log2)
1333  << quint16(16*(tables.size() - pow));
1334 
1335 // Table Directory
1336 // Type Name Description
1337 // quint32 tag 4 -byte identifier.
1338 // quint32 checkSum CheckSum for this table.
1339 // quint32 offset Offset from beginning of TrueType font file.
1340 // quint32 length Length of this table.
1341  quint32 table_offset = header_size + directory_size;
1342  for (int i = 0; i < tables.size(); ++i) {
1343  const QTtfTable &t = tables.at(i);
1344  const quint32 size = (t.data.size() + 3) & ~3;
1345  if (t.tag == MAKE_TAG('h', 'e', 'a', 'd'))
1346  head_offset = table_offset;
1347  f << t.tag
1348  << checksum(t.data)
1349  << table_offset
1350  << t.data.size();
1351  table_offset += size;
1352 #define TAG(x) char(t.tag >> 24) << char((t.tag >> 16) & 0xff) << char((t.tag >> 8) & 0xff) << char(t.tag & 0xff)
1353  //qDebug() << "table " << TAG(t.tag) << "has size " << t.data.size() << "stream at " << f.offset();
1354  }
1355  }
1356  for (int i = 0; i < tables.size(); ++i) {
1357  const QByteArray &t = tables.at(i).data;
1358  font += t;
1359  int s = t.size();
1360  while (s & 3) { font += '\0'; ++s; }
1361  }
1362 
1363  if (!head_offset) {
1364  qWarning("QFontSubset: Font misses 'head' table");
1365  return QByteArray();
1366  }
1367 
1368  // calculate the fonts checksum and qToBigEndian into 'head's checksum_adjust
1369  quint32 checksum_adjust = 0xB1B0AFBA - checksum(font);
1370  qToBigEndian(checksum_adjust, (uchar *)font.data() + head_offset + 8);
1371 
1372  return font;
1373 }
int qint32
Definition: qglobal.h:937
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
static quint32 checksum(const QByteArray &table)
#define MAKE_TAG(ch1, ch2, ch3, ch4)
unsigned char uchar
Definition: qglobal.h:994
QByteArray data
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
T qToBigEndian(T source)
Definition: qendian.h:337
unsigned short quint16
Definition: qglobal.h:936
Q_CORE_EXPORT void qWarning(const char *,...)
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
void resize(int size)
Sets the size of the byte array to size bytes.
unsigned int quint32
Definition: qglobal.h:938
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ charString()

static QByteArray charString ( const QPainterPath path,
qreal  advance,
qreal  lsb,
qreal  ppem 
)
static

Definition at line 1535 of file qfontsubset.cpp.

Referenced by QFontSubset::type1AddedGlyphs().

1536 {
1537  // the charstring commands we need
1538  const char *hsbw = "0D";
1539  const char *closepath = "09";
1540  const char *moveto[3] = { "16", "04", "15" };
1541  const char *lineto[3] = { "06", "07", "05" };
1542  const char *rcurveto = "08";
1543  const char *endchar = "0E";
1544 
1545  enum { horizontal = 1, vertical = 2 };
1546 
1547  char tmp[16];
1548 
1549  qreal factor = 1000./ppem;
1550 
1551  int lsb_i = qRound(lsb*factor);
1552  int advance_i = qRound(advance*factor);
1553 // qDebug("--- charstring");
1554 
1555  // first of all add lsb and width to the charstring using the hsbw command
1556  QByteArray charstring;
1557  charstring += encodeNumber(lsb_i, tmp);
1558  charstring += encodeNumber(advance_i, tmp);
1559  charstring += hsbw;
1560 
1561  // add the path
1562  int xl = lsb_i;
1563  int yl = 0;
1564  bool openpath = false;
1565  for (int i = 0; i < path.elementCount(); ++i) {
1566  const QPainterPath::Element &elm = path.elementAt(i);
1567  int x = qRound(elm.x*factor);
1568  int y = -qRound(elm.y*factor);
1569  int dx = x - xl;
1570  int dy = y - yl;
1571  if (elm.type == QPainterPath::MoveToElement && openpath) {
1572 // qDebug("closepath %s", closepath);
1573  charstring += closepath;
1574  }
1575  if (elm.type == QPainterPath::MoveToElement ||
1577  int type = -1;
1578  if (dx || !dy) {
1579  charstring += encodeNumber(dx, tmp);
1580  type += horizontal;
1581 // qDebug("horizontal");
1582  }
1583  if (dy) {
1584  charstring += encodeNumber(dy, tmp);
1585  type += vertical;
1586 // qDebug("vertical");
1587  }
1588 // qDebug("moveto/lineto %s", (elm.type == QPainterPath::MoveToElement ? moveto[type] : lineto[type]));
1589  charstring += (elm.type == QPainterPath::MoveToElement ? moveto[type] : lineto[type]);
1590  openpath = true;
1591  xl = x;
1592  yl = y;
1593  } else {
1595  const QPainterPath::Element &elm2 = path.elementAt(++i);
1596  const QPainterPath::Element &elm3 = path.elementAt(++i);
1597  int x2 = qRound(elm2.x*factor);
1598  int y2 = -qRound(elm2.y*factor);
1599  int x3 = qRound(elm3.x*factor);
1600  int y3 = -qRound(elm3.y*factor);
1601  charstring += encodeNumber(dx, tmp);
1602  charstring += encodeNumber(dy, tmp);
1603  charstring += encodeNumber(x2 - x, tmp);
1604  charstring += encodeNumber(y2 - y, tmp);
1605  charstring += encodeNumber(x3 - x2, tmp);
1606  charstring += encodeNumber(y3 - y2, tmp);
1607  charstring += rcurveto;
1608  openpath = true;
1609  xl = x3;
1610  yl = y3;
1611 // qDebug("rcurveto");
1612  }
1613  }
1614  if (openpath)
1615  charstring += closepath;
1616  charstring += endchar;
1617  if (charstring.length() > 240) {
1618  int pos = 240;
1619  while (pos < charstring.length()) {
1620  charstring.insert(pos, '\n');
1621  pos += 241;
1622  }
1623  }
1624  return charstring;
1625 }
ElementType type
the type of element
Definition: qpainterpath.h:81
The QPainterPath::Element class specifies the position and type of a subpath.
Definition: qpainterpath.h:77
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
static const char * encodeNumber(int num, char *tmp)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
qreal y
the y coordinate of the element&#39;s position.
Definition: qpainterpath.h:80
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
Definition: qpainterpath.h:402
int length() const
Same as size().
Definition: qbytearray.h:356
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79
int elementCount() const
Returns the number of path elements in the painter path.
Definition: qpainterpath.h:397
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
QByteArray & insert(int i, char c)
Inserts character ch at index position i in the byte array.

◆ checkRanges()

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

Definition at line 411 of file qfontsubset.cpp.

Referenced by QFontSubset::createToUnicodeMap().

412 {
413  if (++nranges > 100) {
414  ts << nranges << "beginbfrange\n"
415  << ranges << "endbfrange\n";
416  ranges = QByteArray();
417  nranges = 0;
418  }
419 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135

◆ checksum()

static quint32 checksum ( const QByteArray table)
static

Definition at line 654 of file qfontsubset.cpp.

Referenced by bindFont().

655 {
656  quint32 sum = 0;
657  int offset = 0;
658  const uchar *d = (uchar *)table.constData();
659  while (offset <= table.size()-3) {
660  sum += qFromBigEndian<quint32>(d + offset);
661  offset += 4;
662  }
663  int shift = 24;
664  quint32 x = 0;
665  while (offset < table.size()) {
666  x |= ((quint32)d[offset]) << shift;
667  ++offset;
668  shift -= 8;
669  }
670  sum += x;
671 
672  return sum;
673 }
double d
Definition: qnumeric_p.h:62
static ShiftResult shift(const QBezier *orig, QBezier *shifted, qreal offset, qreal threshold)
Definition: qbezier.cpp:289
quint32 qFromBigEndian< quint32 >(const uchar *src)
Definition: qendian.h:239
unsigned char uchar
Definition: qglobal.h:994
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
unsigned int quint32
Definition: qglobal.h:938
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402

◆ convertPath()

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

Definition at line 945 of file qfontsubset.cpp.

Referenced by generateGlyph().

946 {
947  int numElements = path.elementCount();
948  for (int i = 0; i < numElements - 1; ++i) {
949  const QPainterPath::Element &e = path.elementAt(i);
950  TTF_POINT p;
951  p.x = qRound(e.x * 2048. / ppem);
952  p.y = qRound(-e.y * 2048. / ppem);
953  p.flags = 0;
954 
955  switch(e.type) {
957  if (i != 0) {
958  // see if start and end points of the last contour agree
959  int start = endPoints->size() ? endPoints->at(endPoints->size()-1) - 1 : 0;
960  int end = points->size() - 1;
961  if (points->at(end).x == points->at(start).x
962  && points->at(end).y == points->at(start).y)
963  points->takeLast();
964  endPoints->append(points->size() - 1);
965  }
966  // fall through
968  p.flags = OnCurve;
969  break;
971  // cubic bezier curve, we need to reduce to a list of quadratic curves
972  TTF_POINT list[3*16 + 4]; // we need max 16 subdivisions
973  list[3] = points->at(points->size() - 1);
974  list[2] = p;
975  const QPainterPath::Element &e2 = path.elementAt(++i);
976  list[1].x = qRound(e2.x * 2048. / ppem);
977  list[1].y = qRound(-e2.y * 2048. / ppem);
978  const QPainterPath::Element &e3 = path.elementAt(++i);
979  list[0].x = qRound(e3.x * 2048. / ppem);
980  list[0].y = qRound(-e3.y * 2048. / ppem);
981 
982  TTF_POINT *base = list;
983 
984  bool try_reduce = points->size() > 1
985  && points->at(points->size() - 1).flags == OnCurve
986  && points->at(points->size() - 2).flags == OffCurve;
987 // qDebug("generating beziers:");
988  while (base >= list) {
989  const int split_limit = 3;
990 // {
991 // qDebug("iteration:");
992 // TTF_POINT *x = list;
993 // while (x <= base + 3) {
994 // qDebug() << " " << QPoint(x->x, x->y);
995 // ++x;
996 // }
997 // }
998  Q_ASSERT(base - list < 3*16 + 1);
999  // first see if we can easily reduce the cubic to a quadratic bezier curve
1000  int i1_x = base[1].x + ((base[1].x - base[0].x) >> 1);
1001  int i1_y = base[1].y + ((base[1].y - base[0].y) >> 1);
1002  int i2_x = base[2].x + ((base[2].x - base[3].x) >> 1);
1003  int i2_y = base[2].y + ((base[2].y - base[3].y) >> 1);
1004 // qDebug() << "checking: i1=" << QPoint(i1_x, i1_y) << " i2=" << QPoint(i2_x, i2_y);
1005  if (qAbs(i1_x - i2_x) <= split_limit && qAbs(i1_y - i2_y) <= split_limit) {
1006  // got a quadratic bezier curve
1007  TTF_POINT np;
1008  np.x = (i1_x + i2_x) >> 1;
1009  np.y = (i1_y + i2_y) >> 1;
1010  if (try_reduce) {
1011  // see if we can optimize out the last onCurve point
1012  int mx = (points->at(points->size() - 2).x + base[2].x) >> 1;
1013  int my = (points->at(points->size() - 2).y + base[2].y) >> 1;
1014  if (qAbs(mx - base[3].x) <= split_limit && qAbs(my = base[3].y) <= split_limit)
1015  points->takeLast();
1016  try_reduce = false;
1017  }
1018  np.flags = OffCurve;
1019  points->append(np);
1020 // qDebug() << " appending offcurve point " << QPoint(np.x, np.y);
1021  base -= 3;
1022  } else {
1023  // need to split
1024 // qDebug() << " -> splitting";
1025  qint16 a, b, c, d;
1026  base[6].x = base[3].x;
1027  c = base[1].x;
1028  d = base[2].x;
1029  base[1].x = a = ( base[0].x + c ) >> 1;
1030  base[5].x = b = ( base[3].x + d ) >> 1;
1031  c = ( c + d ) >> 1;
1032  base[2].x = a = ( a + c ) >> 1;
1033  base[4].x = b = ( b + c ) >> 1;
1034  base[3].x = ( a + b ) >> 1;
1035 
1036  base[6].y = base[3].y;
1037  c = base[1].y;
1038  d = base[2].y;
1039  base[1].y = a = ( base[0].y + c ) >> 1;
1040  base[5].y = b = ( base[3].y + d ) >> 1;
1041  c = ( c + d ) >> 1;
1042  base[2].y = a = ( a + c ) >> 1;
1043  base[4].y = b = ( b + c ) >> 1;
1044  base[3].y = ( a + b ) >> 1;
1045  base += 3;
1046  }
1047  }
1048  p = list[0];
1049  p.flags = OnCurve;
1050  break;
1051  }
1053  Q_ASSERT(false);
1054  break;
1055  }
1056 // qDebug() << " appending oncurve point " << QPoint(p.x, p.y);
1057  points->append(p);
1058  }
1059  int start = endPoints->size() ? endPoints->at(endPoints->size()-1) + 1 : 0;
1060  int end = points->size() - 1;
1061  if (points->at(end).x == points->at(start).x
1062  && points->at(end).y == points->at(start).y)
1063  points->takeLast();
1064  endPoints->append(points->size() - 1);
1065 }
ElementType type
the type of element
Definition: qpainterpath.h:81
double d
Definition: qnumeric_p.h:62
The QPainterPath::Element class specifies the position and type of a subpath.
Definition: qpainterpath.h:77
unsigned char c[8]
Definition: qnumeric_p.h:62
long ASN1_INTEGER_get ASN1_INTEGER * a
qreal y
the y coordinate of the element&#39;s position.
Definition: qpainterpath.h:80
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
static const uint base
Definition: qurl.cpp:268
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
Definition: qpainterpath.h:402
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
quint8 flags
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
short qint16
Definition: qglobal.h:935
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
qreal x
the x coordinate of the element&#39;s position.
Definition: qpainterpath.h:79
T takeLast()
Removes the last item in the list and returns it.
Definition: qlist.h:492
int elementCount() const
Returns the number of path elements in the painter path.
Definition: qpainterpath.h:397
static const KeyPair *const end
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ convertToRelative()

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

Definition at line 1082 of file qfontsubset.cpp.

Referenced by generateGlyph().

1083 {
1084  // convert points to relative and setup flags
1085 // qDebug() << "relative points:";
1086  qint16 prev_x = 0;
1087  qint16 prev_y = 0;
1088  int point_array_size = 0;
1089  for (int i = 0; i < points->size(); ++i) {
1090  const int x = points->at(i).x;
1091  const int y = points->at(i).y;
1092  TTF_POINT rel;
1093  rel.x = x - prev_x;
1094  rel.y = y - prev_y;
1095  rel.flags = points->at(i).flags;
1096  Q_ASSERT(rel.flags < 2);
1097  if (!rel.x) {
1098  rel.flags |= XSame;
1099  } else if (rel.x > 0 && rel.x < 256) {
1101  point_array_size++;
1102  } else if (rel.x < 0 && rel.x > -256) {
1103  rel.flags |= XShortVector;
1104  rel.x = -rel.x;
1105  point_array_size++;
1106  } else {
1107  point_array_size += 2;
1108  }
1109  if (!rel.y) {
1110  rel.flags |= YSame;
1111  } else if (rel.y > 0 && rel.y < 256) {
1113  point_array_size++;
1114  } else if (rel.y < 0 && rel.y > -256) {
1115  rel.flags |= YShortVector;
1116  rel.y = -rel.y;
1117  point_array_size++;
1118  } else {
1119  point_array_size += 2;
1120  }
1121  (*points)[i] = rel;
1122 // #define toString(x) ((rel.flags & x) ? #x : "")
1123 // qDebug() << " " << QPoint(rel.x, rel.y) << "flags="
1124 // << toString(OnCurve) << toString(XShortVector)
1125 // << (rel.flags & XShortVector ? toString(XShortPositive) : toString(XSame))
1126 // << toString(YShortVector)
1127 // << (rel.flags & YShortVector ? toString(YShortPositive) : toString(YSame));
1128 
1129  prev_x = x;
1130  prev_y = y;
1131  }
1132  return point_array_size;
1133 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
quint8 flags
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
short qint16
Definition: qglobal.h:935
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ encodeNumber()

static const char* encodeNumber ( int  num,
char *  tmp 
)
static

Definition at line 1499 of file qfontsubset.cpp.

Referenced by charString().

1500 {
1501  const char *ret = tmp;
1502  if(num >= -107 && num <= 107) {
1503  QPdf::toHex((uchar)(num + 139), tmp);
1504  tmp += 2;
1505  } else if (num > 107 && num <= 1131) {
1506  num -= 108;
1507  QPdf::toHex((uchar)((num >> 8) + 247), tmp);
1508  tmp += 2;
1509  QPdf::toHex((uchar)(num & 0xff), tmp);
1510  tmp += 2;
1511  } else if(num < - 107 && num >= -1131) {
1512  num += 108;
1513  num = -num;
1514  QPdf::toHex((uchar)((num >> 8) + 251), tmp);
1515  tmp += 2;
1516  QPdf::toHex((uchar)(num & 0xff), tmp);
1517  tmp += 2;
1518  } else {
1519  *tmp++ = 'f';
1520  *tmp++ = 'f';
1521  QPdf::toHex((uchar)(num >> 24), tmp);
1522  tmp += 2;
1523  QPdf::toHex((uchar)(num >> 16), tmp);
1524  tmp += 2;
1525  QPdf::toHex((uchar)(num >> 8), tmp);
1526  tmp += 2;
1527  QPdf::toHex((uchar)(num >> 0), tmp);
1528  tmp += 2;
1529  }
1530  *tmp = 0;
1531 // qDebug("encodeNumber: %d -> '%s'", num, ret);
1532  return ret;
1533 }
unsigned char uchar
Definition: qglobal.h:994
const char * toHex(ushort u, char *buffer)
Definition: qpdf.cpp:862

◆ ft_face()

static FT_Face ft_face ( const QFontEngine engine)
static

Definition at line 288 of file qfontsubset.cpp.

Referenced by QFontSubset::glyphName(), and QFontSubset::toType1().

289 {
290 #ifdef Q_WS_X11
291 #ifndef QT_NO_FONTCONFIG
292  if (engine->type() == QFontEngine::Freetype) {
293  const QFontEngineFT *ft = static_cast<const QFontEngineFT *>(engine);
294  return ft->non_locked_face();
295  } else
296 #endif
297  if (engine->type() == QFontEngine::XLFD) {
298  const QFontEngineXLFD *xlfd = static_cast<const QFontEngineXLFD *>(engine);
299  return xlfd->non_locked_face();
300  }
301 #endif
302 #ifdef Q_WS_QWS
303  if (engine->type() == QFontEngine::Freetype) {
304  const QFontEngineFT *ft = static_cast<const QFontEngineFT *>(engine);
305  return ft->non_locked_face();
306  }
307 #endif
308  return 0;
309 }
virtual Type type() const =0
FT_Face non_locked_face() const
FT_Face non_locked_face() const

◆ generateGlyph()

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

Definition at line 1183 of file qfontsubset.cpp.

Referenced by QFontSubset::toTruetype().

1184 {
1185  QList<TTF_POINT> points;
1186  QList<int> endPoints;
1187  QTtfGlyph glyph;
1188  glyph.index = index;
1189  glyph.advanceWidth = qRound(advance * 2048. / ppem);
1190  glyph.lsb = qRound(lsb * 2048. / ppem);
1191 
1192  if (!path.elementCount()) {
1193  //qDebug("glyph %d is empty", index);
1194  lsb = 0;
1195  glyph.xMin = glyph.xMax = glyph.yMin = glyph.yMax = 0;
1196  glyph.numContours = 0;
1197  glyph.numPoints = 0;
1198  return glyph;
1199  }
1200 
1201  convertPath(path, &points, &endPoints, ppem);
1202 
1203 // qDebug() << "number of contours=" << endPoints.size();
1204 // for (int i = 0; i < points.size(); ++i)
1205 // qDebug() << " point[" << i << "] = " << QPoint(points.at(i).x, points.at(i).y) << " flags=" << points.at(i).flags;
1206 // qDebug() << "endPoints:";
1207 // for (int i = 0; i < endPoints.size(); ++i)
1208 // qDebug() << endPoints.at(i);
1209 
1210  getBounds(points, &glyph.xMin, &glyph.xMax, &glyph.yMin, &glyph.yMax);
1211  int point_array_size = convertToRelative(&points);
1212  getGlyphData(&glyph, points, endPoints, point_array_size);
1213  return glyph;
1214 }
qint16 xMin
quint16 numPoints
static void convertPath(const QPainterPath &path, QList< TTF_POINT > *points, QList< int > *endPoints, qreal ppem)
quint16 numContours
qint16 yMax
qint16 xMax
static void getBounds(const QList< TTF_POINT > &points, qint16 *xmin, qint16 *xmax, qint16 *ymin, qint16 *ymax)
qint16 yMin
static int convertToRelative(QList< TTF_POINT > *points)
quint16 index
quint16 index
static void getGlyphData(QTtfGlyph *glyph, const QList< TTF_POINT > &points, const QList< int > &endPoints, int point_array_size)
int elementCount() const
Returns the number of path elements in the painter path.
Definition: qpainterpath.h:397
qint16 lsb
quint16 advanceWidth
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ generateGlyphTables()

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

Definition at line 1221 of file qfontsubset.cpp.

Referenced by QFontSubset::toTruetype().

1222 {
1223  const int max_size_small = 65536*2;
1224  QList<QTtfGlyph> glyphs = _glyphs;
1225  qSort(glyphs);
1226 
1227  Q_ASSERT(tables.maxp.numGlyphs == glyphs.at(glyphs.size()-1).index + 1);
1228  int nGlyphs = tables.maxp.numGlyphs;
1229 
1230  int glyf_size = 0;
1231  for (int i = 0; i < glyphs.size(); ++i)
1232  glyf_size += (glyphs.at(i).data.size() + 3) & ~3;
1233 
1234  tables.head.indexToLocFormat = glyf_size < max_size_small ? 0 : 1;
1235  tables.hhea.numberOfHMetrics = nGlyphs;
1236 
1237  QTtfTable glyf;
1238  glyf.tag = MAKE_TAG('g', 'l', 'y', 'f');
1239 
1240  QTtfTable loca;
1241  loca.tag = MAKE_TAG('l', 'o', 'c', 'a');
1242  loca.data.resize(glyf_size < max_size_small ? (nGlyphs+1)*sizeof(quint16) : (nGlyphs+1)*sizeof(quint32));
1243  QTtfStream ls(loca.data);
1244 
1245  QTtfTable hmtx;
1246  hmtx.tag = MAKE_TAG('h', 'm', 't', 'x');
1247  hmtx.data.resize(nGlyphs*4);
1248  QTtfStream hs(hmtx.data);
1249 
1250  int pos = 0;
1251  for (int i = 0; i < nGlyphs; ++i) {
1252  int gpos = glyf.data.size();
1253  quint16 advance = 0;
1254  qint16 lsb = 0;
1255 
1256  if (glyphs[pos].index == i) {
1257  // emit glyph
1258 // qDebug("emitting glyph %d: size=%d", i, glyphs.at(i).data.size());
1259  glyf.data += glyphs.at(pos).data;
1260  while (glyf.data.size() & 1)
1261  glyf.data.append('\0');
1262  advance = glyphs.at(pos).advanceWidth;
1263  lsb = glyphs.at(pos).lsb;
1264  ++pos;
1265  }
1266  if (glyf_size < max_size_small) {
1267  // use short loca format
1268  ls << quint16(gpos>>1);
1269  } else {
1270  // use long loca format
1271  ls << quint32(gpos);
1272  }
1273  hs << advance
1274  << lsb;
1275  }
1276  if (glyf_size < max_size_small) {
1277  // use short loca format
1278  ls << quint16(glyf.data.size()>>1);
1279  } else {
1280  // use long loca format
1281  ls << quint32(glyf.data.size());
1282  }
1283 
1284  Q_ASSERT(loca.data.size() == ls.offset());
1285  Q_ASSERT(hmtx.data.size() == hs.offset());
1286 
1287  QList<QTtfTable> list;
1288  list.append(glyf);
1289  list.append(loca);
1290  list.append(hmtx);
1291  return list;
1292 }
qttf_head_table head
QByteArray & append(char c)
Appends the character ch to this byte array.
qttf_hhea_table hhea
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define MAKE_TAG(ch1, ch2, ch3, ch4)
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
quint16 numberOfHMetrics
QByteArray data
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
short qint16
Definition: qglobal.h:935
unsigned short quint16
Definition: qglobal.h:936
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Definition: qalgorithms.h:177
QByteArray data
void resize(int size)
Sets the size of the byte array to size bytes.
unsigned int quint32
Definition: qglobal.h:938
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
quint16 index
qttf_maxp_table maxp
qint16 lsb
qint16 indexToLocFormat
quint16 advanceWidth
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ generateHead()

static QTtfTable generateHead ( const qttf_head_table head)
static

Definition at line 675 of file qfontsubset.cpp.

Referenced by QFontSubset::toTruetype().

676 {
677  const int head_size = 54;
678  QTtfTable t;
679  t.tag = MAKE_TAG('h', 'e', 'a', 'd');
680  t.data.resize(head_size);
681 
682  QTtfStream s(t.data);
683 
684 // qint32 Table version number 0x00010000 for version 1.0.
685 // qint32 fontRevision Set by font manufacturer.
686  s << qint32(0x00010000)
687  << head.font_revision
688 // quint32 checkSumAdjustment To compute: set it to 0, sum the entire font as quint32, then store 0xB1B0AFBA - sum.
689  << quint32(0)
690 // quint32 magicNumber Set to 0x5F0F3CF5.
691  << quint32(0x5F0F3CF5)
692 // quint16 flags Bit 0: Baseline for font at y=0;
693 // Bit 1: Left sidebearing point at x=0;
694 // Bit 2: Instructions may depend on point size;
695 // Bit 3: Force ppem to integer values for all internal scaler math; may use fractional ppem sizes if this bit is clear;
696 // Bit 4: Instructions may alter advance width (the advance widths might not scale linearly);
697 // Bits 5-10: These should be set according to Apple's specification . However, they are not implemented in OpenType.
698 // Bit 11: Font data is 'lossless,' as a result of having been compressed and decompressed with the Agfa MicroType Express engine.
699 // Bit 12: Font converted (produce compatible metrics)
700 // Bit 13: Font optimized for ClearType
701 // Bit 14: Reserved, set to 0
702 // Bit 15: Reserved, set to 0
703  << quint16(0)
704 
705 // quint16 unitsPerEm Valid range is from 16 to 16384. This value should be a power of 2 for fonts that have TrueType outlines.
706  << quint16(2048)
707 // qint64 created Number of seconds since 12:00 midnight, January 1, 1904. 64-bit integer
708  << head.created
709 // qint64 modified Number of seconds since 12:00 midnight, January 1, 1904. 64-bit integer
710  << head.modified
711 // qint16 xMin For all glyph bounding boxes.
712 // qint16 yMin For all glyph bounding boxes.
713 // qint16 xMax For all glyph bounding boxes.
714 // qint16 yMax For all glyph bounding boxes.
715  << head.xMin
716  << head.yMin
717  << head.xMax
718  << head.yMax
719 // quint16 macStyle Bit 0: Bold (if set to 1);
720 // Bit 1: Italic (if set to 1)
721 // Bit 2: Underline (if set to 1)
722 // Bit 3: Outline (if set to 1)
723 // Bit 4: Shadow (if set to 1)
724 // Bit 5: Condensed (if set to 1)
725 // Bit 6: Extended (if set to 1)
726 // Bits 7-15: Reserved (set to 0).
727  << head.macStyle
728 // quint16 lowestRecPPEM Smallest readable size in pixels.
729  << quint16(6) // just a wild guess
730 // qint16 fontDirectionHint 0: Fully mixed directional glyphs;
731  << qint16(0)
732 // 1: Only strongly left to right;
733 // 2: Like 1 but also contains neutrals;
734 // -1: Only strongly right to left;
735 // -2: Like -1 but also contains neutrals. 1
736 // qint16 indexToLocFormat 0 for short offsets, 1 for long.
737  << head.indexToLocFormat
738 // qint16 glyphDataFormat 0 for current format.
739  << qint16(0);
740 
741  Q_ASSERT(s.offset() == head_size);
742  return t;
743 }
int qint32
Definition: qglobal.h:937
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define MAKE_TAG(ch1, ch2, ch3, ch4)
QByteArray data
short qint16
Definition: qglobal.h:935
unsigned short quint16
Definition: qglobal.h:936
void resize(int size)
Sets the size of the byte array to size bytes.
unsigned int quint32
Definition: qglobal.h:938
qint16 indexToLocFormat

◆ generateHhea()

static QTtfTable generateHhea ( const qttf_hhea_table hhea)
static

Definition at line 746 of file qfontsubset.cpp.

Referenced by QFontSubset::toTruetype().

747 {
748  const int hhea_size = 36;
749  QTtfTable t;
750  t.tag = MAKE_TAG('h', 'h', 'e', 'a');
751  t.data.resize(hhea_size);
752 
753  QTtfStream s(t.data);
754 // qint32 Table version number 0x00010000 for version 1.0.
755  s << qint32(0x00010000)
756 // qint16 Ascender Typographic ascent. (Distance from baseline of highest ascender)
757  << hhea.ascender
758 // qint16 Descender Typographic descent. (Distance from baseline of lowest descender)
759  << hhea.descender
760 // qint16 LineGap Typographic line gap.
761 // Negative LineGap values are treated as zero
762 // in Windows 3.1, System 6, and
763 // System 7.
764  << hhea.lineGap
765 // quint16 advanceWidthMax Maximum advance width value in 'hmtx' table.
766  << hhea.maxAdvanceWidth
767 // qint16 minLeftSideBearing Minimum left sidebearing value in 'hmtx' table.
768  << hhea.minLeftSideBearing
769 // qint16 minRightSideBearing Minimum right sidebearing value; calculated as Min(aw - lsb - (xMax - xMin)).
770  << hhea.minRightSideBearing
771 // qint16 xMaxExtent Max(lsb + (xMax - xMin)).
772  << hhea.xMaxExtent
773 // qint16 caretSlopeRise Used to calculate the slope of the cursor (rise/run); 1 for vertical.
774  << qint16(1)
775 // qint16 caretSlopeRun 0 for vertical.
776  << qint16(0)
777 // qint16 caretOffset The amount by which a slanted highlight on a glyph needs to be shifted to produce the best appearance. Set to 0 for non-slanted fonts
778  << qint16(0)
779 // qint16 (reserved) set to 0
780  << qint16(0)
781 // qint16 (reserved) set to 0
782  << qint16(0)
783 // qint16 (reserved) set to 0
784  << qint16(0)
785 // qint16 (reserved) set to 0
786  << qint16(0)
787 // qint16 metricDataFormat 0 for current format.
788  << qint16(0)
789 // quint16 numberOfHMetrics Number of hMetric entries in 'hmtx' table
790  << hhea.numberOfHMetrics;
791 
792  Q_ASSERT(s.offset() == hhea_size);
793  return t;
794 }
int qint32
Definition: qglobal.h:937
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define MAKE_TAG(ch1, ch2, ch3, ch4)
quint16 numberOfHMetrics
QByteArray data
short qint16
Definition: qglobal.h:935
qint16 minRightSideBearing
quint16 maxAdvanceWidth
qint16 minLeftSideBearing
void resize(int size)
Sets the size of the byte array to size bytes.

◆ generateMaxp()

static QTtfTable generateMaxp ( const qttf_maxp_table maxp)
static

Definition at line 797 of file qfontsubset.cpp.

Referenced by QFontSubset::toTruetype().

798 {
799  const int maxp_size = 32;
800  QTtfTable t;
801  t.tag = MAKE_TAG('m', 'a', 'x', 'p');
802  t.data.resize(maxp_size);
803 
804  QTtfStream s(t.data);
805 
806 // qint32 Table version number 0x00010000 for version 1.0.
807  s << qint32(0x00010000)
808 // quint16 numGlyphs The number of glyphs in the font.
809  << maxp.numGlyphs
810 // quint16 maxPoints Maximum points in a non-composite glyph.
811  << maxp.maxPoints
812 // quint16 maxContours Maximum contours in a non-composite glyph.
813  << maxp.maxContours
814 // quint16 maxCompositePoints Maximum points in a composite glyph.
815  << maxp.maxCompositePoints
816 // quint16 maxCompositeContours Maximum contours in a composite glyph.
817  << maxp.maxCompositeContours
818 // quint16 maxZones 1 if instructions do not use the twilight zone (Z0), or 2 if instructions do use Z0; should be set to 2 in most cases.
819  << quint16(1) // we do not embed instructions
820 // quint16 maxTwilightPoints Maximum points used in Z0.
821  << quint16(0)
822 // quint16 maxStorage Number of Storage Area locations.
823  << quint16(0)
824 // quint16 maxFunctionDefs Number of FDEFs.
825  << quint16(0)
826 // quint16 maxInstructionDefs Number of IDEFs.
827  << quint16(0)
828 // quint16 maxStackElements Maximum stack depth2.
829  << quint16(0)
830 // quint16 maxSizeOfInstructions Maximum byte count for glyph instructions.
831  << quint16(0)
832 // quint16 maxComponentElements Maximum number of components referenced at "top level" for any composite glyph.
833  << maxp.maxComponentElements
834 // quint16 maxComponentDepth Maximum levels of recursion; 1 for simple components.
835  << maxp.maxComponentDepth;
836 
837  Q_ASSERT(s.offset() == maxp_size);
838  return t;
839 }
int qint32
Definition: qglobal.h:937
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
quint16 maxComponentDepth
#define MAKE_TAG(ch1, ch2, ch3, ch4)
QByteArray data
unsigned short quint16
Definition: qglobal.h:936
quint16 maxCompositePoints
void resize(int size)
Sets the size of the byte array to size bytes.
quint16 maxComponentElements
quint16 maxCompositeContours

◆ generateName() [1/2]

static QTtfTable generateName ( const qttf_name_table name)
static

Definition at line 848 of file qfontsubset.cpp.

Referenced by QFontSubset::toTruetype().

849 {
851  QTtfNameRecord rec;
852  rec.nameId = 0;
853  rec.value = name.copyright;
854  list.append(rec);
855  rec.nameId = 1;
856  rec.value = name.family;
857  list.append(rec);
858  rec.nameId = 2;
859  rec.value = name.subfamily;
860  list.append(rec);
861  rec.nameId = 4;
862  rec.value = name.family;
863  if (name.subfamily != QLatin1String("Regular"))
864  rec.value += QLatin1Char(' ') + name.subfamily;
865  list.append(rec);
866  rec.nameId = 6;
867  rec.value = name.postscript_name;
868  list.append(rec);
869 
870  return generateName(list);
871 }
QString postscript_name
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
static QTtfTable generateName(const qttf_name_table &name)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ generateName() [2/2]

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

Definition at line 874 of file qfontsubset.cpp.

875 {
876  const int char_size = 2;
877 
878  QTtfTable t;
879  t.tag = MAKE_TAG('n', 'a', 'm', 'e');
880 
881  const int name_size = 6 + 12*name.size();
882  int string_size = 0;
883  for (int i = 0; i < name.size(); ++i) {
884  string_size += name.at(i).value.length()*char_size;
885  }
886  t.data.resize(name_size + string_size);
887 
888  QTtfStream s(t.data);
889 // quint16 format Format selector (=0).
890  s << quint16(0)
891 // quint16 count Number of name records.
892  << quint16(name.size())
893 // quint16 stringOffset Offset to start of string storage (from start of table).
894  << quint16(name_size);
895 // NameRecord nameRecord[count] The name records where count is the number of records.
896 // (Variable)
897 
898  int off = 0;
899  for (int i = 0; i < name.size(); ++i) {
900  int len = name.at(i).value.length()*char_size;
901 // quint16 platformID Platform ID.
902 // quint16 encodingID Platform-specific encoding ID.
903 // quint16 languageID Language ID.
904  s << quint16(3)
905  << quint16(1)
906  << quint16(0x0409) // en_US
907 // quint16 nameId Name ID.
908  << name.at(i).nameId
909 // quint16 length String length (in bytes).
910  << quint16(len)
911 // quint16 offset String offset from start of storage area (in bytes).
912  << quint16(off);
913  off += len;
914  }
915  for (int i = 0; i < name.size(); ++i) {
916  const QString &n = name.at(i).value;
917  const ushort *uc = n.utf16();
918  for (int i = 0; i < n.length(); ++i) {
919  s << quint16(*uc);
920  ++uc;
921  }
922  }
923  return t;
924 }
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define MAKE_TAG(ch1, ch2, ch3, ch4)
QByteArray data
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
unsigned short quint16
Definition: qglobal.h:936
unsigned short ushort
Definition: qglobal.h:995
void resize(int size)
Sets the size of the byte array to size bytes.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
const ushort * utf16() const
Returns the QString as a &#39;\0\&#39;-terminated array of unsigned shorts.
Definition: qstring.cpp:5290

◆ getBounds()

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

Definition at line 1067 of file qfontsubset.cpp.

Referenced by generateGlyph().

1068 {
1069  *xmin = points.at(0).x;
1070  *xmax = *xmin;
1071  *ymin = points.at(0).y;
1072  *ymax = *ymin;
1073 
1074  for (int i = 1; i < points.size(); ++i) {
1075  *xmin = qMin(*xmin, points.at(i).x);
1076  *xmax = qMax(*xmax, points.at(i).x);
1077  *ymin = qMin(*ymin, points.at(i).y);
1078  *ymax = qMax(*ymax, points.at(i).y);
1079  }
1080 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ getGlyphData()

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

Definition at line 1135 of file qfontsubset.cpp.

Referenced by generateGlyph().

1136 {
1137  const int max_size = 5*sizeof(qint16) // header
1138  + endPoints.size()*sizeof(quint16) // end points of contours
1139  + sizeof(quint16) // instruction length == 0
1140  + points.size()*(1) // flags
1141  + point_array_size; // coordinates
1142 
1143  glyph->data.resize(max_size);
1144 
1145  QTtfStream s(glyph->data);
1146  s << qint16(endPoints.size())
1147  << glyph->xMin << glyph->yMin << glyph->xMax << glyph->yMax;
1148 
1149  for (int i = 0; i < endPoints.size(); ++i)
1150  s << quint16(endPoints.at(i));
1151  s << quint16(0); // instruction length
1152 
1153  // emit flags
1154  for (int i = 0; i < points.size(); ++i)
1155  s << quint8(points.at(i).flags);
1156  // emit points
1157  for (int i = 0; i < points.size(); ++i) {
1158  quint8 flags = points.at(i).flags;
1159  qint16 x = points.at(i).x;
1160 
1161  if (flags & XShortVector)
1162  s << quint8(x);
1163  else if (!(flags & XSame))
1164  s << qint16(x);
1165  }
1166  for (int i = 0; i < points.size(); ++i) {
1167  quint8 flags = points.at(i).flags;
1168  qint16 y = points.at(i).y;
1169 
1170  if (flags & YShortVector)
1171  s << quint8(y);
1172  else if (!(flags & YSame))
1173  s << qint16(y);
1174  }
1175 
1176 // qDebug() << "offset=" << s.offset() << "max_size=" << max_size << "point_array_size=" << point_array_size;
1177  Q_ASSERT(s.offset() == max_size);
1178 
1179  glyph->numContours = endPoints.size();
1180  glyph->numPoints = points.size();
1181 }
qint16 xMin
quint16 numPoints
quint16 numContours
unsigned char quint8
Definition: qglobal.h:934
qint16 yMax
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
qint16 xMax
qint16 yMin
for(int ii=mo->methodOffset();ii< mo->methodCount();++ii)
quint8 flags
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
short qint16
Definition: qglobal.h:935
unsigned short quint16
Definition: qglobal.h:936
QByteArray data
void resize(int size)
Sets the size of the byte array to size bytes.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ operator<() [1/2]

Q_STATIC_GLOBAL_OPERATOR bool operator< ( const QTtfGlyph g1,
const QTtfGlyph g2 
)

Definition at line 1216 of file qfontsubset.cpp.

1217 {
1218  return g1.index < g2.index;
1219 }
quint16 index

◆ operator<() [2/2]

Q_STATIC_GLOBAL_OPERATOR bool operator< ( const QTtfTable t1,
const QTtfTable t2 
)

Definition at line 1294 of file qfontsubset.cpp.

1295 {
1296  return t1.tag < t2.tag;
1297 }

◆ Q_DECLARE_TYPEINFO() [1/3]

Q_DECLARE_TYPEINFO ( QTtfTable  ,
Q_MOVABLE_TYPE   
)

◆ Q_DECLARE_TYPEINFO() [2/3]

Q_DECLARE_TYPEINFO ( QTtfGlyph  ,
Q_MOVABLE_TYPE   
)

◆ Q_DECLARE_TYPEINFO() [3/3]

Q_DECLARE_TYPEINFO ( TTF_POINT  ,
Q_PRIMITIVE_TYPE   
)

Variable Documentation

◆ agl

const char* const agl
static

Definition at line 64 of file qfontsubset.cpp.

Referenced by QFontSubset::glyphName().

◆ courier_styles

const char* courier_styles[4]
static
Initial value:
= {
"Courier",
"Courier-Bold",
"Courier-Oblique",
"Courier-BoldOblique"
}

Definition at line 1640 of file qfontsubset.cpp.

◆ helvetica_styles

const char* helvetica_styles[4]
static
Initial value:
= {
"Helvetica",
"Helvetica-Bold",
"Helvetica-Oblique",
"Helvetica-BoldOblique"
}

Definition at line 1628 of file qfontsubset.cpp.

◆ index

quint16 index

Definition at line 116 of file qfontsubset.cpp.

Referenced by _DndIndexToTargets(), QAbstractItemViewPrivate::_q_columnsAboutToBeRemoved(), QCompleterPrivate::_q_completionSelected(), QFileDialogPrivate::_q_createDirectory(), QMdiAreaPrivate::_q_currentTabChanged(), QScriptBreakpointsWidgetPrivate::_q_deleteBreakpoint(), QFileDialogPrivate::_q_deleteCurrent(), QComboBoxPrivate::_q_editingFinished(), QStandardItemModelPrivate::_q_emitItemChanged(), QFileDialogPrivate::_q_enterDirectory(), QFileDialogPrivate::_q_goToDirectory(), QWizardPrivate::_q_handleFieldObjectDestroyed(), QAbstractItemViewPrivate::_q_headerDataChanged(), QDeclarativeVisualDataModel::_q_itemsInserted(), QHeaderViewPrivate::_q_layoutChanged(), QPageSetupWidget::_q_paperSizeChanged(), QFileDialogPrivate::_q_renameCurrent(), QComboBoxPrivate::_q_returnPressed(), QFileDialogPrivate::_q_showContextMenu(), QTableViewPrivate::accessibleTable2Index(), QWindowsAccessible::accNavigate(), QToolBar::actionAt(), QToolBar::actionEvent(), QToolBar::actionGeometry(), QMenuBarPrivate::actionRect(), QMenuPrivate::actionRect(), QAxServerBase::ActiveXProc(), QMenuBarPrivate::QMacMenuBarPrivate::addAction(), QMenuPrivate::QMacMenuPrivate::addAction(), QMetaObjectBuilder::addClassInfo(), QMetaObjectBuilder::addConstructor(), QDockAreaLayout::addDockWidget(), QMetaObjectBuilder::addEnumerator(), QDeclarativeXmlQueryEngine::addIndexToRangeList(), QComboBox::addItems(), QListWidget::addItems(), QMetaEnumBuilder::addKey(), QIconModeViewBase::addLeaf(), QMetaObjectBuilder::addMetaObject(), QMetaObjectBuilder::addMethod(), QPathSegments::addPath(), QMetaObjectBuilder::addProperty(), QMetaObjectBuilder::addRelatedMetaObject(), QMetaObjectBuilder::addSignal(), QMetaObjectBuilder::addSlot(), QGraphicsLinearLayout::addStretch(), QScriptStaticScopeObject::addSymbolTableProperty(), QDeclarativeAbstractBinding::addToObject(), QBasicUnixFontDatabase::addTTFile(), QFontDatabasePrivate::addTTFile(), QDeclarativeWatcher::addWatch(), QGridLayout::addWidget(), QSequentialAnimationGroupPrivate::animationActualTotalDuration(), QSequentialAnimationGroupPrivate::animationRemoved(), QDeclarativeVMEStack< QObject *>::at(), QTabBarPrivate::at(), QXmlStreamSimpleStack< QXmlStreamReaderPrivate::Entity *>::at(), QTestCoreElement< QTestElement >::attribute(), QSqlResult::bindValue(), bm_find(), buildMetaObject(), buildParameterNames(), QDeclarativeJS::MemoryPool::bytesAllocated(), QTabBarPrivate::calculateNewPosition(), QScript::callQtMethod(), QAccessibleTable2::cell(), QAccessibleTable2::cellAt(), QAccessibleTree::cellAt(), QTableWidget::cellWidget(), QDeclarativeListModelWorkerAgent::Data::changedChange(), QScriptDebuggerConsole::changeHistoryAt(), QAbstractItemViewPrivate::checkMouseMove(), QAbstractItemViewPrivate::checkPersistentEditorFocus(), QUndoStackPrivate::checkUndoLimit(), QDeclarativeListViewPrivate::checkVisible(), QAccessibleTable2::childAt(), QAccessibleTree::childAt(), QStandardItemPrivate::childDeleted(), QAccessibleTable2::childFromLogical(), QGraphicsItemPrivate::children_clear(), children_clear_helper(), QEgl::chooseConfig(), QMetaObject::classInfo(), QSqlResultPrivate::clear(), QAbstractItemViewPrivate::clearOrRemove(), QAbstractItemView::closeEditor(), QListWidget::closePersistentEditor(), QTableWidget::closePersistentEditor(), QAxSelect::clsid(), QTreeViewPrivate::collapse(), QSimplex::collectResults(), QGIFFormat::color(), QTreeWidgetItem::columnCount(), QGridLayoutEngine::columnCount(), QCalendarModel::columnCount(), QAbstractItemModelPrivate::columnsAboutToBeInserted(), QStandardItemModelPrivate::columnsAboutToBeInserted(), QStandardItemModelPrivate::columnsAboutToBeRemoved(), QAbstractItemView::commitData(), QDeclarativeCompiler::compileAlias(), QDeclarativeCompiler::completeComponentBuild(), QDeclarativeCompiledBindings::configBinding(), QVNCScreen::connect(), QAxBase::connectNotify(), QMetaObject::constructor(), QSqlRecordPrivate::contains(), QInt64Set::contains(), containsTLDEntry(), QScriptDebuggerBackend::context(), QOutlineMapper::convertPath(), QVectorPath::convertToPainterPath(), QString::count(), QEglFSScreen::createAndSetPlatformContext(), QGraphicsScene::createItemGroup(), QMutexPool::createMutex(), QShortcutMap::createNewSequences(), QDeclarativeComponentPrivate::createObject(), createReadHandlerHelper(), QMultiScreen::createSurface(), QCUPSSupport::cupsVersion(), QCompletionModel::currentRow(), QMdiArea::currentSubWindow(), QDockAreaLayoutInfo::currentTabId(), QColorDialog::customColor(), QTestData::data(), QScript::QtPropertyFunction::Data::Data(), QTestTablePrivate::dataAt(), dataPointerHelper(), QGIFFormat::decode(), decompositionHelper(), QChar::decompositionTag(), QDeclarativeListView::decrementCurrentIndex(), QMenuBar::defaultAction(), QGLWindowSurface::deleted(), QScript::QObjectDelegate::deleteProperty(), QRingBuffer< T >::dequeue(), QMetaObjectBuilder::deserialize(), determineWritingSystemsFromTrueTypeBits(), QFutureInterfaceBasePrivate::disconnectOutputInterface(), QGraphicsScenePrivate::dispatchHoverEvent(), QTextEngine::docLayout(), QPathClipper::doClip(), QSplitterPrivate::doMove(), QAxObject::doVerb(), QAbstractItemViewPrivate::draggablePaintPairs(), QListViewPrivate::draggablePaintPairs(), QListModeViewBase::dragMoveEvent(), QAbstractItemView::dragMoveEvent(), QPainter::drawChord(), QPicturePaintEngine::drawImage(), QGraphicsScenePrivate::drawItems(), QPicturePaintEngine::drawPixmap(), QPicturePaintEngine::drawTiledPixmap(), QTableWidget::dropEvent(), QAbstractItemView::dropEvent(), QListWidget::dropMimeData(), QAbstractItemViewPrivate::dropOn(), QListModeViewBase::dropOn(), QAbstractItemViewPrivate::droppingOnItself(), QEgl::dumpAllConfigs(), QAxBase::dynamicCallHelper(), QItemViewInterfaceFactory::element(), QTestTablePrivate::elementAt(), QMdiAreaPrivate::emitWindowActivated(), QPatternist::AccelTreeBuilder< true >::endElement(), QRingBuffer< T >::enqueue(), QMetaObject::enumerator(), QAnimationGroup::event(), QPicture::exec(), QTreeViewPrivate::expand(), QGtkStylePrivate::extract_filter(), QFragmentMapData< QTextBlockData >::F(), fastHasBinding(), QAbstractItemViewPrivate::fetchMore(), QWizard::field(), QIconModeViewBase::filterDragMoveEvent(), QIconModeViewBase::filterDropEvent(), QDateTimeParser::findAmPm(), QListWidget::findItems(), QTableWidget::findItems(), QTreeWidget::findItems(), QAxEventSink::findProperty(), QSplitterPrivate::findWidgetJustBeforeOrJustAfter(), QMacMime::flavorToMime(), QMenuBarPrivate::focusFirstAction(), QAbstractItemView::focusInEvent(), fontFile(), QMacPasteboard::formats(), QMacPixmapData::fromImage(), QX11PixmapData::fromImage(), QDockAreaLayout::gapRect(), generateGlyph(), generateGlyphTables(), QDeclarativeCompiler::genLiteralAssignment(), QDeclarativeCompiler::genObject(), QMutexPool::get(), QScriptDebuggerLocalsModelPrivate::get(), QScriptEnginePrivate::get(), QWindowsAccessible::get_accChild(), QScriptValuePrivate::getEngine(), QFontEngineFT::QGlyphSet::getGlyph(), QGtkPainter::getIcon(), QFormLayout::getLayoutPosition(), getLocaleListData(), QBenchmarkValgrindUtils::getNewestFileName(), QScript::QObjectDelegate::getOwnPropertyDescriptor(), QScript::QObjectDelegate::getOwnPropertySlot(), QSplitterPrivate::getRange(), QImageReaderPrivate::getText(), MetaObjectGenerator::guessTypes(), QPatternist::XsdInstanceReader::hasChildElement(), QPatternist::XsdInstanceReader::hasChildText(), QMacPasteboard::hasFlavor(), QMacPasteboard::hasFormat(), QIntersectionFinder::hasIntersections(), QCss::Parser::hasNext(), QMacPasteboard::hasOSType(), if(), QDeclarativeListView::incrementCurrentIndex(), QTableModel::index(), QFileSystemModelPrivate::index(), QMetaEnumBuilder::index(), QColumnView::indexAt(), QListView::indexAt(), indexesFromRange(), QSqlRecord::indexOf(), QRingBuffer< T >::indexOf(), QAccessibleWidget::indexOfChild(), QAccessibleMenu::indexOfChild(), QAccessibleAbstractScrollArea::indexOfChild(), QAccessibleMenuBar::indexOfChild(), QAccessibleApplication::indexOfChild(), QAccessibleTree::indexOfChild(), QAccessibleStackedWidget::indexOfChild(), QAccessibleToolBox::indexOfChild(), QAccessibleMdiArea::indexOfChild(), QAccessibleWorkspace::indexOfChild(), QMetaObjectBuilder::indexOfClassInfo(), QMetaObjectBuilder::indexOfConstructor(), QMetaObjectBuilder::indexOfEnumerator(), QMetaObjectBuilder::indexOfMethod(), QMetaObjectBuilder::indexOfProperty(), QMetaObjectBuilder::indexOfSignal(), QMetaObjectBuilder::indexOfSlot(), QDockAreaLayoutInfo::info(), QDockAreaLayout::info(), QTestFileLogger::init(), QBspTree::init(), QSidebar::init(), QCss::Parser::init(), initFontInfo(), QGraphicsSceneBspTree::initialize(), QDeclarativeVisualDataModelDataMetaObject::initialValue(), QStyledItemDelegate::initStyleOption(), NestedListModel::insert(), QInt64Set::insert(), QToolBarLayout::insertAction(), QGraphicsWidget::insertAction(), QDeclarativeListModelWorkerAgent::Data::insertChange(), QStandardItemPrivate::insertColumns(), QDockAreaLayoutInfo::insertGap(), QDockAreaLayout::insertGap(), QToolBox::insertItem(), QGraphicsLinearLayout::insertItem(), QStatusBar::insertPermanentWidget(), QStandardItemPrivate::insertRows(), QTabWidget::insertTab(), QTabBar::insertTab(), QStatusBar::insertWidget(), QStackedLayout::insertWidget(), QWSDisplay::instance(), QItemViewInterfaceFactory::interface(), QAxServerBase::internalActivate(), QAxBase::internalInvoke(), QAxBase::internalProperty(), QLCDNumberPrivate::internalSetString(), QListModeViewBase::intersectingSet(), QAxServerBase::Invoke(), QAxEventSink::Invoke(), isc(), QStandardItem::isDropEnabled(), QItemSelectionRange::isEmpty(), QXmlSimpleReaderPrivate::XmlRef::isEmpty(), QTreeView::isFirstColumnSpanned(), QTreeWidget::isFirstItemColumnSpanned(), QFileSystemModelPrivate::isHiddenByFilter(), QListWidget::isItemSelected(), QTableWidget::isItemSelected(), QAccessibleTree::isRowSelected(), QByteArray::isSharedWith(), QScriptDebuggerLocalsModelPrivate::isTopLevelNode(), QDeclarativeVisualDataModel::isValid(), QDeclarativeVisualItemModel::item(), QDockAreaLayoutInfo::item(), QDomNamedNodeMapPrivate::item(), QDockAreaLayout::item(), QTreeWidget::itemAbove(), QMainWindowLayoutState::itemAt(), QDockAreaLayoutInfo::itemAt(), QToolBarAreaLayout::itemAt(), QDockAreaLayout::itemAt(), QTreeWidget::itemBelow(), QStandardItemModelPrivate::itemChanged(), QTreeViewPrivate::itemHeight(), QListModeViewBase::itemIndex(), QDockAreaLayoutInfo::itemRect(), QDockAreaLayout::itemRect(), QAbstractItemModelPrivate::itemsAboutToBeMoved(), QDeclarativeGridView::itemsInserted(), QDeclarativeListView::itemsInserted(), QListWidget::itemWidget(), QMetaEnum::key(), QTreeView::keyboardSearch(), QScriptBreakpointsWidget::keyPressEvent(), QMenuBar::keyPressEvent(), QTextTableCell::lastPosition(), launchWebBrowser(), QTreeViewPrivate::layout(), QTabBarPrivate::layoutTab(), QTextDocumentLayoutPrivate::layoutTable(), ligatureHelper(), QListWidgetPrivate::listModel(), localePrivateIndex(), QCss::Parser::lookup(), QFbScreen::lower(), QMenuBarPrivate::macMenu(), QFileDialogPrivate::mapFromSource(), QFileDialogPrivate::mapToSource(), menuItemEntry(), ShaderEffectItem::meshResolution(), QDeclarativeVMEMetaObject::method(), QMetaObject::method(), QWindowsLocalCodec::mibEnum(), QGridLayout::minimumHeightForWidth(), QTabBarPrivate::minimumTabSizeHint(), QTriangulator< T >::SimpleToMonotone::monotoneDecomposition(), QScript::QtFunction::mostGeneralMethod(), QAbstractItemView::mouseDoubleClickEvent(), QAbstractItemView::mouseMoveEvent(), QCalendarView::mouseMoveEvent(), QAbstractItemView::mousePressEvent(), QCalendarView::mousePressEvent(), QAbstractItemView::mouseReleaseEvent(), QDeclarativeListModelWorkerAgent::Data::moveChange(), QDeclarativeGridView::moveCurrentIndexDown(), QDeclarativeGridView::moveCurrentIndexLeft(), QDeclarativeGridView::moveCurrentIndexRight(), QDeclarativeGridView::moveCurrentIndexUp(), QTreeView::moveCursor(), QIconModeViewBase::moveItem(), QTabBarPrivate::moveTab(), QTabBarPrivate::moveTabFinished(), QAccessibleWidget::navigate(), QAccessibleMenuItem::navigate(), QAccessibleItemRow::navigate(), QAccessibleTree::navigate(), QAccessibleToolBox::navigate(), QAccessibleMdiSubWindow::navigate(), QAccessibleTitleBar::navigate(), QXmlSimpleReaderPrivate::XmlRef::next(), QCss::Parser::next(), QMdiAreaPrivate::nextVisibleSubWindow(), QAxEventSink::OnChanged(), QListWidget::openPersistentEditor(), QTableWidget::openPersistentEditor(), QFutureInterface< T >::operator=(), QKeySequence::operator>=(), QIPv6Address::operator[](), QIndexMapper::operator[](), QKeySequence::operator[](), QXmlStreamSimpleStack< QXmlStreamReaderPrivate::Entity *>::operator[](), QScript::QtFunction::overloadedIndexes(), QTreeViewPrivate::pageDown(), QTreeViewPrivate::pageUp(), QTableView::paintEvent(), CloseButton::paintEvent(), QWidgetPrivate::paintSiblingsRecursive(), QGraphicsSceneBspTree::parentIndex(), QDeclarativeDirParser::parse(), QDateTimeParser::parse(), QDateTimeParser::parseFormat(), QCss::Parser::parseFunction(), QLineControl::parseInputMask(), QCss::Parser::Parser(), QCss::Parser::parseRuleset(), QDateTimeParser::parseSection(), QCompleter::pathFromIndex(), QListModeViewBase::perItemScrollToValue(), QDockAreaLayoutInfo::plug(), QDockAreaLayout::plug(), QDeclarativeStringConverters::pointFFromString(), QNetworkAccessHttpBackend::postRequest(), QWaitConditionPrivate::pre(), QCss::Parser::prev(), QDB2Driver::primaryIndex(), QIBaseDriver::primaryIndex(), QSQLite2Driver::primaryIndex(), QODBCDriver::primaryIndex(), QUnicodeTables::properties(), QDeclarativeContextScriptClass::property(), FlatListScriptClass::property(), QMetaObject::property(), QScript::QObjectDelegate::put(), QPolygon::putPoints(), pvrQwsAllocBuffers(), pvrQwsFreeBuffers(), pvrQwsSetVisibleRegion(), pvrQwsSwapBuffers(), q_configFromQPlatformWindowFormat(), QAccessibleTableInterface::qAccessibleTableCastHelper(), qax_generateDocumentation(), qax_readClassInfo(), QDirModelPrivate::QDirModelPrivate(), qDrawBorderPixmap(), QEglFSScreen::QEglFSScreen(), QFSCompleter::QFSCompleter(), qGetProp(), QGraphicsLinearLayoutPrivate::QGraphicsLinearLayoutPrivate(), QItemSelection::QItemSelection(), QItemSelectionRange::QItemSelectionRange(), QMatrix4x4::QMatrix4x4(), QMdiAreaTabBar::QMdiAreaTabBar(), QMetaEnum::QMetaEnum(), QMetaMethodBuilder::QMetaMethodBuilder(), QMutexPool::QMutexPool(), QAxServerBase::qObject(), QScriptStaticScopeObject::QScriptStaticScopeObject(), QSideBarDelegate::QSideBarDelegate(), QSqlTableModelPrivate::QSqlTableModelPrivate(), qt_blurrow(), qt_determine_writing_systems_from_truetype_bits(), qt_mac_extract_filter(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), qt_mac_menu_event(), QAxServerBase::qt_metacall(), qt_read_xpm_image_or_array(), qt_setWindowTitle_helperHelper(), qt_strip_filters(), qt_win_extract_filter(), qt_win_filter(), QMainWindowLayout::qtmacToolbarDelegate(), QToolBoxPrivate::QToolBoxPrivate(), QTreeWidgetItemIterator::QTreeWidgetItemIterator(), QtWndProc(), NamedNodeMapClass::queryProperty(), NodeListClass::queryProperty(), QVariantToVARIANT(), QWizardPrivate::QWizardPrivate(), QWSPcMouseHandlerPrivate::QWSPcMouseHandlerPrivate(), QWSTslibMouseHandlerPrivate::QWSTslibMouseHandlerPrivate(), QFbScreen::raise(), read_xpm_body(), MetaObjectGenerator::readClassInfo(), QHttpMultiPartIODevice::readData(), MetaObjectGenerator::readEnumInfo(), QRingBuffer< T >::readLine(), QOCICols::readPiecewise(), QMdiAreaPrivate::rearrange(), QCss::Parser::recordError(), QAccessibleTitleBar::rect(), QDeclarativeStringConverters::rectFFromString(), QSettings::registerFormat(), QMetaObjectBuilder::relatedMetaObject(), QObjectCleanupHandler::remove(), QDockAreaLayoutInfo::remove(), QDockAreaLayout::remove(), QTextFramePrivate::remove_me(), QList< QPostEvent >::removeAll(), QAnimationGroup::removeAnimation(), QDeclarativeListModelWorkerAgent::Data::removeChange(), QTextTable::removeColumns(), QDeclarativeAbstractBinding::removeFromObject(), QFontEngineFT::QGlyphSet::removeGlyphFromCache(), QGraphicsLinearLayoutPrivate::removeGridItem(), QGraphicsGridLayout::removeItem(), QBspTree::removeLeaf(), QList< QPostEvent >::removeOne(), QFSEventsFileSystemWatcherEngine::removePaths(), QRuntimeGraphicsSystem::removePixmapData(), ShaderEffect::removeRenderTarget(), QTextTable::removeRows(), QMdiArea::removeSubWindow(), QTabBar::removeTab(), QEglProperties::removeValue(), QRuntimeGraphicsSystem::removeWindowSurface(), QGtkPainter::renderTheme(), QTreeViewPrivate::renderTreeToPixmapForAnimation(), QByteArray::replace(), QString::replace(), QDeclarativeItemPrivate::resources_clear(), QSequentialAnimationGroupPrivate::restart(), QDockAreaLayout::restoreDockWidget(), QDockAreaLayoutInfo::restoreState(), QMacPasteboard::retrieveData(), QAbstractItemModelPrivate::rowsAboutToBeInserted(), QStandardItemModelPrivate::rowsAboutToBeInserted(), QStandardItemModelPrivate::rowsAboutToBeRemoved(), QAbstractItemView::rowsAboutToBeRemoved(), QDeclarativeCompiledBindingsPrivate::run(), QDockAreaLayoutInfo::saveState(), QScriptDeclarativeClass::scopeChainValue(), QWSServerPrivate::screensaverblockevent(), QScriptEnginePrivate::scriptConnect(), QScriptEnginePrivate::scriptDisconnect(), QListWidget::scrollToItem(), QTableWidget::scrollToItem(), QSqlQuery::seek(), QTreeViewPrivate::select(), QAccessibleTable2::selectColumn(), QTableViewPrivate::selectColumn(), QAccessibleTable2::selectedCells(), QAccessibleTable2::selectedColumns(), QItemSelectionModel::selectedColumns(), QTableView::selectedIndexes(), QListView::selectedIndexes(), QTreeView::selectedIndexes(), QTableWidget::selectedItems(), QFileDialogPrivate::selectedNameFilter_sys(), QAccessibleTable2::selectedRows(), QItemSelectionModel::selectedRows(), QFileDialog::selectFile(), QFileDialogPrivate::selectNameFilter_sys(), QPatternist::XsdValidatingInstanceReader::selectNodeSets(), QAccessibleTable2::selectRow(), QAccessibleTree::selectRow(), QTableViewPrivate::selectRow(), QSidebar::selectUrl(), QWSDisplay::sendIMMouseEvent(), QDockAreaLayout::separatorMove(), separatorMoveHelper(), QDockAreaLayoutInfo::separatorRect(), QDockAreaLayout::separatorRect(), QMetaObjectBuilder::serialize(), QDeclarativeListModel::set(), FlatListModel::set(), set_text(), QSqlResult::setAt(), QTableWidget::setCellWidget(), QStandardItemPrivate::setChild(), QGradient::setColorAt(), QMatrix4x4::setColumn(), QInputDialogPrivate::setComboBoxText(), QSimplex::setConstraints(), QScriptDebuggerCommand::setContextIndex(), QSequentialAnimationGroupPrivate::setCurrentAnimation(), QTableWidget::setCurrentCell(), QScriptDebuggerConsole::setCurrentFrameIndex(), QStackedLayout::setCurrentIndex(), QDeclarativeGridView::setCurrentIndex(), QDeclarativeListView::setCurrentIndex(), QTabBar::setCurrentIndex(), QItemSelectionModel::setCurrentIndex(), QFontListView::setCurrentItem(), QTabBarPrivate::setCurrentNextEnabledIndex(), QCUPSSupport::setCurrentPrinter(), QListWidget::setCurrentRow(), QDateTimeEdit::setCurrentSection(), QStackedLayout::setCurrentWidget(), QColorDialog::setCustomColor(), PvrEglWindowSurface::setDirectRegion(), QGraphicsItemPrivate::setExtra(), QWizard::setField(), QTreeView::setFirstColumnSpanned(), QTreeWidget::setFirstItemColumnSpanned(), QDirectFBScreenPrivate::setFlipFlags(), QWidgetPrivate::setFont_helper(), QSqlRecord::setGenerated(), QFontEngineFT::QGlyphSet::setGlyph(), QAbstractItemViewPrivate::setHoverIndex(), QUndoStackPrivate::setIndex(), QToolBox::setItemEnabled(), QTreeWidget::setItemHidden(), QListWidget::setItemSelected(), QTableWidget::setItemSelected(), QListWidget::setItemWidget(), QKeySequence::setKey(), QInputDialogPrivate::setListViewText(), QSqlRecord::setNull(), QObjectPrivate::setParent_helper(), QPolygon::setPoint(), QStyleSheetStyle::setProperties(), FlatListModel::setProperty(), FlatListScriptClass::setProperty(), QDataWidgetMapper::setRootIndex(), QAbstractItemView::setRootIndex(), QMatrix4x4::setRow(), QTreeView::setRowHidden(), QTableView::setSelection(), QTreeView::setSelection(), QMenu::setSeparatorsCollapsible(), ShaderEffectItem::setSource(), QColorDialog::setStandardColor(), QTabBar::setTabButton(), QUnixPrintWidgetPrivate::setupPrinter(), QSqlRecord::setValue(), QEglProperties::setValue(), QPainter::setViewTransformEnabled(), QAbstractItemModel::sibling(), QGraphicsAnchorLayoutPrivate::simplifyVertices(), QDeclarativeStringConverters::sizeFFromString(), QSidebar::sizeHint(), QComboMenuDelegate::sizeHint(), QTableView::sizeHintForColumn(), QAbstractItemView::sizeHintForColumn(), QTreeView::sizeHintForColumn(), QAbstractItemView::sizeHintForIndex(), QTableView::sizeHintForRow(), QAbstractItemView::sizeHintForRow(), QDockAreaLayoutInfo::split(), QDockAreaLayout::splitDockWidget(), QGraphicsItem::stackBefore(), QWidgetPrivate::stackUnder_sys(), QDesktopServices::storageLocation(), QPolygon::swap(), QCss::Parser::symbol(), QScriptDebuggerPrivate::sync(), QMenuBarPrivate::QMacMenuBarPrivate::syncAction(), QMenuPrivate::QMacMenuPrivate::syncAction(), QDockAreaLayoutInfo::tab(), QDockAreaLayout::tabifyDockWidget(), QTableWidgetPrivate::tableModel(), QMainWindowLayoutState::takeAt(), QToolBarAreaLayout::takeAt(), QDockAreaLayout::takeAt(), QCss::Parser::test(), QCss::Parser::testAndParseUri(), QCss::Parser::testPrio(), QPainter::testRenderHint(), QPatternist::XsdInstanceReader::text(), QImage::textLanguages(), QImage::textList(), QTreeView::timerEvent(), QTimerInfoList::timerInsert(), QDeclarativeXmlListModel::toString(), QSplitterPrivate::trans(), PvrEglWindowSurface::transformRects(), QAxServerBase::UIDeactivate(), QDockAreaLayoutInfo::unnest(), QDockAreaLayoutInfo::unplug(), QDockAreaLayout::unplug(), QAccessibleTable2::unselectColumn(), QAccessibleTable2::unselectRow(), QCss::Parser::until(), QMdiAreaPrivate::updateActiveWindow(), QPicturePaintEngine::updateBrush(), QDeclarativeListViewPrivate::updateCurrentSection(), QAbstractItemViewPrivate::updateEditorData(), QAbstractItemView::updateEditorGeometries(), QListView::updateGeometries(), QPicturePaintEngine::updatePen(), QToolBoxPrivate::updateTabs(), QSidebar::urls(), QFontEngineFT::QGlyphSet::useFastGlyphData(), MetaObjectGenerator::usertypeToString(), QPatternist::XsdValidatingInstanceReader::validateAttribute(), QPatternist::XsdValidatingInstanceReader::validateKeyIdentityConstraint(), QTabBarPrivate::validIndex(), QEglProperties::value(), QXmlAttributes::value(), QDeclarativeStringConverters::vector3DFromString(), QTreeViewPrivate::viewIndex(), QListViewPrivate::viewItemRect(), QAbstractItemView::viewportEvent(), QListWidget::visualItemRect(), QTableWidget::visualItemRect(), QFuture< T >::waitForFinished(), QMenuBarPrivate::wceDestroyMenuBar(), QToolBar::widgetForAction(), QtopiaPrintEnginePrivate::writeG3BlackRun(), QtopiaPrintEnginePrivate::writeG3WhiteRun(), xpm_color_name(), QDeclarativeJS::MemoryPool::~MemoryPool(), QScriptDeclarativeClass::Object::~Object(), QAccessibleInterface::~QAccessibleInterface(), QAccessibleTree::~QAccessibleTree(), QAxMetaObject::~QAxMetaObject(), QColumnViewDelegate::~QColumnViewDelegate(), QComboBoxPrivate::~QComboBoxPrivate(), QCommonListViewBase::~QCommonListViewBase(), QDeclarativeVisualItemModel::~QDeclarativeVisualItemModel(), QFontSubset::~QFontSubset(), QIntKeyboardListenThread::~QIntKeyboardListenThread(), QIntMouseListenThread::~QIntMouseListenThread(), QListModelInterface::~QListModelInterface(), QMutexPool::~QMutexPool(), QPPDOptionsEditor::~QPPDOptionsEditor(), QScriptDebuggerConsoleHistorianInterface::~QScriptDebuggerConsoleHistorianInterface(), QXmlAttributes::~QXmlAttributes(), and QZipPrivate::~QZipPrivate().

◆ symbol_map

const unsigned short symbol_map[0x100]
static

Definition at line 227 of file qfontsubset.cpp.

Referenced by QFontSubset::glyphName().

◆ times_styles

const char* times_styles[4]
static
Initial value:
= {
"Times-Regular",
"Times-Bold",
"Times-Italic",
"Times-BoldItalic"
}

Definition at line 1634 of file qfontsubset.cpp.

◆ u

Definition at line 116 of file qfontsubset.cpp.

Referenced by buildReverseMap(), QVariant::canConvert(), QDeclarativeCompiler::checkValidId(), QSplitter::closestLegalPosition(), construct(), QWindowsMimeText::convertFromMime(), QBuiltInMimes::convertFromMime(), QGb18030Codec::convertFromUnicode(), QUtf8::convertFromUnicode(), QSimpleTextCodec::convertFromUnicode(), QGb18030Codec::convertToUnicode(), QBig5Codec::convertToUnicode(), QBig5hkscsCodec::convertToUnicode(), QGbkCodec::convertToUnicode(), QEucKrCodec::convertToUnicode(), QEucJpCodec::convertToUnicode(), QJisCodec::convertToUnicode(), QSjisCodec::convertToUnicode(), QGb2312Codec::convertToUnicode(), QTsciiCodec::convertToUnicode(), QCP949Codec::convertToUnicode(), detectProcessorFeatures(), QCommonStyle::drawControl(), QMotifStyle::drawControl(), QTriangulator< T >::ComplexToSimple::edgeIsLeftOfEdge(), QTriangulator< T >::SimpleToMonotone::edgeIsLeftOfEdge(), QWSSoundServerPrivate::feedDevice(), QObject::findChildren(), findEncoding(), QRadialGradient::focalRadius(), QVector< QPoint >::free(), QDeclarativeCompiler::genLiteralAssignment(), QFontSubset::glyphName(), hash(), QScriptContext::isCalledAsConstructor(), QIntersectionPoint::isOnLine(), isValidCharacter(), isValidCharacterNoDash(), isValidNumber(), lineIntersectsRect(), QVariant::load(), lowest_bit(), QMutexLocker::mutex(), QTriangulator< T >::ComplexToSimple::Event::operator<(), QUrl::operator<<(), QIntersectionPoint::operator<=(), operator>>(), QChar::operator>>(), QUrl::operator>>(), qIntersectionPoint(), qIsAlnum(), qIsNull(), QMutexLocker::QMutexLocker(), QReadLocker::QReadLocker(), qt_TSCIIToUnicode(), query_colormap(), QVariant::QVariant(), QWriteLocker::QWriteLocker(), QReadLocker::readWriteLock(), QWriteLocker::readWriteLock(), QReadLocker::relock(), QMutexLocker::relock(), QWriteLocker::relock(), QWSSoundServerClient::sendClientMessage(), QRadialGradient::setFocalRadius(), QDeclarativeDebugFileReference::setUrl(), QTriangulator< T >::ComplexToSimple::sortEdgeList(), QTriangulator< T >::ComplexToSimple::splitEdgeListRange(), QFontCache::timerEvent(), toUcs4_helper(), QCache< QPixmapCache::Key, QPixmapCacheEntry >::trim(), QJpUnicodeConv::unicodeToCp932(), QJpUnicodeConv::unicodeToSjisibmvdc(), QStyleHelper::uniqueName(), QReadLocker::unlock(), QMutexLocker::unlock(), QWriteLocker::unlock(), QString::vsprintf(), and QDeclarativePropertyPrivate::write().

◆ unicode_to_aglindex

const { ... } unicode_to_aglindex[]

Referenced by QFontSubset::glyphName().