Qt 4.8
Classes | Public Types | Public Functions | Static Public Functions | Private Functions | Properties | List of all members
QFontEngineQPF Class Reference

#include <qfontengine_qpf_p.h>

Inheritance diagram for QFontEngineQPF:
QFontEngine QObject

Classes

struct  Block
 
struct  Glyph
 
struct  Header
 
struct  Tag
 

Public Types

enum  { CurrentMajorVersion = 2, CurrentMinorVersion = 0 }
 
enum  BlockTag { CMapBlock, GMapBlock, GlyphBlock }
 
enum  GlyphFormat { BitmapGlyphs = 1, AlphamapGlyphs = 8 }
 
enum  HeaderTag {
  Tag_FontName, Tag_FileName, Tag_FileIndex, Tag_FontRevision,
  Tag_FreeText, Tag_Ascent, Tag_Descent, Tag_Leading,
  Tag_XHeight, Tag_AverageCharWidth, Tag_MaxCharWidth, Tag_LineThickness,
  Tag_MinLeftBearing, Tag_MinRightBearing, Tag_UnderlinePosition, Tag_GlyphFormat,
  Tag_PixelSize, Tag_Weight, Tag_Style, Tag_EndOfHeader,
  Tag_WritingSystems, NumTags
}
 
enum  TagType {
  StringType, FixedType, UInt8Type, UInt32Type,
  BitFieldType
}
 
- Public Types inherited from QFontEngine
enum  GlyphFormat {
  Format_None, Format_Render = Format_None, Format_Mono, Format_A8,
  Format_A32
}
 
enum  SynthesizedFlags { SynthesizedItalic = 0x1, SynthesizedBold = 0x2, SynthesizedStretch = 0x4 }
 
enum  Type {
  Box, Multi, XLFD, Win,
  Mac, Freetype, QPF1, QPF2,
  Proxy, S60FontEngine, DirectWrite, TestFontEngine = 0x1000
}
 

Public Functions

void addOutlineToPath (qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags)
 
QImage alphaMapForGlyph (glyph_t t)
 
QFixed ascent () const
 
glyph_metrics_t boundingBox (const QGlyphLayout &glyphs)
 
glyph_metrics_t boundingBox (glyph_t glyph)
 
bool canRender (const QChar *string, int len)
 
QFixed descent () const
 
void doKerning (QGlyphLayout *g, QTextEngine::ShaperFlags flags) const
 
void draw (QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si)
 
virtual QFixed emSquareSize () const
 
FaceId faceId () const
 
const GlyphfindGlyph (glyph_t g) const
 
QString fontFile () const
 
virtual HB_Error getPointInOutline (HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
 
bool getSfntTableData (uint tag, uchar *buffer, uint *length) const
 
virtual int glyphCount () const
 
bool isValid () const
 
QFixed leading () const
 
QFixed lineThickness () const
 
FT_Face lockFace () const
 
qreal maxCharWidth () const
 
qreal minLeftBearing () const
 
qreal minRightBearing () const
 
const char * name () const
 
 QFontEngineQPF (const QFontDef &def, int fd, QFontEngine *renderingFontEngine=0)
 
void recalcAdvances (QGlyphLayout *, QTextEngine::ShaperFlags) const
 
QFontEnginerenderingEngine () const
 
bool stringToCMap (const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
 
QFontEnginetakeRenderingEngine ()
 
Type type () const
 
QFixed underlinePosition () const
 
void unlockFace () const
 
 ~QFontEngineQPF ()
 
- Public Functions inherited from QFontEngine
void addBitmapFontToPath (qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)
 
virtual void addGlyphsToPath (glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
 
virtual glyph_metrics_t alphaMapBoundingBox (glyph_t glyph, QFixed, const QTransform &matrix, GlyphFormat)
 
virtual QImage alphaMapForGlyph (glyph_t glyph, QFixed subPixelPosition)
 
virtual QImage alphaMapForGlyph (glyph_t, const QTransform &t)
 
virtual QImage alphaMapForGlyph (glyph_t, QFixed subPixelPosition, const QTransform &t)
 
virtual QImage alphaRGBMapForGlyph (glyph_t, QFixed subPixelPosition, int margin, const QTransform &t)
 
virtual QFixed averageCharWidth () const
 
virtual glyph_metrics_t boundingBox (glyph_t glyph, const QTransform &matrix)
 
virtual QFontEnginecloneWithSize (qreal) const
 
virtual void getGlyphBearings (glyph_t glyph, qreal *leftBearing=0, qreal *rightBearing=0)
 
void getGlyphPositions (const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
 
QByteArray getSfntTable (uint) const
 
virtual void getUnscaledGlyph (glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
 
QFontEngineGlyphCacheglyphCache (void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const
 
HB_Face harfbuzzFace () const
 
HB_Font harfbuzzFont () const
 
void loadKerningPairs (QFixed scalingFactor)
 
virtual Properties properties () const
 
 QFontEngine ()
 
virtual void removeGlyphFromCache (glyph_t)
 
void setGlyphCache (void *key, QFontEngineGlyphCache *data)
 
virtual bool supportsSubPixelPositions () const
 
virtual int synthesized () const
 
glyph_metrics_t tightBoundingBox (const QGlyphLayout &glyphs)
 
virtual QFixed xHeight () const
 
virtual ~QFontEngine ()
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Static Public Functions

static QList< QByteArraycleanUpAfterClientCrash (const QList< int > &crashedClientIds)
 
static QVariant extractHeaderField (const uchar *data, HeaderTag tag)
 
static bool verifyHeader (const uchar *data, int size)
 
- Static Public Functions inherited from QFontEngine
static QByteArray convertToPostscriptFontFamilyName (const QByteArray &fontFamily)
 
static const uchargetCMap (const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
 
static quint32 getTrueTypeGlyphIndex (const uchar *cmap, uint unicode)
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 

Private Functions

void ensureGlyphsLoaded (const QGlyphLayout &glyphs)
 
void loadGlyph (glyph_t glyph)
 
bool lockFile ()
 
void remapFontData ()
 
void unlockFile ()
 

Properties

quint32 cmapOffset
 
int cmapSize
 
int dataSize
 
QByteArray encodedFileName
 
const ucharexternalCMap
 
FaceId face_id
 
int fd
 
QString fileName
 
const ucharfontData
 
QFreetypeFacefreetype
 
QByteArray freetypeCMapTable
 
quint32 glyphDataOffset
 
quint32 glyphDataSize
 
quint32 glyphMapEntries
 
quint32 glyphMapOffset
 
bool kerning_pairs_loaded
 
bool readOnly
 
QFontEnginerenderingFontEngine
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 
- Public Variables inherited from QFontEngine
uint cache_cost
 
int cache_count
 
QFontDef fontDef
 
uint fsType: 16
 
int glyphFormat
 
HB_Face hbFace
 
HB_FontRec hbFont
 
QVector< KernPairkerning_pairs
 
QAtomicInt ref
 
bool symbol
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 
- Protected Functions inherited from QFontEngine
QFixed lastRightBearing (const QGlyphLayout &glyphs, bool round=false)
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *)
 This event handler can be reimplemented in a subclass to receive timer events for the object. More...
 
- Static Protected Functions inherited from QFontEngine
static const QVector< QRgb > & grayPalette ()
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 73 of file qfontengine_qpf_p.h.

Enumerations

◆ anonymous enum

anonymous enum
Enumerator
CurrentMajorVersion 
CurrentMinorVersion 

Definition at line 123 of file qfontengine_qpf_p.h.

◆ BlockTag

Enumerator
CMapBlock 
GMapBlock 
GlyphBlock 

Definition at line 131 of file qfontengine_qpf_p.h.

◆ GlyphFormat

Enumerator
BitmapGlyphs 
AlphamapGlyphs 

Definition at line 118 of file qfontengine_qpf_p.h.

◆ HeaderTag

Enumerator
Tag_FontName 
Tag_FileName 
Tag_FileIndex 
Tag_FontRevision 
Tag_FreeText 
Tag_Ascent 
Tag_Descent 
Tag_Leading 
Tag_XHeight 
Tag_AverageCharWidth 
Tag_MaxCharWidth 
Tag_LineThickness 
Tag_MinLeftBearing 
Tag_MinRightBearing 
Tag_UnderlinePosition 
Tag_GlyphFormat 
Tag_PixelSize 
Tag_Weight 
Tag_Style 
Tag_EndOfHeader 
Tag_WritingSystems 
NumTags 

Definition at line 78 of file qfontengine_qpf_p.h.

78  {
79  Tag_FontName, // 0 string
80  Tag_FileName, // 1 string
81  Tag_FileIndex, // 2 quint32
82  Tag_FontRevision, // 3 quint32
83  Tag_FreeText, // 4 string
84  Tag_Ascent, // 5 QFixed
85  Tag_Descent, // 6 QFixed
86  Tag_Leading, // 7 QFixed
87  Tag_XHeight, // 8 QFixed
88  Tag_AverageCharWidth, // 9 QFixed
89  Tag_MaxCharWidth, // 10 QFixed
90  Tag_LineThickness, // 11 QFixed
91  Tag_MinLeftBearing, // 12 QFixed
92  Tag_MinRightBearing, // 13 QFixed
93  Tag_UnderlinePosition, // 14 QFixed
94  Tag_GlyphFormat, // 15 quint8
95  Tag_PixelSize, // 16 quint8
96  Tag_Weight, // 17 quint8
97  Tag_Style, // 18 quint8
98  Tag_EndOfHeader, // 19 string
99  Tag_WritingSystems, // 20 bitfield
100 
101  NumTags
102  };

◆ TagType

Enumerator
StringType 
FixedType 
UInt8Type 
UInt32Type 
BitFieldType 

Definition at line 104 of file qfontengine_qpf_p.h.

Constructors and Destructors

◆ QFontEngineQPF()

QFontEngineQPF::QFontEngineQPF ( const QFontDef def,
int  fd,
QFontEngine renderingFontEngine = 0 
)

Definition at line 292 of file qfontengine_qpf.cpp.

Referenced by getChar().

293  : fd(fileDescriptor), fontData(0), dataSize(0), renderingFontEngine(fontEngine)
294 #endif
295 {
296  fontDef = def;
297  cache_cost = 100;
298  freetype = 0;
299  externalCMap = 0;
300  cmapOffset = 0;
301  cmapSize = 0;
302  glyphMapOffset = 0;
303  glyphMapEntries = 0;
304  glyphDataOffset = 0;
305  glyphDataSize = 0;
306  if (renderingFontEngine)
307  glyphFormat = renderingFontEngine->glyphFormat;
308  kerning_pairs_loaded = false;
309  readOnly = true;
310 
311 #if defined(DEBUG_FONTENGINE)
312  qDebug() << "QFontEngineQPF::QFontEngineQPF( fd =" << fd << ", renderingFontEngine =" << renderingFontEngine << ')';
313 #endif
314 
315 #ifndef QT_FONTS_ARE_RESOURCES
316  if (fd < 0) {
317  if (!renderingFontEngine)
318  return;
319 
324  QLatin1String("_italic") : QLatin1String(""))
325  + QLatin1String(".qsf");
328 
330  if (::access(encodedFileName, F_OK) == 0) {
331 #if defined(DEBUG_FONTENGINE)
332  qDebug() << "found existing qpf:" << fileName;
333 #endif
334  if (::access(encodedFileName, W_OK | R_OK) == 0) {
336  }
337  // read-write access failed - try read-only access
338  if (fd == -1 && ::access(encodedFileName, R_OK) == 0) {
340  if (fd == -1) {
341 #if defined(DEBUG_FONTENGINE)
342  qErrnoWarning("QFontEngineQPF: unable to open %s", encodedFileName.constData());
343 #endif
344  return;
345  }
346  }
347  if (fd == -1) {
348 #if defined(DEBUG_FONTENGINE)
349  qWarning("QFontEngineQPF: insufficient access rights to %s", encodedFileName.constData());
350 #endif
351  return;
352  }
353  } else {
354 #if defined(DEBUG_FONTENGINE)
355  qDebug() << "creating qpf on the fly:" << fileName;
356 #endif
357  if (::access(QFile::encodeName(qws_fontCacheDir()), W_OK) == 0) {
359  if (fd == -1) {
360 #if defined(DEBUG_FONTENGINE)
361  qErrnoWarning(errno, "QFontEngineQPF: open() failed for %s", encodedFileName.constData());
362 #endif
363  return;
364  }
365 
366  QBuffer buffer;
367  buffer.open(QIODevice::ReadWrite);
368  QPFGenerator generator(&buffer, renderingFontEngine);
369  generator.generate();
370  buffer.close();
371  const QByteArray &data = buffer.data();
372  if (QT_WRITE(fd, data.constData(), data.size()) == -1) {
373 #if defined(DEBUG_FONTENGINE)
374  qErrnoWarning(errno, "QFontEngineQPF: write() failed for %s", encodedFileName.constData());
375 #endif
376  return;
377  }
378  } else {
379 #if defined(DEBUG_FONTENGINE)
380  qErrnoWarning(errno, "QFontEngineQPF: access() failed for %s", qPrintable(qws_fontCacheDir()));
381 #endif
382  return;
383  }
384  }
385  }
386 
387  QT_STATBUF st;
388  if (QT_FSTAT(fd, &st)) {
389 #if defined(DEBUG_FONTENGINE)
390  qErrnoWarning(errno, "QFontEngineQPF: fstat failed!");
391 #endif
392  return;
393  }
394  dataSize = st.st_size;
395 
396 
397  fontData = (const uchar *)::mmap(0, st.st_size, PROT_READ | (renderingFontEngine ? PROT_WRITE : 0), MAP_SHARED, fd, 0);
398  if (!fontData || fontData == (const uchar *)MAP_FAILED) {
399 #if defined(DEBUG_FONTENGINE)
400  perror("mmap failed");
401 #endif
402  fontData = 0;
403  return;
404  }
405 #endif //QT_FONTS_ARE_RESOURCES
406 
407  if (!verifyHeader(fontData, dataSize)) {
408 #if defined(DEBUG_FONTENGINE)
409  qDebug() << "verifyHeader failed!";
410 #endif
411  return;
412  }
413 
414  const Header *header = reinterpret_cast<const Header *>(fontData);
415 
416  readOnly = (header->lock == 0xffffffff);
417 
418  const uchar *data = fontData + sizeof(Header) + qFromBigEndian<quint16>(header->dataSize);
419  const uchar *endPtr = fontData + dataSize;
420  while (data <= endPtr - 8) {
421  quint16 blockTag = readValue<quint16>(data);
422  data += 2; // skip padding
423  quint32 blockSize = readValue<quint32>(data);
424 
425  if (blockTag == CMapBlock) {
426  cmapOffset = data - fontData;
428  } else if (blockTag == GMapBlock) {
429  glyphMapOffset = data - fontData;
430  glyphMapEntries = blockSize / 4;
431  } else if (blockTag == GlyphBlock) {
432  glyphDataOffset = data - fontData;
434  }
435 
436  data += blockSize;
437  }
438 
441 #if !defined(QT_NO_FREETYPE) && !defined(QT_FONTS_ARE_RESOURCES)
443  if (!freetype) {
444  QString newPath =
445 #ifndef QT_NO_SETTINGS
447 #endif
448  QLatin1String("/fonts/") +
452  }
453  if (freetype) {
454  const quint32 qpfTtfRevision = extractHeaderField(fontData, Tag_FontRevision).toUInt();
455  uchar data[4];
456  uint length = 4;
457  bool ok = freetype->getSfntTable(MAKE_TAG('h', 'e', 'a', 'd'), data, &length);
458  if (!ok || length != 4
459  || qFromBigEndian<quint32>(data) != qpfTtfRevision) {
461  freetype = 0;
462  }
463  }
464  if (!cmapOffset && freetype) {
465  freetypeCMapTable = getSfntTable(MAKE_TAG('c', 'm', 'a', 'p'));
466  externalCMap = reinterpret_cast<const uchar *>(freetypeCMapTable.constData());
468  }
469 #endif
470 
471  // get the real cmap
472  if (cmapOffset) {
473  int tableSize = cmapSize;
474  const uchar *cmapPtr = getCMap(fontData + cmapOffset, tableSize, &symbol, &cmapSize);
475  if (cmapPtr)
476  cmapOffset = cmapPtr - fontData;
477  else
478  cmapOffset = 0;
479  } else if (externalCMap) {
480  int tableSize = cmapSize;
481  externalCMap = getCMap(externalCMap, tableSize, &symbol, &cmapSize);
482  }
483 
484  // verify all the positions in the glyphMap
485  if (glyphMapOffset) {
486  const quint32 *gmapPtr = reinterpret_cast<const quint32 *>(fontData + glyphMapOffset);
487  for (uint i = 0; i < glyphMapEntries; ++i) {
488  quint32 glyphDataPos = qFromBigEndian<quint32>(gmapPtr[i]);
489  if (glyphDataPos == 0xffffffff)
490  continue;
491  if (glyphDataPos >= glyphDataSize) {
492  // error
493  glyphMapOffset = 0;
494  glyphMapEntries = 0;
495  break;
496  }
497  }
498  }
499 
500 #if defined(DEBUG_FONTENGINE)
501  if (!isValid())
502  qDebug() << "fontData" << fontData << "dataSize" << dataSize
503  << "externalCMap" << externalCMap << "cmapOffset" << cmapOffset
504  << "glyphMapOffset" << glyphMapOffset << "glyphDataOffset" << glyphDataOffset
505  << "fd" << fd << "glyphDataSize" << glyphDataSize;
506 #endif
507 #if defined(Q_WS_QWS)
508  if (isValid() && renderingFontEngine)
510 #endif
511 }
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qstring.cpp:6448
static QFreetypeFace * getFace(const QFontEngine::FaceId &face_id, const QByteArray &fontData=QByteArray())
const int blockSize
void sendFontCommand(int type, const QByteArray &fontName)
QFreetypeFace * freetype
#define MAP_FAILED
const QByteArray & data() const
Returns the data contained in the buffer.
Definition: qbuffer.cpp:301
Q_GUI_EXPORT QWSDisplay * qt_fbdpy
bool open(OpenMode openMode)
Reimplemented Function
Definition: qbuffer.cpp:338
QString & replace(int i, int len, QChar after)
Definition: qstring.cpp:2005
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
void close()
Reimplemented Function
Definition: qbuffer.cpp:359
QString & prepend(QChar c)
Definition: qstring.h:261
#define O_RDONLY
QString fileName() const
Returns the name of the file, excluding the path.
Definition: qfileinfo.cpp:726
static const uchar * getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
quint32 qFromBigEndian< quint32 >(const uchar *src)
Definition: qendian.h:239
The QBuffer class provides a QIODevice interface for a QByteArray.
Definition: qbuffer.h:57
bool getSfntTable(uint tag, uchar *buffer, uint *length) const
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define O_CREAT
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
Definition: qvariant.cpp:2625
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
Definition: qfile.cpp:552
#define MAKE_TAG(ch1, ch2, ch3, ch4)
Q_CORE_EXPORT void qDebug(const char *,...)
unsigned char uchar
Definition: qglobal.h:994
static QString toString(Register *reg, int type, bool *ok=0)
bool isValid() const
int access(const char *, int)
QByteArray encodedFileName
unsigned short quint16
Definition: qglobal.h:936
Q_CORE_EXPORT void qWarning(const char *,...)
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
uint weight
Definition: qfont_p.h:95
QFontEngine * renderingFontEngine
qreal pixelSize
Definition: qfont_p.h:90
quint16 qFromBigEndian< quint16 >(const uchar *src)
Definition: qendian.h:249
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
const uchar * fontData
#define QT_OPEN
Definition: qcore_unix_p.h:186
const uchar * externalCMap
void release(const QFontEngine::FaceId &face_id)
uint style
Definition: qfont_p.h:97
static QString location(LibraryLocation)
Returns the location specified by loc.
QString qws_fontCacheDir()
#define st(var, type, card)
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
Definition: qstring.cpp:5389
uint toUInt(bool *ok=0) const
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray ...
Definition: qvariant.cpp:2644
unsigned int quint32
Definition: qglobal.h:938
QByteArray freetypeCMapTable
static bool verifyHeader(const uchar *data, int size)
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
static QByteArray encodeName(const QString &fileName)
By default, this function converts fileName to the local 8-bit encoding determined by the user&#39;s loca...
Definition: qfile.cpp:528
QFontDef fontDef
QString family
Definition: qfont_p.h:82
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
#define QT_WRITE
Definition: qcore_unix_p.h:289
#define qPrintable(string)
Definition: qglobal.h:1750
#define O_RDWR
#define O_EXCL
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
int errno
void qErrnoWarning(const char *msg,...)
Definition: qglobal.cpp:2954
QByteArray getSfntTable(uint) const
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ ~QFontEngineQPF()

QFontEngineQPF::~QFontEngineQPF ( )

Definition at line 513 of file qfontengine_qpf.cpp.

514 {
515 #if defined(Q_WS_QWS)
516  if (isValid() && renderingFontEngine) {
517  QT_TRY {
519  } QT_CATCH(...) {
520  qDebug("QFontEngineQPF::~QFontEngineQPF: Out of memory");
521  // ignore.
522  }
523  }
524 #endif
525  delete renderingFontEngine;
526  if (fontData) {
527  if (munmap((void *)fontData, dataSize) == -1) {
528 #if defined(DEBUG_FONTENGINE)
529  qErrnoWarning(errno, "~QFontEngineQPF: Unable to munmap");
530 #endif
531  }
532  }
533  if (fd != -1)
534  ::close(fd);
535 #if !defined(QT_NO_FREETYPE)
536  if (freetype)
538 #endif
539 }
void sendFontCommand(int type, const QByteArray &fontName)
QFreetypeFace * freetype
Q_GUI_EXPORT QWSDisplay * qt_fbdpy
Q_CORE_EXPORT void qDebug(const char *,...)
bool isValid() const
QByteArray encodedFileName
QFontEngine * renderingFontEngine
#define QT_CATCH(A)
Definition: qglobal.h:1537
const uchar * fontData
void release(const QFontEngine::FaceId &face_id)
#define QT_TRY
Definition: qglobal.h:1536
int errno
void qErrnoWarning(const char *msg,...)
Definition: qglobal.cpp:2954

Functions

◆ addOutlineToPath()

void QFontEngineQPF::addOutlineToPath ( qreal  x,
qreal  y,
const QGlyphLayout glyphs,
QPainterPath path,
QTextItem::RenderFlags  flags 
)
virtual

Reimplemented from QFontEngine.

Definition at line 673 of file qfontengine_qpf.cpp.

674 {
675  if (renderingFontEngine &&
677  || static_cast<QProxyFontEngine *>(renderingFontEngine)->capabilities() & QAbstractFontEngine::CanOutlineGlyphs)) {
678  renderingFontEngine->addOutlineToPath(x, y, glyphs, path, flags);
679  return;
680  }
681  addBitmapFontToPath(x, y, glyphs, path, flags);
682 }
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
virtual Type type() const =0
QFontEngine * renderingFontEngine
void addBitmapFontToPath(qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)

◆ alphaMapForGlyph()

QImage QFontEngineQPF::alphaMapForGlyph ( glyph_t  glyph)
virtual

Create a qimage with the alpha values for the glyph. Returns an image indexed_8 with index values ranging from 0=fully transparent to 255=opaque

Reimplemented from QFontEngine.

Definition at line 624 of file qfontengine_qpf.cpp.

625 {
626  const Glyph *glyph = findGlyph(g);
627  if (!glyph)
628  return QImage();
629 
630  const uchar *bits = ((const uchar *) glyph) + sizeof(Glyph);
631 
632  QImage image(glyph->width, glyph->height, QImage::Format_Indexed8);
633  for (int j=0; j<256; ++j)
634  image.setColor(j, qRgba(0, 0, 0, j));
635 
636  for (int i=0; i<glyph->height; ++i) {
637  memcpy(image.scanLine(i), bits, glyph->bytesPerLine);
638  bits += glyph->bytesPerLine;
639  }
640  return image;
641 }
unsigned char uchar
Definition: qglobal.h:994
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
Definition: qrgb.h:72
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
const Glyph * findGlyph(glyph_t g) const

◆ ascent()

QFixed QFontEngineQPF::ascent ( ) const
virtual

Implements QFontEngine.

Definition at line 737 of file qfontengine_qpf.cpp.

Referenced by boundingBox().

738 {
739  return QFixed::fromReal(extractHeaderField(fontData, Tag_Ascent).value<qreal>());
740 }
static QFixed fromReal(qreal r)
Definition: qfixed_p.h:70
const uchar * fontData
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ boundingBox() [1/2]

glyph_metrics_t QFontEngineQPF::boundingBox ( const QGlyphLayout glyphs)
virtual

Implements QFontEngine.

Definition at line 684 of file qfontengine_qpf.cpp.

685 {
686 #ifndef QT_NO_FREETYPE
687  const_cast<QFontEngineQPF *>(this)->ensureGlyphsLoaded(glyphs);
688 #endif
689 
690  glyph_metrics_t overall;
691  // initialize with line height, we get the same behaviour on all platforms
692  overall.y = -ascent();
693  overall.height = ascent() + descent() + 1;
694 
695  QFixed ymax = 0;
696  QFixed xmax = 0;
697  for (int i = 0; i < glyphs.numGlyphs; i++) {
698  const Glyph *g = findGlyph(glyphs.glyphs[i]);
699  if (!g)
700  continue;
701 
702  QFixed x = overall.xoff + glyphs.offsets[i].x + g->x;
703  QFixed y = overall.yoff + glyphs.offsets[i].y + g->y;
704  overall.x = qMin(overall.x, x);
705  overall.y = qMin(overall.y, y);
706  xmax = qMax(xmax, x + g->width);
707  ymax = qMax(ymax, y + g->height);
708  overall.xoff += g->advance;
709  }
710  overall.height = qMax(overall.height, ymax - overall.y);
711  overall.width = xmax - overall.x;
712 
713  return overall;
714 }
void ensureGlyphsLoaded(const QGlyphLayout &glyphs)
QFixed ascent() const
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
HB_Glyph * glyphs
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
QFixed y
Definition: qfixed_p.h:191
const Glyph * findGlyph(glyph_t g) const
QFixed x
Definition: qfixed_p.h:190
QFixed descent() const
QFixedPoint * offsets

◆ boundingBox() [2/2]

glyph_metrics_t QFontEngineQPF::boundingBox ( glyph_t  glyph)
virtual

Implements QFontEngine.

Definition at line 716 of file qfontengine_qpf.cpp.

717 {
718 #ifndef QT_NO_FREETYPE
719  {
721  tmp.glyphs[0] = glyph;
722  const_cast<QFontEngineQPF *>(this)->ensureGlyphsLoaded(tmp);
723  }
724 #endif
725  glyph_metrics_t overall;
726  const Glyph *g = findGlyph(glyph);
727  if (!g)
728  return overall;
729  overall.x = g->x;
730  overall.y = g->y;
731  overall.width = g->width;
732  overall.height = g->height;
733  overall.xoff = g->advance;
734  return overall;
735 }
void ensureGlyphsLoaded(const QGlyphLayout &glyphs)
HB_Glyph * glyphs
const Glyph * findGlyph(glyph_t g) const

◆ canRender()

bool QFontEngineQPF::canRender ( const QChar string,
int  len 
)
virtual

Implements QFontEngine.

Definition at line 782 of file qfontengine_qpf.cpp.

783 {
785 
786  if (symbol) {
787  for (int i = 0; i < len; ++i) {
788  unsigned int uc = getChar(string, i, len);
789  glyph_t g = getTrueTypeGlyphIndex(cmap, uc);
790  if(!g && uc < 0x100)
791  g = getTrueTypeGlyphIndex(cmap, uc + 0xf000);
792  if (!g)
793  return false;
794  }
795  } else {
796  for (int i = 0; i < len; ++i) {
797  unsigned int uc = getChar(string, i, len);
798  if (!getTrueTypeGlyphIndex(cmap, uc))
799  return false;
800  }
801  }
802  return true;
803 }
static QColor cmap[256]
Definition: qgl_mac.mm:760
static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode)
unsigned char uchar
Definition: qglobal.h:994
const uchar * fontData
const uchar * externalCMap
static unsigned int getChar(const QChar *str, int &i, const int len)
unsigned int glyph_t

◆ cleanUpAfterClientCrash()

QList< QByteArray > QFontEngineQPF::cleanUpAfterClientCrash ( const QList< int > &  crashedClientIds)
static

Definition at line 250 of file qfontengine_qpf.cpp.

Referenced by QWSServerPrivate::cleanupFonts().

251 {
252  QList<QByteArray> removedFonts;
253  QDir dir(qws_fontCacheDir(), QLatin1String("*.qsf"));
254  foreach (const QFileInfo &fi, dir.entryInfoList()) {
256 
257  int fd = QT_OPEN(fileName.constData(), O_RDONLY, 0);
258  if (fd >= 0) {
259  void *header = ::mmap(0, sizeof(QFontEngineQPF::Header), PROT_READ, MAP_SHARED, fd, 0);
260  if (header && header != MAP_FAILED) {
261  quint32 lockValue = reinterpret_cast<QFontEngineQPF::Header *>(header)->lock;
262 
263  if (lockValue && crashedClientIds.contains(lockValue)) {
264  removedFonts.append(fileName);
265  QFile::remove(QFile::decodeName(fileName));
266  }
267 
268  ::munmap(header, sizeof(QFontEngineQPF::Header));
269  }
270  QT_CLOSE(fd);
271  }
272  }
273  if (!removedFonts.isEmpty())
274  qDebug() << "list of corrupted and removed fonts:" << removedFonts;
275  return removedFonts;
276 }
The QDir class provides access to directory structures and their contents.
Definition: qdir.h:58
#define MAP_FAILED
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define O_RDONLY
QString absoluteFilePath() const
Returns an absolute path including the file name.
Definition: qfileinfo.cpp:534
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
Definition: qfile.cpp:552
Q_CORE_EXPORT void qDebug(const char *,...)
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
#define QT_OPEN
Definition: qcore_unix_p.h:186
QString qws_fontCacheDir()
unsigned int quint32
Definition: qglobal.h:938
static QReadWriteLock lock
Definition: proxyconf.cpp:399
bool remove()
Removes the file specified by fileName().
Definition: qfile.cpp:715
static QByteArray encodeName(const QString &fileName)
By default, this function converts fileName to the local 8-bit encoding determined by the user&#39;s loca...
Definition: qfile.cpp:528
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:60
#define QT_CLOSE
Definition: qcore_unix_p.h:304

◆ descent()

QFixed QFontEngineQPF::descent ( ) const
virtual

Implements QFontEngine.

Definition at line 742 of file qfontengine_qpf.cpp.

Referenced by boundingBox().

743 {
744  return QFixed::fromReal(extractHeaderField(fontData, Tag_Descent).value<qreal>());
745 }
static QFixed fromReal(qreal r)
Definition: qfixed_p.h:70
const uchar * fontData
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ doKerning()

void QFontEngineQPF::doKerning ( QGlyphLayout g,
QTextEngine::ShaperFlags  flags 
) const
virtual

Reimplemented from QFontEngine.

Definition at line 847 of file qfontengine_qpf.cpp.

848 {
849  if (!kerning_pairs_loaded) {
850  kerning_pairs_loaded = true;
851  if (freetype) {
852  lockFace();
853  if (freetype->face->size->metrics.x_ppem != 0) {
854  QFixed scalingFactor(freetype->face->units_per_EM/freetype->face->size->metrics.x_ppem);
855  unlockFace();
856  const_cast<QFontEngineQPF *>(this)->loadKerningPairs(scalingFactor);
857  } else {
858  unlockFace();
859  }
860  }
861  }
862  QFontEngine::doKerning(g, flags);
863 }
QFreetypeFace * freetype
virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const
void unlockFace() const
FT_Face lockFace() const
void loadKerningPairs(QFixed scalingFactor)

◆ draw()

void QFontEngineQPF::draw ( QPaintEngine p,
qreal  x,
qreal  y,
const QTextItemInt si 
)

Definition at line 643 of file qfontengine_qpf.cpp.

644 {
645  QPaintEngineState *pState = p->state;
646  QRasterPaintEngine *paintEngine = static_cast<QRasterPaintEngine*>(p);
647 
648  QTransform matrix = pState->transform();
649  matrix.translate(_x, _y);
650  QFixed x = QFixed::fromReal(matrix.dx());
651  QFixed y = QFixed::fromReal(matrix.dy());
652 
655  getGlyphPositions(si.glyphs, matrix, si.flags, glyphs, positions);
656  if (glyphs.size() == 0)
657  return;
658 
659  for(int i = 0; i < glyphs.size(); i++) {
660  const Glyph *glyph = findGlyph(glyphs[i]);
661  if (!glyph)
662  continue;
663 
664  const int depth = 8; //###
665 
666  paintEngine->alphaPenBlt(reinterpret_cast<const uchar *>(glyph) + sizeof(Glyph), glyph->bytesPerLine, depth,
667  qRound(positions[i].x) + glyph->x,
668  qRound(positions[i].y) + glyph->y,
669  glyph->width, glyph->height);
670  }
671 }
qreal dy() const
Returns the vertical translation factor.
Definition: qtransform.h:277
QPaintEngineState * state
Definition: qpaintengine.h:239
RenderFlags flags
QTransform transform() const
Returns the matrix in the current paint engine state.
Definition: qpainter.cpp:9377
QTransform & translate(qreal dx, qreal dy)
Moves the coordinate system dx along the x axis and dy along the y axis, and returns a reference to t...
Definition: qtransform.cpp:417
static QFixed fromReal(qreal r)
Definition: qfixed_p.h:70
QGlyphLayout glyphs
static const QCssKnownValue positions[NumKnownPositionModes - 1]
Definition: qcssparser.cpp:329
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
const Glyph * findGlyph(glyph_t g) const
void alphaPenBlt(const void *src, int bpl, int depth, int rx, int ry, int w, int h)
qreal dx() const
Returns the horizontal translation factor.
Definition: qtransform.h:273
The QPaintEngineState class provides information about the active paint engine&#39;s current state...
Definition: qpaintengine.h:289
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203
int size() const
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ emSquareSize()

QFixed QFontEngineQPF::emSquareSize ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 875 of file qfontengine_qpf.cpp.

876 {
877  if (!freetype)
878  return QFontEngine::emSquareSize();
879  if (FT_IS_SCALABLE(freetype->face))
880  return freetype->face->units_per_EM;
881  else
882  return freetype->face->size->metrics.y_ppem;
883 }
QFreetypeFace * freetype
virtual QFixed emSquareSize() const

◆ ensureGlyphsLoaded()

void QFontEngineQPF::ensureGlyphsLoaded ( const QGlyphLayout glyphs)
private

Definition at line 885 of file qfontengine_qpf.cpp.

Referenced by boundingBox(), recalcAdvances(), and stringToCMap().

886 {
887  if (readOnly)
888  return;
889  bool locked = false;
890  for (int i = 0; i < glyphs.numGlyphs; ++i) {
891  if (!glyphs.glyphs[i])
892  continue;
893  const Glyph *g = findGlyph(glyphs.glyphs[i]);
894  if (g)
895  continue;
896  if (!locked) {
897  if (!lockFile())
898  return;
899  locked = true;
900  g = findGlyph(glyphs.glyphs[i]);
901  if (g)
902  continue;
903  }
904  loadGlyph(glyphs.glyphs[i]);
905  }
906  if (locked) {
907  unlockFile();
908 #if defined(DEBUG_FONTENGINE)
909  qDebug() << "Finished rendering glyphs\n";
910 #endif
911  }
912 }
HB_Glyph * glyphs
Q_CORE_EXPORT void qDebug(const char *,...)
const Glyph * findGlyph(glyph_t g) const
void loadGlyph(glyph_t glyph)

◆ extractHeaderField()

QVariant QFontEngineQPF::extractHeaderField ( const uchar data,
HeaderTag  tag 
)
static

Definition at line 198 of file qfontengine_qpf.cpp.

Referenced by QFontDatabasePrivate::addQPF2File(), ascent(), descent(), leading(), lineThickness(), maxCharWidth(), minLeftBearing(), minRightBearing(), QFontEngineQPF(), and underlinePosition().

199 {
200  const Header *header = reinterpret_cast<const Header *>(data);
201  const uchar *tagPtr = data + sizeof(Header);
202  const uchar *endPtr = tagPtr + qFromBigEndian<quint16>(header->dataSize);
203  while (tagPtr < endPtr - 3) {
204  quint16 tag = readValue<quint16>(tagPtr);
205  quint16 length = readValue<quint16>(tagPtr);
206  if (tag == requestedTag) {
207  switch (tagTypes[requestedTag]) {
208  case StringType:
209  return QVariant(QString::fromUtf8(reinterpret_cast<const char *>(tagPtr), length));
210  case UInt32Type:
211  return QVariant(readValue<quint32>(tagPtr));
212  case UInt8Type:
213  return QVariant(uint(*tagPtr));
214  case FixedType:
215  return QVariant(QFixed::fromFixed(readValue<quint32>(tagPtr)).toReal());
216  case BitFieldType:
217  return QVariant(QByteArray(reinterpret_cast<const char *>(tagPtr), length));
218  }
219  return QVariant();
220  } else if (tag == Tag_EndOfHeader) {
221  break;
222  }
223  tagPtr += length;
224  }
225 
226  return QVariant();
227 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
unsigned char uchar
Definition: qglobal.h:994
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Definition: qstring.cpp:4302
unsigned short quint16
Definition: qglobal.h:936
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
static QFontEngineQPA::TagType tagTypes[QFontEngineQPA::NumTags]
quint16 qFromBigEndian< quint16 >(const uchar *src)
Definition: qendian.h:249
static qreal toReal(Register *reg, int type, bool *ok=0)

◆ faceId()

FaceId QFontEngineQPF::faceId ( ) const
inlinevirtual

Reimplemented from QFontEngine.

Definition at line 170 of file qfontengine_qpf_p.h.

170 { return face_id; }

◆ findGlyph()

const QFontEngineQPF::Glyph * QFontEngineQPF::findGlyph ( glyph_t  g) const

Definition at line 152 of file qfontengine_qpf.cpp.

Referenced by alphaMapForGlyph(), boundingBox(), draw(), ensureGlyphsLoaded(), recalcAdvances(), and stringToCMap().

153 {
154  if (!g || g >= glyphMapEntries)
155  return 0;
156  const quint32 *gmapPtr = reinterpret_cast<const quint32 *>(fontData + glyphMapOffset);
157  quint32 glyphPos = qFromBigEndian<quint32>(gmapPtr[g]);
158  if (glyphPos > glyphDataSize) {
159  if (glyphPos == 0xffffffff)
160  return 0;
161 #if defined(DEBUG_FONTENGINE)
162  qDebug() << "glyph" << g << "outside of glyphData, remapping font file";
163 #endif
164 #if !defined(QT_NO_FREETYPE) && !defined(QT_FONTS_ARE_RESOURCES)
165  const_cast<QFontEngineQPF *>(this)->remapFontData();
166 #endif
167  if (glyphPos > glyphDataSize)
168  return 0;
169  }
170  return reinterpret_cast<const Glyph *>(fontData + glyphDataOffset + glyphPos);
171 }
quint32 qFromBigEndian< quint32 >(const uchar *src)
Definition: qendian.h:239
Q_CORE_EXPORT void qDebug(const char *,...)
const uchar * fontData
unsigned int quint32
Definition: qglobal.h:938

◆ fontFile()

QString QFontEngineQPF::fontFile ( ) const
inline

Definition at line 215 of file qfontengine_qpf_p.h.

215 { return fileName; }

◆ getPointInOutline()

HB_Error QFontEngineQPF::getPointInOutline ( HB_Glyph  glyph,
int  flags,
hb_uint32  point,
HB_Fixed *  xpos,
HB_Fixed *  ypos,
hb_uint32 *  nPoints 
)
virtual

Reimplemented from QFontEngine.

Definition at line 865 of file qfontengine_qpf.cpp.

866 {
867  if (!freetype)
868  return HB_Err_Not_Covered;
869  lockFace();
870  HB_Error result = freetype->getPointInOutline(glyph, flags, point, xpos, ypos, nPoints);
871  unlockFace();
872  return result;
873 }
HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
QFreetypeFace * freetype
void unlockFace() const
FT_Face lockFace() const

◆ getSfntTableData()

bool QFontEngineQPF::getSfntTableData ( uint  tag,
uchar buffer,
uint length 
) const
virtual

Reimplemented from QFontEngine.

Definition at line 541 of file qfontengine_qpf.cpp.

542 {
543 #if !defined(QT_NO_FREETYPE)
544  if (freetype)
545  return freetype->getSfntTable(tag, buffer, length);
546 #endif
547  Q_UNUSED(tag);
548  Q_UNUSED(buffer);
549  *length = 0;
550  return false;
551 }
QFreetypeFace * freetype
bool getSfntTable(uint tag, uchar *buffer, uint *length) const
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ glyphCount()

virtual int QFontEngineQPF::glyphCount ( ) const
inlinevirtual

Reimplemented from QFontEngine.

Definition at line 197 of file qfontengine_qpf_p.h.

Referenced by QPFGenerator::writeGMap().

197 { return glyphMapEntries; }

◆ isValid()

bool QFontEngineQPF::isValid ( ) const

Definition at line 805 of file qfontengine_qpf.cpp.

Referenced by loadSingleEngine(), QFontEngineQPF(), and ~QFontEngineQPF().

806 {
808  && glyphMapOffset && glyphDataOffset && (fd >= 0 || glyphDataSize > 0);
809 }
QFontEngine * renderingFontEngine
const uchar * fontData
const uchar * externalCMap

◆ leading()

QFixed QFontEngineQPF::leading ( ) const
virtual

Implements QFontEngine.

Definition at line 747 of file qfontengine_qpf.cpp.

748 {
749  return QFixed::fromReal(extractHeaderField(fontData, Tag_Leading).value<qreal>());
750 }
static QFixed fromReal(qreal r)
Definition: qfixed_p.h:70
const uchar * fontData
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ lineThickness()

QFixed QFontEngineQPF::lineThickness ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 772 of file qfontengine_qpf.cpp.

773 {
775 }
static QFixed fromReal(qreal r)
Definition: qfixed_p.h:70
const uchar * fontData
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ loadGlyph()

void QFontEngineQPF::loadGlyph ( glyph_t  glyph)
private

Definition at line 914 of file qfontengine_qpf.cpp.

Referenced by ensureGlyphsLoaded().

915 {
916  quint32 glyphPos = ~0;
917 
918  if (!renderingFontEngine)
919  return;
921  if (img.format() != QImage::Format_Indexed8) {
922  bool mono = img.depth() == 1;
924  if (mono) {
925  //### we know that 1 is opaque and 0 is transparent
926  uchar *byte = img.bits();
927  int count = img.byteCount();
928  while (count--)
929  *byte++ *= 0xff;
930  }
931  }
934 
935  off_t oldSize = ::lseek(fd, 0, SEEK_END);
936  if (oldSize == (off_t)-1)
937  return;
938 
939  Glyph g;
940  g.width = img.width();
941  g.height = img.height();
942  g.bytesPerLine = img.bytesPerLine();
943  g.x = qRound(metrics.x);
944  g.y = qRound(metrics.y);
945  g.advance = qRound(metrics.xoff);
946 
947  QT_WRITE(fd, &g, sizeof(g));
948  QT_WRITE(fd, img.bits(), img.byteCount());
949 
950  glyphPos = oldSize - glyphDataOffset;
951 #if 0 && defined(DEBUG_FONTENGINE)
952  qDebug() << "glyphPos for new glyph" << glyph << "is" << glyphPos << "oldSize" << oldSize << "glyphDataOffset" << glyphDataOffset;
953 #endif
954 
955  quint32 *gmap = (quint32 *)(fontData + glyphMapOffset);
956  gmap[glyph] = qToBigEndian(glyphPos);
957 
958  glyphDataSize = glyphPos + sizeof(g) + img.byteCount();
959  quint32 *blockSizePtr = (quint32 *)(fontData + glyphDataOffset - 4);
960  *blockSizePtr = qToBigEndian(glyphDataSize);
961 }
virtual QImage alphaMapForGlyph(glyph_t)
int byteCount() const
Returns the number of bytes occupied by the image data.
Definition: qimage.cpp:1800
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
Format format() const
Returns the format of the image.
Definition: qimage.cpp:2305
Q_CORE_EXPORT void qDebug(const char *,...)
unsigned char uchar
Definition: qglobal.h:994
T qToBigEndian(T source)
Definition: qendian.h:337
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
int depth() const
Returns the depth of the image.
Definition: qimage.cpp:1620
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)=0
QFontEngine * renderingFontEngine
virtual void removeGlyphFromCache(glyph_t)
const uchar * fontData
uchar * bits()
Returns a pointer to the first pixel data.
Definition: qimage.cpp:1946
int width() const
Returns the width of the image.
Definition: qimage.cpp:1557
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
Definition: qimage.cpp:3966
unsigned int quint32
Definition: qglobal.h:938
int height() const
Returns the height of the image.
Definition: qimage.cpp:1572
#define QT_WRITE
Definition: qcore_unix_p.h:289
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ lockFace()

FT_Face QFontEngineQPF::lockFace ( ) const

Definition at line 812 of file qfontengine_qpf.cpp.

Referenced by doKerning(), and getPointInOutline().

813 {
815  freetype->lock();
816  FT_Face face = freetype->face;
817 
818  // ### not perfect
819  const int ysize = qRound(fontDef.pixelSize * qreal(64));
820  const int xsize = ysize;
821 
822  if (freetype->xsize != xsize || freetype->ysize != ysize) {
823  FT_Set_Char_Size(face, xsize, ysize, 0, 0);
824  freetype->xsize = xsize;
825  freetype->ysize = ysize;
826  }
827  FT_Matrix identityMatrix;
828  identityMatrix.xx = 0x10000;
829  identityMatrix.yy = 0x10000;
830  identityMatrix.xy = 0;
831  identityMatrix.yx = 0;
832  if (freetype->matrix.xx != identityMatrix.xx ||
833  freetype->matrix.yy != identityMatrix.yy ||
834  freetype->matrix.xy != identityMatrix.xy ||
835  freetype->matrix.yx != identityMatrix.yx) {
836  freetype->matrix = identityMatrix;
837  FT_Set_Transform(face, &freetype->matrix, 0);
838  }
839  return face;
840 }
QFreetypeFace * freetype
double qreal
Definition: qglobal.h:1193
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
qreal pixelSize
Definition: qfont_p.h:90
QFontDef fontDef
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ lockFile()

bool QFontEngineQPF::lockFile ( )
private

Definition at line 963 of file qfontengine_qpf.cpp.

Referenced by ensureGlyphsLoaded().

964 {
965  // #### this does not handle the case when the process holding the
966  // lock hangs for some reason
967  struct flock lock;
968  lock.l_type = F_WRLCK;
969  lock.l_whence = SEEK_SET;
970  lock.l_start = 0;
971  lock.l_len = 0; // lock the whole file
972  while (fcntl(fd, F_SETLKW, &lock) != 0) {
973  if (errno == EINTR)
974  continue;
975  perror("locking qpf");
976  return false;
977  }
978  Header *header = (Header *)fontData;
979  if (header->lock) {
980  lock.l_type = F_UNLCK;
981  if (fcntl(fd, F_SETLK, &lock) != 0)
982  perror("unlocking possibly corrupt qpf");
983  return false;
984  }
985 #if defined(Q_WS_QWS)
986  extern int qws_client_id;
987  // qws_client_id == 0 means we're the server. in this case we just
988  // set the id to 1
989  header->lock = qws_client_id ? qws_client_id : 1;
990 #else
991  header->lock = 1;
992 #endif
993  return true;
994 }
int qws_client_id
const uchar * fontData
int fcntl(int, int,...)
static QReadWriteLock lock
Definition: proxyconf.cpp:399
int errno

◆ maxCharWidth()

qreal QFontEngineQPF::maxCharWidth ( ) const
virtual

Implements QFontEngine.

Definition at line 752 of file qfontengine_qpf.cpp.

753 {
755 }
double qreal
Definition: qglobal.h:1193
const uchar * fontData
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ minLeftBearing()

qreal QFontEngineQPF::minLeftBearing ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 757 of file qfontengine_qpf.cpp.

758 {
760 }
double qreal
Definition: qglobal.h:1193
const uchar * fontData
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ minRightBearing()

qreal QFontEngineQPF::minRightBearing ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 762 of file qfontengine_qpf.cpp.

763 {
765 }
double qreal
Definition: qglobal.h:1193
const uchar * fontData
T value() const
Returns the stored value converted to the template type T.
Definition: qvariant.h:332
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ name()

const char* QFontEngineQPF::name ( ) const
inlinevirtual

Implements QFontEngine.

Definition at line 195 of file qfontengine_qpf_p.h.

195 { return "QPF2"; }

◆ recalcAdvances()

void QFontEngineQPF::recalcAdvances ( QGlyphLayout ,
QTextEngine::ShaperFlags   
) const
virtual

This is a callback from harfbuzz. The font engine uses the font-system in use to find out the advances of each glyph and set it on the layout.

Reimplemented from QFontEngine.

Definition at line 608 of file qfontengine_qpf.cpp.

Referenced by stringToCMap().

609 {
610 #ifndef QT_NO_FREETYPE
611  const_cast<QFontEngineQPF *>(this)->ensureGlyphsLoaded(*glyphs);
612 #endif
613  for (int i = 0; i < glyphs->numGlyphs; ++i) {
614  const Glyph *g = findGlyph(glyphs->glyphs[i]);
615  if (!g) {
616  glyphs->glyphs[i] = 0;
617  continue;
618  }
619  glyphs->advances_x[i] = g->advance;
620  glyphs->advances_y[i] = 0;
621  }
622 }
void ensureGlyphsLoaded(const QGlyphLayout &glyphs)
const Glyph * findGlyph(glyph_t g) const

◆ remapFontData()

void QFontEngineQPF::remapFontData ( )
private

Definition at line 1012 of file qfontengine_qpf.cpp.

Referenced by findGlyph(), and unlockFile().

1013 {
1014  off_t newFileSize = ::lseek(fd, 0, SEEK_END);
1015  if (newFileSize == (off_t)-1) {
1016 #ifdef DEBUG_FONTENGINE
1017  perror("QFontEngineQPF::remapFontData: lseek failed");
1018 #endif
1019  fontData = 0;
1020  return;
1021  }
1022 
1023 #ifndef QT_NO_MREMAP
1024  fontData = static_cast<uchar *>(::mremap(const_cast<uchar *>(fontData), dataSize, newFileSize, MREMAP_MAYMOVE));
1025  if (!fontData || fontData == (const uchar *)MAP_FAILED) {
1026 # if defined(DEBUG_FONTENGINE)
1027  perror("QFontEngineQPF::remapFontData(): mremap failed");
1028 # endif
1029  fontData = 0;
1030  }
1031 
1032  if (!fontData)
1033 #endif // QT_NO_MREMAP
1034  {
1035  int status = ::munmap((void *)fontData, dataSize);
1036  if (status != 0)
1037  qErrnoWarning(status, "QFontEngineQPF::remapFomrData: munmap failed!");
1038 
1039  fontData = (const uchar *)::mmap(0, newFileSize, PROT_READ | (renderingFontEngine ? PROT_WRITE : 0),
1040  MAP_SHARED, fd, 0);
1041  if (!fontData || fontData == (const uchar *)MAP_FAILED) {
1042 # if defined(DEBUG_FONTENGINE)
1043  perror("mmap failed");
1044 # endif
1045  fontData = 0;
1046  return;
1047  }
1048  }
1049 
1050  dataSize = newFileSize;
1051  glyphDataSize = newFileSize - glyphDataOffset;
1052 #if defined(DEBUG_FONTENGINE)
1053  qDebug() << "remapped the font file to" << newFileSize << "bytes";
1054 #endif
1055 }
#define MAP_FAILED
static LibLoadStatus status
Definition: qlocale_icu.cpp:69
Q_CORE_EXPORT void qDebug(const char *,...)
unsigned char uchar
Definition: qglobal.h:994
QFontEngine * renderingFontEngine
const uchar * fontData
void qErrnoWarning(const char *msg,...)
Definition: qglobal.cpp:2954

◆ renderingEngine()

QFontEngine* QFontEngineQPF::renderingEngine ( ) const
inline

Definition at line 217 of file qfontengine_qpf_p.h.

217 { return renderingFontEngine; }
QFontEngine * renderingFontEngine

◆ stringToCMap()

bool QFontEngineQPF::stringToCMap ( const QChar str,
int  len,
QGlyphLayout glyphs,
int *  nglyphs,
QTextEngine::ShaperFlags  flags 
) const
virtual

Implements QFontEngine.

Definition at line 553 of file qfontengine_qpf.cpp.

554 {
556  if (!renderingFontEngine->stringToCMap(str, len, glyphs, nglyphs, flags))
557  return false;
558 #ifndef QT_NO_FREETYPE
559  const_cast<QFontEngineQPF *>(this)->ensureGlyphsLoaded(*glyphs);
560 #endif
561  return true;
562  }
563 
564  if (*nglyphs < len) {
565  *nglyphs = len;
566  return false;
567  }
568 
569 #if defined(DEBUG_FONTENGINE)
570  QSet<QChar> seenGlyphs;
571 #endif
572 
574 
575  bool mirrored = flags & QTextEngine::RightToLeft;
576  int glyph_pos = 0;
577  if (symbol) {
578  for (int i = 0; i < len; ++i) {
579  unsigned int uc = getChar(str, i, len);
580  glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc);
581  if(!glyphs->glyphs[glyph_pos] && uc < 0x100)
582  glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc + 0xf000);
583  ++glyph_pos;
584  }
585  } else {
586  for (int i = 0; i < len; ++i) {
587  unsigned int uc = getChar(str, i, len);
588  if (mirrored)
589  uc = QChar::mirroredChar(uc);
590  glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc);
591 #if 0 && defined(DEBUG_FONTENGINE)
592  QChar c(uc);
593  if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c))
594  qDebug() << "glyph for character" << c << '/' << hex << uc << "is" << dec << glyphs[glyph_pos].glyph;
595 
596  seenGlyphs.insert(c);
597 #endif
598  ++glyph_pos;
599  }
600  }
601 
602  *nglyphs = glyph_pos;
603  glyphs->numGlyphs = glyph_pos;
604  recalcAdvances(glyphs, flags);
605  return true;
606 }
void ensureGlyphsLoaded(const QGlyphLayout &glyphs)
unsigned char c[8]
Definition: qnumeric_p.h:62
HB_Glyph * glyphs
static QColor cmap[256]
Definition: qgl_mac.mm:760
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const =0
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
Q_CORE_EXPORT QTextStream & hex(QTextStream &s)
Q_CORE_EXPORT QTextStream & dec(QTextStream &s)
static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode)
Q_CORE_EXPORT void qDebug(const char *,...)
unsigned char uchar
Definition: qglobal.h:994
void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
bool contains(const T &value) const
Definition: qset.h:91
QChar mirroredChar() const
Returns the mirrored character if this character is a mirrored character; otherwise returns the chara...
Definition: qchar.cpp:1016
const_iterator insert(const T &value)
Definition: qset.h:179
QFontEngine * renderingFontEngine
const Glyph * findGlyph(glyph_t g) const
const uchar * fontData
const uchar * externalCMap
static unsigned int getChar(const QChar *str, int &i, const int len)

◆ takeRenderingEngine()

QFontEngine* QFontEngineQPF::takeRenderingEngine ( )
inline

Definition at line 219 of file qfontengine_qpf_p.h.

Referenced by loadSingleEngine().

220  {
223  return engine;
224  }
QFontEngine * renderingFontEngine

◆ type()

QFontEngine::Type QFontEngineQPF::type ( ) const
virtual

Implements QFontEngine.

Definition at line 777 of file qfontengine_qpf.cpp.

778 {
779  return QFontEngine::QPF2;
780 }

◆ underlinePosition()

QFixed QFontEngineQPF::underlinePosition ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 767 of file qfontengine_qpf.cpp.

768 {
770 }
static QFixed fromReal(qreal r)
Definition: qfixed_p.h:70
const uchar * fontData
static QVariant extractHeaderField(const uchar *data, HeaderTag tag)

◆ unlockFace()

void QFontEngineQPF::unlockFace ( ) const

Definition at line 842 of file qfontengine_qpf.cpp.

Referenced by doKerning(), and getPointInOutline().

843 {
844  freetype->unlock();
845 }
QFreetypeFace * freetype

◆ unlockFile()

void QFontEngineQPF::unlockFile ( )
private

Definition at line 996 of file qfontengine_qpf.cpp.

Referenced by ensureGlyphsLoaded().

997 {
998  ((Header *)fontData)->lock = 0;
999 
1000  struct flock lock;
1001  lock.l_type = F_UNLCK;
1002  lock.l_whence = SEEK_SET;
1003  lock.l_start = 0;
1004  lock.l_len = 0; // lock the whole file
1005  if (fcntl(fd, F_SETLK, &lock) != 0) {
1006  perror("unlocking qpf");
1007  }
1008 
1009  remapFontData();
1010 }
const uchar * fontData
int fcntl(int, int,...)
static QReadWriteLock lock
Definition: proxyconf.cpp:399

◆ verifyHeader()

bool QFontEngineQPF::verifyHeader ( const uchar data,
int  size 
)
static

Definition at line 173 of file qfontengine_qpf.cpp.

Referenced by QFontDatabasePrivate::addQPF2File(), and QFontEngineQPF().

174 {
175  VERIFY(size >= int(sizeof(Header)));
176  const Header *header = reinterpret_cast<const Header *>(data);
177  if (header->magic[0] != 'Q'
178  || header->magic[1] != 'P'
179  || header->magic[2] != 'F'
180  || header->magic[3] != '2')
181  return false;
182 
183  VERIFY(header->majorVersion <= CurrentMajorVersion);
184  const quint16 dataSize = qFromBigEndian<quint16>(header->dataSize);
185  VERIFY(size >= int(sizeof(Header)) + dataSize);
186 
187  const uchar *tagPtr = data + sizeof(Header);
188  const uchar *tagEndPtr = tagPtr + dataSize;
189  while (tagPtr < tagEndPtr - 3) {
190  tagPtr = verifyTag(tagPtr, tagEndPtr);
191  VERIFY(tagPtr);
192  }
193 
194  VERIFY(tagPtr <= tagEndPtr);
195  return true;
196 }
static const uchar * verifyTag(const uchar *tagPtr, const uchar *endPtr)
unsigned char uchar
Definition: qglobal.h:994
unsigned short quint16
Definition: qglobal.h:936
static const char * data(const QByteArray &arr)
quint16 qFromBigEndian< quint16 >(const uchar *src)
Definition: qendian.h:249
#define VERIFY(condition)

Properties

◆ cmapOffset

quint32 QFontEngineQPF::cmapOffset
private

Definition at line 239 of file qfontengine_qpf_p.h.

Referenced by canRender(), isValid(), QFontEngineQPF(), and stringToCMap().

◆ cmapSize

int QFontEngineQPF::cmapSize
private

Definition at line 240 of file qfontengine_qpf_p.h.

Referenced by QFontEngineQPF().

◆ dataSize

int QFontEngineQPF::dataSize
private

◆ encodedFileName

QByteArray QFontEngineQPF::encodedFileName
private

Definition at line 246 of file qfontengine_qpf_p.h.

Referenced by QFontEngineQPF(), and ~QFontEngineQPF().

◆ externalCMap

const uchar* QFontEngineQPF::externalCMap
private

Definition at line 238 of file qfontengine_qpf_p.h.

Referenced by canRender(), isValid(), QFontEngineQPF(), and stringToCMap().

◆ face_id

FaceId QFontEngineQPF::face_id
private

Definition at line 250 of file qfontengine_qpf_p.h.

Referenced by QFontEngineQPF(), and ~QFontEngineQPF().

◆ fd

int QFontEngineQPF::fd
private

◆ fileName

QString QFontEngineQPF::fileName
private

Definition at line 245 of file qfontengine_qpf_p.h.

Referenced by cleanUpAfterClientCrash(), and QFontEngineQPF().

◆ fontData

const uchar* QFontEngineQPF::fontData
private

◆ freetype

QFreetypeFace* QFontEngineQPF::freetype
private

◆ freetypeCMapTable

QByteArray QFontEngineQPF::freetypeCMapTable
private

Definition at line 251 of file qfontengine_qpf_p.h.

Referenced by QFontEngineQPF().

◆ glyphDataOffset

quint32 QFontEngineQPF::glyphDataOffset
private

Definition at line 243 of file qfontengine_qpf_p.h.

Referenced by findGlyph(), isValid(), loadGlyph(), QFontEngineQPF(), and remapFontData().

◆ glyphDataSize

quint32 QFontEngineQPF::glyphDataSize
private

Definition at line 244 of file qfontengine_qpf_p.h.

Referenced by findGlyph(), isValid(), loadGlyph(), QFontEngineQPF(), and remapFontData().

◆ glyphMapEntries

quint32 QFontEngineQPF::glyphMapEntries
private

Definition at line 242 of file qfontengine_qpf_p.h.

Referenced by findGlyph(), and QFontEngineQPF().

◆ glyphMapOffset

quint32 QFontEngineQPF::glyphMapOffset
private

Definition at line 241 of file qfontengine_qpf_p.h.

Referenced by findGlyph(), isValid(), loadGlyph(), and QFontEngineQPF().

◆ kerning_pairs_loaded

bool QFontEngineQPF::kerning_pairs_loaded
mutableprivate

Definition at line 252 of file qfontengine_qpf_p.h.

Referenced by doKerning(), and QFontEngineQPF().

◆ readOnly

bool QFontEngineQPF::readOnly
private

Definition at line 247 of file qfontengine_qpf_p.h.

Referenced by ensureGlyphsLoaded(), and QFontEngineQPF().

◆ renderingFontEngine

QFontEngine* QFontEngineQPF::renderingFontEngine
private

The documentation for this class was generated from the following files: