Qt 4.8
Classes | Public Types | Public Functions | Protected Functions | Protected Variables | Private Functions | Properties | Friends | List of all members
QFontEngineFT Class Reference

#include <qfontengine_ft_p.h>

Inheritance diagram for QFontEngineFT:
QFontEngine QObject QFontEngineX11FT QFontEngineFTRawFont

Classes

struct  Glyph
 
struct  GlyphAndSubPixelPosition
 
struct  QGlyphSet
 

Public Types

typedef XGlyphInfo GlyphInfo
 
enum  HintStyle { HintNone, HintLight, HintMedium, HintFull }
 
enum  Scaling { Scaled, Unscaled }
 
enum  SubpixelAntialiasingType {
  Subpixel_None, Subpixel_RGB, Subpixel_BGR, Subpixel_VRGB,
  Subpixel_VBGR
}
 
- 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

virtual void addGlyphsToPath (glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
 
virtual void addOutlineToPath (qreal x, qreal y, const QGlyphLayout &glyphs, QPainterPath *path, QTextItem::RenderFlags flags)
 
virtual glyph_metrics_t alphaMapBoundingBox (glyph_t glyph, QFixed subPixelPosition, const QTransform &matrix, QFontEngine::GlyphFormat format)
 
virtual QImage alphaMapForGlyph (glyph_t g)
 
virtual QImage alphaMapForGlyph (glyph_t, QFixed)
 
virtual QImage alphaRGBMapForGlyph (glyph_t, QFixed subPixelPosition, int margin, const QTransform &t)
 
virtual QFixed ascent () const
 
virtual QFixed averageCharWidth () const
 
virtual glyph_metrics_t boundingBox (const QGlyphLayout &glyphs)
 
virtual glyph_metrics_t boundingBox (glyph_t glyph)
 
virtual glyph_metrics_t boundingBox (glyph_t glyph, const QTransform &matrix)
 
GlyphcachedGlyph (glyph_t g) const
 
virtual bool canRender (const QChar *string, int len)
 
virtual QFontEnginecloneWithSize (qreal pixelSize) const
 
GlyphFormat defaultGlyphFormat () const
 
QGlyphSetdefaultGlyphs ()
 
HintStyle defaultHintStyle () const
 
virtual QFixed descent () const
 
void doKerning (QGlyphLayout *, QTextEngine::ShaperFlags) const
 
virtual void draw (QPaintEngine *, qreal, qreal, const QTextItemInt &)
 
bool drawAntialiased () const
 
virtual QFixed emSquareSize () const
 
virtual QFontEngine::FaceId faceId () const
 
virtual HB_Error getPointInOutline (HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
 
virtual bool getSfntTableData (uint tag, uchar *buffer, uint *length) const
 
virtual void getUnscaledGlyph (glyph_t glyph, QPainterPath *path, glyph_metrics_t *metrics)
 
virtual int glyphCount () const
 
bool init (FaceId faceId, bool antiaalias, GlyphFormat defaultFormat=Format_None, const QByteArray &fontData=QByteArray())
 
bool init (FaceId faceId, bool antialias, GlyphFormat format, QFreetypeFace *freetypeFace)
 
bool initFromFontEngine (const QFontEngineFT *fontEngine)
 
bool invalid () const
 
bool isBitmapFont () const
 
virtual QFixed leading () const
 
virtual QFixed lineThickness () const
 
GlyphloadGlyph (uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const
 
GlyphloadGlyph (QGlyphSet *set, uint glyph, QFixed subPixelPosition, GlyphFormat=Format_None, bool fetchMetricsOnly=false) const
 
bool loadGlyphs (QGlyphSet *gs, const glyph_t *glyphs, int num_glyphs, const QFixedPoint *positions, GlyphFormat format=Format_Render)
 
QGlyphSetloadTransformedGlyphSet (const QTransform &matrix)
 
FT_Face lockFace (Scaling scale=Scaled) const
 
virtual qreal maxCharWidth () const
 
virtual qreal minLeftBearing () const
 
virtual qreal minRightBearing () const
 
virtual const char * name () const
 
FT_Face non_locked_face () const
 
virtual QFontEngine::Properties properties () const
 
 QFontEngineFT (const QFontDef &fd)
 
virtual void recalcAdvances (QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
 
virtual void removeGlyphFromCache (glyph_t glyph)
 
void setDefaultHintStyle (HintStyle style)
 
virtual bool stringToCMap (const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
 
QFixed subPixelPositionForX (QFixed x)
 
virtual bool supportsSubPixelPositions () const
 
virtual int synthesized () const
 
virtual Type type () const
 
virtual QFixed underlinePosition () const
 
void unlockFace () const
 
virtual QFixed xHeight () const
 
virtual ~QFontEngineFT ()
 
- Public Functions inherited from QFontEngine
void addBitmapFontToPath (qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)
 
virtual QImage alphaMapForGlyph (glyph_t, const QTransform &t)
 
virtual QImage alphaMapForGlyph (glyph_t, QFixed subPixelPosition, const QTransform &t)
 
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
 
QFontEngineGlyphCacheglyphCache (void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const
 
HB_Face harfbuzzFace () const
 
HB_Font harfbuzzFont () const
 
void loadKerningPairs (QFixed scalingFactor)
 
 QFontEngine ()
 
void setGlyphCache (void *key, QFontEngineGlyphCache *data)
 
glyph_metrics_t tightBoundingBox (const QGlyphLayout &glyphs)
 
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...
 

Protected Functions

virtual unsigned long allocateServerGlyphSet ()
 
void freeGlyphSets ()
 
virtual void freeServerGlyphSet (unsigned long id)
 
virtual bool uploadGlyphToServer (QGlyphSet *set, uint glyphid, Glyph *g, GlyphInfo *info, int glyphDataSize) const
 
- 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...
 

Protected Variables

bool antialias
 
bool canUploadGlyphsToServer
 
HintStyle default_hint_style
 
int default_load_flags
 
bool embeddedbitmap
 
bool embolden
 
QFreetypeFacefreetype
 
int lcdFilterType
 
SubpixelAntialiasingType subpixelType
 
bool transform
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 

Private Functions

int loadFlags (QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const
 

Properties

GlyphFormat defaultFormat
 
QGlyphSet defaultGlyphSet
 
QFontEngine::FaceId face_id
 
bool kerning_pairs_loaded
 
QFixed lbearing
 
QFixed line_thickness
 
FT_Matrix matrix
 
FT_Size_Metrics metrics
 
QFixed rbearing
 
QList< QGlyphSettransformedGlyphSets
 
QFixed underline_position
 
int xsize
 
int ysize
 

Friends

class QFontEngineFTRawFont
 

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...
 
- 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)
 
- 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...
 
- Static Protected Functions inherited from QFontEngine
static const QVector< QRgb > & grayPalette ()
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

Definition at line 134 of file qfontengine_ft_p.h.

Typedefs

◆ GlyphInfo

typedef XGlyphInfo QFontEngineFT::GlyphInfo

Definition at line 161 of file qfontengine_ft_p.h.

Enumerations

◆ HintStyle

Enumerator
HintNone 
HintLight 
HintMedium 
HintFull 

Definition at line 309 of file qfontengine_ft_p.h.

◆ Scaling

Enumerator
Scaled 
Unscaled 

Definition at line 267 of file qfontengine_ft_p.h.

◆ SubpixelAntialiasingType

Enumerator
Subpixel_None 
Subpixel_RGB 
Subpixel_BGR 
Subpixel_VRGB 
Subpixel_VBGR 

Definition at line 152 of file qfontengine_ft_p.h.

Constructors and Destructors

◆ QFontEngineFT()

QFontEngineFT::QFontEngineFT ( const QFontDef fd)

Definition at line 624 of file qfontengine_ft.cpp.

Referenced by cloneWithSize().

625 {
626  fontDef = fd;
627  matrix.xx = 0x10000;
628  matrix.yy = 0x10000;
629  matrix.xy = 0;
630  matrix.yx = 0;
631  cache_cost = 100;
632  kerning_pairs_loaded = false;
633  transform = false;
634  embolden = false;
635  antialias = true;
636  freetype = 0;
637  default_load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH;
640  lcdFilterType = 0;
641 #if defined(FT_LCD_FILTER_H)
642  lcdFilterType = (int)((quintptr) FT_LCD_FILTER_DEFAULT);
643 #endif
645  canUploadGlyphsToServer = false;
646  embeddedbitmap = false;
647 }
SubpixelAntialiasingType subpixelType
QIntegerForSizeof< void * >::Unsigned quintptr
Definition: qglobal.h:986
GlyphFormat defaultFormat
HintStyle default_hint_style
bool canUploadGlyphsToServer
QFreetypeFace * freetype
QFontDef fontDef

◆ ~QFontEngineFT()

QFontEngineFT::~QFontEngineFT ( )
virtual

Definition at line 649 of file qfontengine_ft.cpp.

650 {
651  if (freetype)
653  hbFace = 0; // we share the face in QFreeTypeFace, don't let ~QFontEngine delete it
654 }
HB_Face hbFace
void release(const QFontEngine::FaceId &face_id)
QFontEngine::FaceId face_id
QFreetypeFace * freetype

Functions

◆ addGlyphsToPath()

void QFontEngineFT::addGlyphsToPath ( glyph_t glyphs,
QFixedPoint positions,
int  nglyphs,
QPainterPath path,
QTextItem::RenderFlags  flags 
)
virtual

Reimplemented from QFontEngine.

Definition at line 1483 of file qfontengine_ft.cpp.

1485 {
1486  FT_Face face = lockFace(Unscaled);
1487 
1488  for (int gl = 0; gl < numGlyphs; gl++) {
1489  FT_UInt glyph = glyphs[gl];
1490 
1491  FT_Load_Glyph(face, glyph, FT_LOAD_NO_BITMAP);
1492 
1493  FT_GlyphSlot g = face->glyph;
1494  if (g->format != FT_GLYPH_FORMAT_OUTLINE)
1495  continue;
1496  QFreetypeFace::addGlyphToPath(face, g, positions[gl], path, xsize, ysize);
1497  }
1498  unlockFace();
1499 }
static void addGlyphToPath(FT_Face face, FT_GlyphSlot g, const QFixedPoint &point, QPainterPath *path, FT_Fixed x_scale, FT_Fixed y_scale)
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
void unlockFace() const
FT_Face lockFace(Scaling scale=Scaled) const

◆ addOutlineToPath()

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

Reimplemented from QFontEngine.

Definition at line 1459 of file qfontengine_ft.cpp.

1460 {
1461  if (!glyphs.numGlyphs)
1462  return;
1463 
1464  if (FT_IS_SCALABLE(freetype->face)) {
1465  QFontEngine::addOutlineToPath(x, y, glyphs, path, flags);
1466  } else {
1468  QVarLengthArray<glyph_t> positioned_glyphs;
1470  matrix.translate(x, y);
1471  getGlyphPositions(glyphs, matrix, flags, positioned_glyphs, positions);
1472 
1473  FT_Face face = lockFace(Unscaled);
1474  for (int gl = 0; gl < glyphs.numGlyphs; gl++) {
1475  FT_UInt glyph = positioned_glyphs[gl];
1476  FT_Load_Glyph(face, glyph, FT_LOAD_TARGET_MONO);
1477  freetype->addBitmapToPath(face->glyph, positions[gl], path);
1478  }
1479  unlockFace();
1480  }
1481 }
virtual void addOutlineToPath(qreal, qreal, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags flags)
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
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
static const QCssKnownValue positions[NumKnownPositionModes - 1]
Definition: qcssparser.cpp:329
void unlockFace() const
static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool=false)
void getGlyphPositions(const QGlyphLayout &glyphs, const QTransform &matrix, QTextItem::RenderFlags flags, QVarLengthArray< glyph_t > &glyphs_out, QVarLengthArray< QFixedPoint > &positions)
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

◆ allocateServerGlyphSet()

unsigned long QFontEngineFT::allocateServerGlyphSet ( )
protectedvirtual

Reimplemented in QFontEngineX11FT.

Definition at line 1954 of file qfontengine_ft.cpp.

1955 {
1956  return 0;
1957 }

◆ alphaMapBoundingBox()

glyph_metrics_t QFontEngineFT::alphaMapBoundingBox ( glyph_t  glyph,
QFixed  subPixelPosition,
const QTransform matrix,
QFontEngine::GlyphFormat  format 
)
virtual

Reimplemented from QFontEngine.

Definition at line 1713 of file qfontengine_ft.cpp.

1714 {
1715  FT_Face face = 0;
1716  glyph_metrics_t overall;
1717  QGlyphSet *glyphSet = 0;
1718  if (matrix.type() > QTransform::TxTranslate && FT_IS_SCALABLE(freetype->face)) {
1719  // TODO move everything here to a method of its own to access glyphSets
1720  // to be shared with a new method that will replace loadTransformedGlyphSet()
1721  FT_Matrix m;
1722  m.xx = FT_Fixed(matrix.m11() * 65536);
1723  m.xy = FT_Fixed(-matrix.m21() * 65536);
1724  m.yx = FT_Fixed(-matrix.m12() * 65536);
1725  m.yy = FT_Fixed(matrix.m22() * 65536);
1726  for (int i = 0; i < transformedGlyphSets.count(); ++i) {
1727  const QGlyphSet &g = transformedGlyphSets.at(i);
1728  if (g.transformationMatrix.xx == m.xx
1729  && g.transformationMatrix.xy == m.xy
1730  && g.transformationMatrix.yx == m.yx
1731  && g.transformationMatrix.yy == m.yy) {
1732 
1733  // found a match, move it to the front
1734  transformedGlyphSets.move(i, 0);
1735  glyphSet = &transformedGlyphSets[0];
1736  break;
1737  }
1738  }
1739 
1740  if (!glyphSet) {
1741  // don't cache more than 10 transformations
1742  if (transformedGlyphSets.count() >= 10) {
1743  transformedGlyphSets.move(transformedGlyphSets.size() - 1, 0);
1745  } else {
1746  transformedGlyphSets.prepend(QGlyphSet());
1747  }
1748  glyphSet = &transformedGlyphSets[0];
1749  glyphSet->clear();
1750  glyphSet->id = allocateServerGlyphSet();
1751  glyphSet->transformationMatrix = m;
1752  }
1753  Q_ASSERT(glyphSet);
1754  } else {
1755  glyphSet = &defaultGlyphSet;
1756  }
1757  Glyph * g = glyphSet->getGlyph(glyph);
1758  if (!g || g->format != format) {
1759  face = lockFace();
1760  FT_Matrix m = this->matrix;
1761  FT_Matrix_Multiply(&glyphSet->transformationMatrix, &m);
1762  freetype->matrix = m;
1763  g = loadGlyph(glyphSet, glyph, subPixelPosition, format);
1764  }
1765 
1766  if (g) {
1767  overall.x = g->x;
1768  overall.y = -g->y;
1769  overall.width = g->width;
1770  overall.height = g->height;
1771  overall.xoff = g->advance;
1772  } else {
1773  int left = FLOOR(face->glyph->metrics.horiBearingX);
1774  int right = CEIL(face->glyph->metrics.horiBearingX + face->glyph->metrics.width);
1775  int top = CEIL(face->glyph->metrics.horiBearingY);
1776  int bottom = FLOOR(face->glyph->metrics.horiBearingY - face->glyph->metrics.height);
1777 
1778  overall.width = TRUNC(right-left);
1779  overall.height = TRUNC(top-bottom);
1780  overall.x = TRUNC(left);
1781  overall.y = -TRUNC(top);
1782  overall.xoff = TRUNC(ROUND(face->glyph->advance.x));
1783  }
1784  if (face)
1785  unlockFace();
1786  return overall;
1787 }
QGlyphSet defaultGlyphSet
QList< QGlyphSet > transformedGlyphSets
qreal m21() const
Returns the horizontal shearing factor.
Definition: qtransform.h:249
qreal m22() const
Returns the vertical scaling factor.
Definition: qtransform.h:253
virtual void freeServerGlyphSet(unsigned long id)
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
TransformationType type() const
Returns the transformation type of this matrix.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Glyph * getGlyph(glyph_t index, QFixed subPixelPosition=0) const
#define ROUND(x)
qreal m12() const
Returns the vertical shearing factor.
Definition: qtransform.h:241
virtual unsigned long allocateServerGlyphSet()
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
#define CEIL(x)
void unlockFace() const
#define FLOOR(x)
#define TRUNC(x)
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const
qreal m11() const
Returns the horizontal scaling factor.
Definition: qtransform.h:237

◆ alphaMapForGlyph() [1/2]

virtual QImage QFontEngineFT::alphaMapForGlyph ( glyph_t  glyph)
inlinevirtual

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 256 of file qfontengine_ft_p.h.

Referenced by alphaMapForGlyph().

256 { return alphaMapForGlyph(g, 0); }
virtual QImage alphaMapForGlyph(glyph_t g)

◆ alphaMapForGlyph() [2/2]

QImage QFontEngineFT::alphaMapForGlyph ( glyph_t  g,
QFixed  subPixelPosition 
)
virtual

Reimplemented from QFontEngine.

Definition at line 1789 of file qfontengine_ft.cpp.

1790 {
1791  lockFace();
1792 
1793  GlyphFormat glyph_format = antialias ? Format_A8 : Format_Mono;
1794 
1795  Glyph *glyph = defaultGlyphSet.outline_drawing ? 0 : loadGlyph(g, subPixelPosition, glyph_format);
1796  if (!glyph) {
1797  unlockFace();
1799  }
1800 
1801  const int pitch = antialias ? (glyph->width + 3) & ~3 : ((glyph->width + 31)/32) * 4;
1802 
1803  QImage img(glyph->width, glyph->height, antialias ? QImage::Format_Indexed8 : QImage::Format_Mono);
1804  if (antialias) {
1805  QVector<QRgb> colors(256);
1806  for (int i=0; i<256; ++i)
1807  colors[i] = qRgba(0, 0, 0, i);
1808  img.setColorTable(colors);
1809  } else {
1810  QVector<QRgb> colors(2);
1811  colors[0] = qRgba(0, 0, 0, 0);
1812  colors[1] = qRgba(0, 0, 0, 255);
1813  img.setColorTable(colors);
1814  }
1815  Q_ASSERT(img.bytesPerLine() == pitch);
1816  if (glyph->width) {
1817  for (int y = 0; y < glyph->height; ++y)
1818  memcpy(img.scanLine(y), &glyph->data[y * pitch], pitch);
1819  }
1820  unlockFace();
1821 
1822  return img;
1823 }
QGlyphSet defaultGlyphSet
virtual QImage alphaMapForGlyph(glyph_t)
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_GUI_EXPORT_INLINE QRgb qRgba(int r, int g, int b, int a)
Definition: qrgb.h:72
void unlockFace() const
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
FT_Face lockFace(Scaling scale=Scaled) const
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const

◆ alphaRGBMapForGlyph()

QImage QFontEngineFT::alphaRGBMapForGlyph ( glyph_t  g,
QFixed  subPixelPosition,
int  margin,
const QTransform t 
)
virtual

Reimplemented from QFontEngine.

Definition at line 1825 of file qfontengine_ft.cpp.

1826 {
1827  if (t.type() > QTransform::TxTranslate)
1828  return QFontEngine::alphaRGBMapForGlyph(g, subPixelPosition, margin, t);
1829 
1830  lockFace();
1831 
1832  GlyphFormat glyph_format = Format_A32;
1833 
1834  Glyph *glyph = defaultGlyphSet.outline_drawing ? 0 : loadGlyph(g, subPixelPosition, glyph_format);
1835  if (!glyph) {
1836  unlockFace();
1837  return QFontEngine::alphaRGBMapForGlyph(g, subPixelPosition, margin, t);
1838  }
1839 
1840  QImage img(glyph->width, glyph->height, QImage::Format_RGB32);
1841  memcpy(img.bits(), glyph->data, 4 * glyph->width * glyph->height);
1842  unlockFace();
1843 
1844  return img;
1845 }
QGlyphSet defaultGlyphSet
TransformationType type() const
Returns the transformation type of this matrix.
virtual QImage alphaRGBMapForGlyph(glyph_t, QFixed subPixelPosition, int margin, const QTransform &t)
void unlockFace() const
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
FT_Face lockFace(Scaling scale=Scaled) const
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const

◆ ascent()

QFixed QFontEngineFT::ascent ( ) const
virtual

Implements QFontEngine.

Definition at line 1170 of file qfontengine_ft.cpp.

1171 {
1172  return QFixed::fromFixed(metrics.ascender);
1173 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
FT_Size_Metrics metrics

◆ averageCharWidth()

QFixed QFontEngineFT::averageCharWidth ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1198 of file qfontengine_ft.cpp.

1199 {
1200  TT_OS2 *os2 = (TT_OS2 *)FT_Get_Sfnt_Table(freetype->face, ft_sfnt_os2);
1201  if (os2 && os2->xAvgCharWidth) {
1202  lockFace();
1203  QFixed answer = QFixed(os2->xAvgCharWidth*freetype->face->size->metrics.x_ppem)/freetype->face->units_per_EM;
1204  unlockFace();
1205  return answer;
1206  }
1208 }
virtual QFixed averageCharWidth() const
void unlockFace() const
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype

◆ boundingBox() [1/3]

glyph_metrics_t QFontEngineFT::boundingBox ( const QGlyphLayout glyphs)
virtual

Implements QFontEngine.

Definition at line 1623 of file qfontengine_ft.cpp.

1624 {
1625 
1626  FT_Face face = 0;
1627 
1628  glyph_metrics_t overall;
1629  // initialize with line height, we get the same behaviour on all platforms
1630  overall.y = -ascent();
1631  overall.height = ascent() + descent() + 1;
1632 
1633  QFixed ymax = 0;
1634  QFixed xmax = 0;
1635  for (int i = 0; i < glyphs.numGlyphs; i++) {
1636  Glyph *g = defaultGlyphSet.getGlyph(glyphs.glyphs[i]);
1637  if (!g) {
1638  if (!face)
1639  face = lockFace();
1640  g = loadGlyph(glyphs.glyphs[i], 0, Format_None, true);
1641  }
1642  if (g) {
1643  QFixed x = overall.xoff + glyphs.offsets[i].x + g->x;
1644  QFixed y = overall.yoff + glyphs.offsets[i].y - g->y;
1645  overall.x = qMin(overall.x, x);
1646  overall.y = qMin(overall.y, y);
1647  xmax = qMax(xmax, x + g->width);
1648  ymax = qMax(ymax, y + g->height);
1649  overall.xoff += qRound(g->advance);
1650  } else {
1651  int left = FLOOR(face->glyph->metrics.horiBearingX);
1652  int right = CEIL(face->glyph->metrics.horiBearingX + face->glyph->metrics.width);
1653  int top = CEIL(face->glyph->metrics.horiBearingY);
1654  int bottom = FLOOR(face->glyph->metrics.horiBearingY - face->glyph->metrics.height);
1655 
1656  QFixed x = overall.xoff + glyphs.offsets[i].x - (-TRUNC(left));
1657  QFixed y = overall.yoff + glyphs.offsets[i].y - TRUNC(top);
1658  overall.x = qMin(overall.x, x);
1659  overall.y = qMin(overall.y, y);
1660  xmax = qMax(xmax, x + TRUNC(right - left));
1661  ymax = qMax(ymax, y + TRUNC(top - bottom));
1662  overall.xoff += qRound(TRUNC(ROUND(face->glyph->advance.x)));
1663  }
1664  }
1665  overall.height = qMax(overall.height, ymax - overall.y);
1666  overall.width = xmax - overall.x;
1667 
1668  if (face)
1669  unlockFace();
1670 
1671  return overall;
1672 }
QGlyphSet defaultGlyphSet
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
HB_Glyph * glyphs
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Glyph * getGlyph(glyph_t index, QFixed subPixelPosition=0) const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define ROUND(x)
QFixed y
Definition: qfixed_p.h:191
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
#define CEIL(x)
void unlockFace() const
virtual QFixed ascent() const
#define FLOOR(x)
QFixed x
Definition: qfixed_p.h:190
#define TRUNC(x)
FT_Face lockFace(Scaling scale=Scaled) const
virtual QFixed descent() const
QFixedPoint * offsets
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ boundingBox() [2/3]

glyph_metrics_t QFontEngineFT::boundingBox ( glyph_t  glyph)
virtual

Implements QFontEngine.

Definition at line 1674 of file qfontengine_ft.cpp.

1675 {
1676  FT_Face face = 0;
1677  glyph_metrics_t overall;
1678  Glyph *g = defaultGlyphSet.getGlyph(glyph);
1679  if (!g) {
1680  face = lockFace();
1681  g = loadGlyph(glyph, 0, Format_None, true);
1682  }
1683  if (g) {
1684  overall.x = g->x;
1685  overall.y = -g->y;
1686  overall.width = g->width;
1687  overall.height = g->height;
1688  overall.xoff = g->advance;
1690  overall.xoff = overall.xoff.round();
1691  } else {
1692  int left = FLOOR(face->glyph->metrics.horiBearingX);
1693  int right = CEIL(face->glyph->metrics.horiBearingX + face->glyph->metrics.width);
1694  int top = CEIL(face->glyph->metrics.horiBearingY);
1695  int bottom = FLOOR(face->glyph->metrics.horiBearingY - face->glyph->metrics.height);
1696 
1697  overall.width = TRUNC(right-left);
1698  overall.height = TRUNC(top-bottom);
1699  overall.x = TRUNC(left);
1700  overall.y = -TRUNC(top);
1701  overall.xoff = TRUNC(ROUND(face->glyph->advance.x));
1702  }
1703  if (face)
1704  unlockFace();
1705  return overall;
1706 }
QGlyphSet defaultGlyphSet
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
Glyph * getGlyph(glyph_t index, QFixed subPixelPosition=0) const
#define ROUND(x)
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
#define CEIL(x)
QFixed round() const
Definition: qfixed_p.h:80
void unlockFace() const
#define FLOOR(x)
#define TRUNC(x)
FT_Face lockFace(Scaling scale=Scaled) const
QFontDef fontDef
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
uint styleStrategy
Definition: qfont_p.h:92
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const

◆ boundingBox() [3/3]

glyph_metrics_t QFontEngineFT::boundingBox ( glyph_t  glyph,
const QTransform matrix 
)
virtual

Reimplemented from QFontEngine.

Definition at line 1708 of file qfontengine_ft.cpp.

1709 {
1710  return alphaMapBoundingBox(glyph, 0, matrix, QFontEngine::Format_None);
1711 }
virtual glyph_metrics_t alphaMapBoundingBox(glyph_t glyph, QFixed subPixelPosition, const QTransform &matrix, QFontEngine::GlyphFormat format)

◆ cachedGlyph()

Glyph* QFontEngineFT::cachedGlyph ( glyph_t  g) const
inline

Definition at line 287 of file qfontengine_ft_p.h.

Referenced by QX11PaintEngine::drawFreetype().

287 { return defaultGlyphSet.getGlyph(g, 0); }
QGlyphSet defaultGlyphSet
Glyph * getGlyph(glyph_t index, QFixed subPixelPosition=0) const

◆ canRender()

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

Implements QFontEngine.

Definition at line 1433 of file qfontengine_ft.cpp.

1434 {
1435  FT_Face face = freetype->face;
1436 #if 0
1437  if (_cmap != -1) {
1438  lockFace();
1439  for ( int i = 0; i < len; i++ ) {
1440  unsigned int uc = getChar(string, i, len);
1441  if (!FcCharSetHasChar (_font->charset, uc) && getAdobeCharIndex(face, _cmap, uc) == 0) {
1442  allExist = false;
1443  break;
1444  }
1445  }
1446  unlockFace();
1447  } else
1448 #endif
1449  {
1450  for ( int i = 0; i < len; i++ ) {
1451  unsigned int uc = getChar(string, i, len);
1452  if (!FT_Get_Char_Index(face, uc))
1453  return false;
1454  }
1455  }
1456  return true;
1457 }
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
void unlockFace() const
static unsigned int getChar(const QChar *str, int &i, const int len)
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype

◆ cloneWithSize()

QFontEngine * QFontEngineFT::cloneWithSize ( qreal  pixelSize) const
virtual

Reimplemented from QFontEngine.

Reimplemented in QFontEngineX11FT.

Definition at line 1997 of file qfontengine_ft.cpp.

1998 {
1999  QFontDef fontDef;
2000  fontDef.pixelSize = pixelSize;
2001  QFontEngineFT *fe = new QFontEngineFT(fontDef);
2002  if (!fe->initFromFontEngine(this)) {
2003  delete fe;
2004  return 0;
2005  } else {
2006  return fe;
2007  }
2008 }
QFontEngineFT(const QFontDef &fd)
static float pixelSize(const QFontDef &request, int dpi)
Definition: qfont_win.cpp:80
qreal pixelSize
Definition: qfont_p.h:90
bool initFromFontEngine(const QFontEngineFT *fontEngine)
QFontDef fontDef

◆ defaultGlyphFormat()

GlyphFormat QFontEngineFT::defaultGlyphFormat ( ) const
inline

Definition at line 285 of file qfontengine_ft_p.h.

Referenced by QRasterPaintEngine::drawCachedGlyphs().

285 { return defaultFormat; }
GlyphFormat defaultFormat

◆ defaultGlyphs()

QGlyphSet* QFontEngineFT::defaultGlyphs ( )
inline

◆ defaultHintStyle()

HintStyle QFontEngineFT::defaultHintStyle ( ) const
inline

Definition at line 321 of file qfontengine_ft_p.h.

Referenced by QTextLine::glyphs().

321 { return default_hint_style; }
HintStyle default_hint_style

◆ descent()

QFixed QFontEngineFT::descent ( ) const
virtual

Implements QFontEngine.

Definition at line 1175 of file qfontengine_ft.cpp.

1176 {
1177  // subtract a pixel to work around QFontMetrics's built-in + 1
1178  return QFixed::fromFixed(-metrics.descender - 64);
1179 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
FT_Size_Metrics metrics

◆ doKerning()

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

Reimplemented from QFontEngine.

Definition at line 1275 of file qfontengine_ft.cpp.

1276 {
1277  if (!kerning_pairs_loaded) {
1278  kerning_pairs_loaded = true;
1279  lockFace();
1280  if (freetype->face->size->metrics.x_ppem != 0) {
1281  QFixed scalingFactor(freetype->face->units_per_EM/freetype->face->size->metrics.x_ppem);
1282  unlockFace();
1283  const_cast<QFontEngineFT *>(this)->loadKerningPairs(scalingFactor);
1284  } else {
1285  unlockFace();
1286  }
1287  }
1288  QFontEngine::doKerning(g, flags);
1289 }
virtual void doKerning(QGlyphLayout *, QTextEngine::ShaperFlags) const
void unlockFace() const
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype
void loadKerningPairs(QFixed scalingFactor)

◆ draw()

virtual void QFontEngineFT::draw ( QPaintEngine ,
qreal  ,
qreal  ,
const QTextItemInt  
)
inlinevirtual

Definition at line 296 of file qfontengine_ft_p.h.

296 {}

◆ drawAntialiased()

bool QFontEngineFT::drawAntialiased ( ) const
inline

Definition at line 276 of file qfontengine_ft_p.h.

Referenced by qgl_use_font().

276 { return antialias; }

◆ emSquareSize()

QFixed QFontEngineFT::emSquareSize ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1145 of file qfontengine_ft.cpp.

1146 {
1147  if (FT_IS_SCALABLE(freetype->face))
1148  return freetype->face->units_per_EM;
1149  else
1150  return freetype->face->size->metrics.y_ppem;
1151 }
QFreetypeFace * freetype

◆ faceId()

QFontEngine::FaceId QFontEngineFT::faceId ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1130 of file qfontengine_ft.cpp.

Referenced by QFontEngineFTRawFont::initFromData(), and initFromFontEngine().

1131 {
1132  return face_id;
1133 }
QFontEngine::FaceId face_id

◆ freeGlyphSets()

void QFontEngineFT::freeGlyphSets ( )
protected

Definition at line 656 of file qfontengine_ft.cpp.

Referenced by QFontEngineX11FT::~QFontEngineX11FT().

657 {
659  for (int i = 0; i < transformedGlyphSets.count(); ++i)
661 }
QGlyphSet defaultGlyphSet
QList< QGlyphSet > transformedGlyphSets
virtual void freeServerGlyphSet(unsigned long id)

◆ freeServerGlyphSet()

void QFontEngineFT::freeServerGlyphSet ( unsigned long  id)
protectedvirtual

Reimplemented in QFontEngineX11FT.

Definition at line 1959 of file qfontengine_ft.cpp.

1960 {
1961  Q_UNUSED(id);
1962 }
#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

◆ getPointInOutline()

HB_Error QFontEngineFT::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 1964 of file qfontengine_ft.cpp.

1965 {
1966  lockFace();
1967  bool hsubpixel = true;
1968  int vfactor = 1;
1969  int load_flags = loadFlags(0, Format_A8, flags, hsubpixel, vfactor);
1970  HB_Error result = freetype->getPointInOutline(glyph, load_flags, point, xpos, ypos, nPoints);
1971  unlockFace();
1972  return result;
1973 }
HB_Error getPointInOutline(HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
void unlockFace() const
FT_Face lockFace(Scaling scale=Scaled) const
int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const
QFreetypeFace * freetype

◆ getSfntTableData()

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

Reimplemented from QFontEngine.

Definition at line 1153 of file qfontengine_ft.cpp.

1154 {
1155  return freetype->getSfntTable(tag, buffer, length);
1156 }
bool getSfntTable(uint tag, uchar *buffer, uint *length) const
QFreetypeFace * freetype

◆ getUnscaledGlyph()

void QFontEngineFT::getUnscaledGlyph ( glyph_t  glyph,
QPainterPath path,
glyph_metrics_t metrics 
)
virtual

Reimplemented from QFontEngine.

Definition at line 1393 of file qfontengine_ft.cpp.

1394 {
1395  FT_Face face = lockFace(Unscaled);
1396  FT_Set_Transform(face, 0, 0);
1397  FT_Load_Glyph(face, glyph, FT_LOAD_NO_BITMAP);
1398 
1399  int left = face->glyph->metrics.horiBearingX;
1400  int right = face->glyph->metrics.horiBearingX + face->glyph->metrics.width;
1401  int top = face->glyph->metrics.horiBearingY;
1402  int bottom = face->glyph->metrics.horiBearingY - face->glyph->metrics.height;
1403 
1404  QFixedPoint p;
1405  p.x = 0;
1406  p.y = 0;
1407 
1408  metrics->width = QFixed::fromFixed(right-left);
1409  metrics->height = QFixed::fromFixed(top-bottom);
1410  metrics->x = QFixed::fromFixed(left);
1411  metrics->y = QFixed::fromFixed(-top);
1412  metrics->xoff = QFixed::fromFixed(face->glyph->advance.x);
1413 
1414  if (!FT_IS_SCALABLE(freetype->face))
1415  QFreetypeFace::addBitmapToPath(face->glyph, p, path);
1416  else
1417  QFreetypeFace::addGlyphToPath(face, face->glyph, p, path, face->units_per_EM << 6, face->units_per_EM << 6);
1418 
1419  FT_Set_Transform(face, &freetype->matrix, 0);
1420  unlockFace();
1421 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
static void addGlyphToPath(FT_Face face, FT_GlyphSlot g, const QFixedPoint &point, QPainterPath *path, FT_Fixed x_scale, FT_Fixed y_scale)
QFixed y
Definition: qfixed_p.h:191
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
void unlockFace() const
static void addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, QPainterPath *path, bool=false)
QFixed x
Definition: qfixed_p.h:190
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype
Q_CORE_EXPORT QTextStream & left(QTextStream &s)

◆ glyphCount()

int QFontEngineFT::glyphCount ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1852 of file qfontengine_ft.cpp.

1853 {
1854  int count = 0;
1855  FT_Face face = lockFace();
1856  if (face) {
1857  count = face->num_glyphs;
1858  unlockFace();
1859  }
1860  return count;
1861 }
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
void unlockFace() const
FT_Face lockFace(Scaling scale=Scaled) const

◆ init() [1/2]

bool QFontEngineFT::init ( FaceId  faceId,
bool  antiaalias,
GlyphFormat  defaultFormat = Format_None,
const QByteArray fontData = QByteArray() 
)

Definition at line 663 of file qfontengine_ft.cpp.

Referenced by QFontconfigDatabase::fontEngine(), QBasicUnixFontDatabase::fontEngine(), initFromFontEngine(), and loadSingleEngine().

665 {
667 }
static QFreetypeFace * getFace(const QFontEngine::FaceId &face_id, const QByteArray &fontData=QByteArray())
bool init(FaceId faceId, bool antiaalias, GlyphFormat defaultFormat=Format_None, const QByteArray &fontData=QByteArray())
virtual QFontEngine::FaceId faceId() const

◆ init() [2/2]

bool QFontEngineFT::init ( FaceId  faceId,
bool  antialias,
GlyphFormat  format,
QFreetypeFace freetypeFace 
)

Definition at line 669 of file qfontengine_ft.cpp.

671 {
672  freetype = freetypeFace;
673  if (!freetype) {
674  xsize = 0;
675  ysize = 0;
676  return false;
677  }
679  this->antialias = antialias;
680 
681  if (!antialias)
683  else if (format == Format_A8)
685  else if (format == Format_A32)
687 
688  face_id = faceId;
689 
690  symbol = freetype->symbol_map != 0;
691  PS_FontInfoRec psrec;
692  // don't assume that type1 fonts are symbol fonts by default
693  if (FT_Get_PS_Font_Info(freetype->face, &psrec) == FT_Err_Ok) {
695  }
696  // #####
697  freetype->hbFace->isSymbolFont = symbol;
698 
699  lbearing = rbearing = SHRT_MIN;
701 
702  FT_Face face = lockFace();
703 
704  if (FT_IS_SCALABLE(face)) {
705  bool fake_oblique = (fontDef.style != QFont::StyleNormal) && !(face->style_flags & FT_STYLE_FLAG_ITALIC);
706  if (fake_oblique)
707  matrix.xy = 0x10000*3/10;
708  FT_Set_Transform(face, &matrix, 0);
710  if (fake_oblique)
711  transform = true;
712  // fake bold
713  if ((fontDef.weight == QFont::Bold) && !(face->style_flags & FT_STYLE_FLAG_BOLD) && !FT_IS_FIXED_WIDTH(face))
714  embolden = true;
715  // underline metrics
716  line_thickness = QFixed::fromFixed(FT_MulFix(face->underline_thickness, face->size->metrics.y_scale));
717  underline_position = QFixed::fromFixed(-FT_MulFix(face->underline_position, face->size->metrics.y_scale));
718  } else {
719  // copied from QFontEngineQPF
720  // ad hoc algorithm
721  int score = fontDef.weight * fontDef.pixelSize;
722  line_thickness = score / 700;
723  // looks better with thicker line for small pointsizes
724  if (line_thickness < 2 && score >= 1050)
725  line_thickness = 2;
726  underline_position = ((line_thickness * 2) + 3) / 6;
727  }
728  if (line_thickness < 1)
729  line_thickness = 1;
730 
731  hbFont.x_ppem = face->size->metrics.x_ppem;
732  hbFont.y_ppem = face->size->metrics.y_ppem;
733  hbFont.x_scale = face->size->metrics.x_scale;
734  hbFont.y_scale = face->size->metrics.y_scale;
735 
737 
738  metrics = face->size->metrics;
739 
740 #if defined(Q_WS_QWS) || defined(Q_WS_QPA)
741  /*
742  TrueType fonts with embedded bitmaps may have a bitmap font specific
743  ascent/descent in the EBLC table. There is no direct public API
744  to extract those values. The only way we've found is to trick freetype
745  into thinking that it's not a scalable font in FT_SelectSize so that
746  the metrics are retrieved from the bitmap strikes.
747  */
748  if (FT_IS_SCALABLE(face)) {
749  for (int i = 0; i < face->num_fixed_sizes; ++i) {
750  if (xsize == X_SIZE(face, i) && ysize == Y_SIZE(face, i)) {
751  face->face_flags &= ~FT_FACE_FLAG_SCALABLE;
752 
753  FT_Select_Size(face, i);
754  metrics.ascender = face->size->metrics.ascender;
755  metrics.descender = face->size->metrics.descender;
756  FT_Set_Char_Size(face, xsize, ysize, 0, 0);
757 
758  face->face_flags |= FT_FACE_FLAG_SCALABLE;
759  break;
760  }
761  }
762  }
763 #endif
764 
765  fontDef.styleName = QString::fromUtf8(face->style_name);
766 
767  unlockFace();
768 
769  fsType = freetype->fsType();
771  return true;
772 }
QGlyphSet defaultGlyphSet
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
#define X_SIZE(face, i)
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
HB_FontRec hbFont
GlyphFormat defaultFormat
virtual unsigned long allocateServerGlyphSet()
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
void unlockFace() const
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
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
FT_Size_Metrics metrics
virtual QFontEngine::FaceId faceId() const
uint weight
Definition: qfont_p.h:95
HB_Face hbFace
#define Y_SIZE(face, i)
qreal pixelSize
Definition: qfont_p.h:90
int fsType() const
uint style
Definition: qfont_p.h:97
QString styleName
Definition: qfont_p.h:83
FT_Face lockFace(Scaling scale=Scaled) const
QFontEngine::FaceId face_id
QFixed underline_position
FT_CharMap symbol_map
QFreetypeFace * freetype
QFontDef fontDef
QString family
Definition: qfont_p.h:82
void computeSize(const QFontDef &fontDef, int *xsize, int *ysize, bool *outline_drawing)

◆ initFromFontEngine()

bool QFontEngineFT::initFromFontEngine ( const QFontEngineFT fontEngine)

Definition at line 1975 of file qfontengine_ft.cpp.

Referenced by QFontEngineX11FT::cloneWithSize(), and cloneWithSize().

1976 {
1977  if (!init(fe->faceId(), fe->antialias, fe->defaultFormat, fe->freetype))
1978  return false;
1979 
1980  // Increase the reference of this QFreetypeFace since one more QFontEngineFT
1981  // will be using it
1982  freetype->ref.ref();
1983 
1984  default_load_flags = fe->default_load_flags;
1985  default_hint_style = fe->default_hint_style;
1986  antialias = fe->antialias;
1987  transform = fe->transform;
1988  embolden = fe->embolden;
1989  subpixelType = fe->subpixelType;
1990  lcdFilterType = fe->lcdFilterType;
1991  canUploadGlyphsToServer = fe->canUploadGlyphsToServer;
1992  embeddedbitmap = fe->embeddedbitmap;
1993 
1994  return true;
1995 }
SubpixelAntialiasingType subpixelType
bool ref()
Atomically increments the value of this QAtomicInt.
bool init(FaceId faceId, bool antiaalias, GlyphFormat defaultFormat=Format_None, const QByteArray &fontData=QByteArray())
HintStyle default_hint_style
bool canUploadGlyphsToServer
QFreetypeFace * freetype

◆ invalid()

bool QFontEngineFT::invalid ( ) const
inline

◆ isBitmapFont()

bool QFontEngineFT::isBitmapFont ( ) const
inline

Definition at line 278 of file qfontengine_ft_p.h.

Referenced by QRasterPaintEngine::drawCachedGlyphs().

◆ leading()

QFixed QFontEngineFT::leading ( ) const
virtual

Implements QFontEngine.

Definition at line 1181 of file qfontengine_ft.cpp.

1182 {
1183  return QFixed::fromFixed(metrics.height - metrics.ascender + metrics.descender);
1184 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
FT_Size_Metrics metrics

◆ lineThickness()

QFixed QFontEngineFT::lineThickness ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1265 of file qfontengine_ft.cpp.

1266 {
1267  return line_thickness;
1268 }

◆ loadFlags()

int QFontEngineFT::loadFlags ( QGlyphSet set,
GlyphFormat  format,
int  flags,
bool &  hsubpixel,
int &  vfactor 
) const
private

Definition at line 779 of file qfontengine_ft.cpp.

Referenced by getPointInOutline().

781 {
782  int load_flags = FT_LOAD_DEFAULT | default_load_flags;
783  int load_target = default_hint_style == HintLight
784  ? FT_LOAD_TARGET_LIGHT
785  : FT_LOAD_TARGET_NORMAL;
786 
787  if (format == Format_Mono) {
788  load_target = FT_LOAD_TARGET_MONO;
789  } else if (format == Format_A32) {
792  load_target = FT_LOAD_TARGET_LCD;
793  hsubpixel = true;
796  load_target = FT_LOAD_TARGET_LCD_V;
797  vfactor = 3;
798  }
799  }
800 
801  if (set && set->outline_drawing)
802  load_flags = FT_LOAD_NO_BITMAP;
803 
804  if (default_hint_style == HintNone || (flags & HB_ShaperFlag_UseDesignMetrics) || (set && set->outline_drawing))
805  load_flags |= FT_LOAD_NO_HINTING;
806  else
807  load_flags |= load_target;
808 
809  return load_flags;
810 }
SubpixelAntialiasingType subpixelType
HintStyle default_hint_style
static void set(QJustificationPoint *point, int type, const QGlyphLayout &glyph, QFontEngine *fe)

◆ loadGlyph() [1/2]

Glyph* QFontEngineFT::loadGlyph ( uint  glyph,
QFixed  subPixelPosition,
GlyphFormat  format = Format_None,
bool  fetchMetricsOnly = false 
) const
inline

Definition at line 280 of file qfontengine_ft_p.h.

Referenced by QRasterPaintEngine::drawCachedGlyphs(), and path_for_glyphs().

281  { return loadGlyph(&defaultGlyphSet, glyph, subPixelPosition, format, fetchMetricsOnly); }
QGlyphSet defaultGlyphSet
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const

◆ loadGlyph() [2/2]

QFontEngineFT::Glyph * QFontEngineFT::loadGlyph ( QGlyphSet set,
uint  glyph,
QFixed  subPixelPosition,
GlyphFormat  format = Format_None,
bool  fetchMetricsOnly = false 
) const

Definition at line 812 of file qfontengine_ft.cpp.

816 {
817 // Q_ASSERT(freetype->lock == 1);
818 
819  bool uploadToServer = false;
820  if (format == Format_None) {
821  if (defaultFormat != Format_None) {
824  uploadToServer = true;
825  } else {
827  }
828  }
829 
830  Glyph *g = set->getGlyph(glyph, subPixelPosition);
831  if (g && g->format == format) {
832  if (uploadToServer && !g->uploadedToServer) {
833  set->setGlyph(glyph, subPixelPosition, 0);
834  delete g;
835  g = 0;
836  } else {
837  return g;
838  }
839  }
840 
842 
844  bool hsubpixel = false;
845  int vfactor = 1;
846  int load_flags = loadFlags(set, format, 0, hsubpixel, vfactor);
847 
848 #ifndef Q_WS_QWS
849  if (format != Format_Mono && !embeddedbitmap)
850  load_flags |= FT_LOAD_NO_BITMAP;
851 #endif
852 
853  FT_Matrix matrix = freetype->matrix;
854  bool transform = matrix.xx != 0x10000
855  || matrix.yy != 0x10000
856  || matrix.xy != 0
857  || matrix.yx != 0;
858 
859  if (transform)
860  load_flags |= FT_LOAD_NO_BITMAP;
861 
862  FT_Face face = freetype->face;
863 
864  FT_Vector v;
865  v.x = format == Format_Mono ? 0 : FT_Pos(subPixelPosition.toReal() * 64);
866  v.y = 0;
867  FT_Set_Transform(face, &freetype->matrix, &v);
868 
869  FT_Error err = FT_Load_Glyph(face, glyph, load_flags);
870  if (err && (load_flags & FT_LOAD_NO_BITMAP)) {
871  load_flags &= ~FT_LOAD_NO_BITMAP;
872  err = FT_Load_Glyph(face, glyph, load_flags);
873  }
874  if (err == FT_Err_Too_Few_Arguments) {
875  // this is an error in the bytecode interpreter, just try to run without it
876  load_flags |= FT_LOAD_FORCE_AUTOHINT;
877  err = FT_Load_Glyph(face, glyph, load_flags);
878  }
879  if (err != FT_Err_Ok)
880  qWarning("load glyph failed err=%x face=%p, glyph=%d", err, face, glyph);
881 
882  if (set->outline_drawing && fetchMetricsOnly)
883  return 0;
884 
885  FT_GlyphSlot slot = face->glyph;
887  FT_Library library = qt_getFreetype();
888 
889  info.xOff = TRUNC(ROUND(slot->advance.x));
890  info.yOff = 0;
891 
892  uchar *glyph_buffer = 0;
893  int glyph_buffer_size = 0;
894 #if defined(QT_USE_FREETYPE_LCDFILTER)
895  bool useFreetypeRenderGlyph = false;
896  if (slot->format == FT_GLYPH_FORMAT_OUTLINE && (hsubpixel || vfactor != 1)) {
897  err = FT_Library_SetLcdFilter(library, (FT_LcdFilter)lcdFilterType);
898  if (err == FT_Err_Ok)
899  useFreetypeRenderGlyph = true;
900  }
901 
902  if (useFreetypeRenderGlyph) {
903  err = FT_Render_Glyph(slot, hsubpixel ? FT_RENDER_MODE_LCD : FT_RENDER_MODE_LCD_V);
904 
905  if (err != FT_Err_Ok)
906  qWarning("render glyph failed err=%x face=%p, glyph=%d", err, face, glyph);
907 
908  FT_Library_SetLcdFilter(library, FT_LCD_FILTER_NONE);
909 
910  info.height = slot->bitmap.rows / vfactor;
911  info.width = hsubpixel ? slot->bitmap.width / 3 : slot->bitmap.width;
912  info.x = -slot->bitmap_left;
913  info.y = slot->bitmap_top;
914 
915  glyph_buffer_size = info.width * info.height * 4;
916  glyph_buffer = new uchar[glyph_buffer_size];
917 
918  if (hsubpixel)
919  convertRGBToARGB(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB, false);
920  else if (vfactor != 1)
921  convertRGBToARGB_V(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_VRGB, false);
922  } else
923 #endif
924  {
925  int left = slot->metrics.horiBearingX;
926  int right = slot->metrics.horiBearingX + slot->metrics.width;
927  int top = slot->metrics.horiBearingY;
928  int bottom = slot->metrics.horiBearingY - slot->metrics.height;
929  if(transform && slot->format != FT_GLYPH_FORMAT_BITMAP) {
930  int l, r, t, b;
931  FT_Vector vector;
932  vector.x = left;
933  vector.y = top;
934  FT_Vector_Transform(&vector, &matrix);
935  l = r = vector.x;
936  t = b = vector.y;
937  vector.x = right;
938  vector.y = top;
939  FT_Vector_Transform(&vector, &matrix);
940  if (l > vector.x) l = vector.x;
941  if (r < vector.x) r = vector.x;
942  if (t < vector.y) t = vector.y;
943  if (b > vector.y) b = vector.y;
944  vector.x = right;
945  vector.y = bottom;
946  FT_Vector_Transform(&vector, &matrix);
947  if (l > vector.x) l = vector.x;
948  if (r < vector.x) r = vector.x;
949  if (t < vector.y) t = vector.y;
950  if (b > vector.y) b = vector.y;
951  vector.x = left;
952  vector.y = bottom;
953  FT_Vector_Transform(&vector, &matrix);
954  if (l > vector.x) l = vector.x;
955  if (r < vector.x) r = vector.x;
956  if (t < vector.y) t = vector.y;
957  if (b > vector.y) b = vector.y;
958  left = l;
959  right = r;
960  top = t;
961  bottom = b;
962  }
963  left = FLOOR(left);
964  right = CEIL(right);
965  bottom = FLOOR(bottom);
966  top = CEIL(top);
967 
968  int hpixels = TRUNC(right - left);
969  // subpixel position requires one more pixel
970  if (subPixelPosition > 0 && format != Format_Mono)
971  hpixels++;
972 
973  if (hsubpixel)
974  hpixels = hpixels*3 + 8;
975  info.width = hpixels;
976  info.height = TRUNC(top - bottom);
977  info.x = -TRUNC(left);
978  info.y = TRUNC(top);
979  if (hsubpixel) {
980  info.width /= 3;
981  info.x += 1;
982  }
983 
984  bool large_glyph = (((short)(slot->linearHoriAdvance>>10) != slot->linearHoriAdvance>>10)
985  || ((uchar)(info.width) != info.width)
986  || ((uchar)(info.height) != info.height)
987  || ((signed char)(info.x) != info.x)
988  || ((signed char)(info.y) != info.y)
989  || ((signed char)(info.xOff) != info.xOff));
990 
991  if (large_glyph) {
992  delete [] glyph_buffer;
993  return 0;
994  }
995 
996  int pitch = (format == Format_Mono ? ((info.width + 31) & ~31) >> 3 :
997  (format == Format_A8 ? (info.width + 3) & ~3 : info.width * 4));
998  glyph_buffer_size = pitch * info.height;
999  glyph_buffer = new uchar[glyph_buffer_size];
1000 
1001  if (slot->format == FT_GLYPH_FORMAT_OUTLINE) {
1002  FT_Bitmap bitmap;
1003  bitmap.rows = info.height*vfactor;
1004  bitmap.width = hpixels;
1005  bitmap.pitch = format == Format_Mono ? (((info.width + 31) & ~31) >> 3) : ((bitmap.width + 3) & ~3);
1006  if (!hsubpixel && vfactor == 1)
1007  bitmap.buffer = glyph_buffer;
1008  else
1009  bitmap.buffer = new uchar[bitmap.rows*bitmap.pitch];
1010  memset(bitmap.buffer, 0, bitmap.rows*bitmap.pitch);
1011  bitmap.pixel_mode = format == Format_Mono ? FT_PIXEL_MODE_MONO : FT_PIXEL_MODE_GRAY;
1012  FT_Matrix matrix;
1013  matrix.xx = (hsubpixel ? 3 : 1) << 16;
1014  matrix.yy = vfactor << 16;
1015  matrix.yx = matrix.xy = 0;
1016 
1017  FT_Outline_Transform(&slot->outline, &matrix);
1018  FT_Outline_Translate (&slot->outline, (hsubpixel ? -3*left +(4<<6) : -left), -bottom*vfactor);
1019  FT_Outline_Get_Bitmap(library, &slot->outline, &bitmap);
1020  if (hsubpixel) {
1021  Q_ASSERT (bitmap.pixel_mode == FT_PIXEL_MODE_GRAY);
1023  uchar *convoluted = new uchar[bitmap.rows*bitmap.pitch];
1024  bool useLegacyLcdFilter = false;
1025 #if defined(FC_LCD_FILTER) && defined(FT_LCD_FILTER_H)
1026  useLegacyLcdFilter = (lcdFilterType == FT_LCD_FILTER_LEGACY);
1027 #endif
1028  uchar *buffer = bitmap.buffer;
1029  if (!useLegacyLcdFilter) {
1030  convoluteBitmap(bitmap.buffer, convoluted, bitmap.width, info.height, bitmap.pitch);
1031  buffer = convoluted;
1032  }
1033  convertRGBToARGB(buffer + 1, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB, useLegacyLcdFilter);
1034  delete [] convoluted;
1035  } else if (vfactor != 1) {
1036  convertRGBToARGB_V(bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_VRGB, true);
1037  }
1038 
1039  if (bitmap.buffer != glyph_buffer)
1040  delete [] bitmap.buffer;
1041  } else if (slot->format == FT_GLYPH_FORMAT_BITMAP) {
1042  Q_ASSERT(slot->bitmap.pixel_mode == FT_PIXEL_MODE_MONO);
1043  uchar *src = slot->bitmap.buffer;
1044  uchar *dst = glyph_buffer;
1045  int h = slot->bitmap.rows;
1046  if (format == Format_Mono) {
1047  int bytes = ((info.width + 7) & ~7) >> 3;
1048  while (h--) {
1049  memcpy (dst, src, bytes);
1050  dst += pitch;
1051  src += slot->bitmap.pitch;
1052  }
1053  } else {
1054  if (hsubpixel) {
1055  while (h--) {
1056  uint *dd = (uint *)dst;
1057  *dd++ = 0;
1058  for (int x = 0; x < slot->bitmap.width; x++) {
1059  uint a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xffffff : 0x000000);
1060  *dd++ = a;
1061  }
1062  *dd++ = 0;
1063  dst += pitch;
1064  src += slot->bitmap.pitch;
1065  }
1066  } else if (vfactor != 1) {
1067  while (h--) {
1068  uint *dd = (uint *)dst;
1069  for (int x = 0; x < slot->bitmap.width; x++) {
1070  uint a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xffffff : 0x000000);
1071  *dd++ = a;
1072  }
1073  dst += pitch;
1074  src += slot->bitmap.pitch;
1075  }
1076  } else {
1077  while (h--) {
1078  for (int x = 0; x < slot->bitmap.width; x++) {
1079  unsigned char a = ((src[x >> 3] & (0x80 >> (x & 7))) ? 0xff : 0x00);
1080  dst[x] = a;
1081  }
1082  dst += pitch;
1083  src += slot->bitmap.pitch;
1084  }
1085  }
1086  }
1087  } else {
1088  qWarning("QFontEngine: Glyph neither outline nor bitmap format=%d", slot->format);
1089  delete [] glyph_buffer;
1090  return 0;
1091  }
1092  }
1093 
1094 
1095  if (!g) {
1096  g = new Glyph;
1097  g->uploadedToServer = false;
1098  g->data = 0;
1099  }
1100 
1101  g->linearAdvance = slot->linearHoriAdvance >> 10;
1102  g->width = info.width;
1103  g->height = info.height;
1104  g->x = -info.x;
1105  g->y = info.y;
1106  g->advance = info.xOff;
1107  g->format = format;
1108  delete [] g->data;
1109  g->data = glyph_buffer;
1110 
1111  if (uploadToServer) {
1112  uploadGlyphToServer(set, glyph, g, &info, glyph_buffer_size);
1113  }
1114 
1115  set->setGlyph(glyph, subPixelPosition, g);
1116 
1117  return g;
1118 }
SubpixelAntialiasingType subpixelType
static void convertRGBToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter)
static mach_timebase_info_data_t info
long ASN1_INTEGER_get ASN1_INTEGER * a
GlyphFormat defaultFormat
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
#define ROUND(x)
unsigned char uchar
Definition: qglobal.h:994
#define Q_FT_GLYPHSLOT_EMBOLDEN(slot)
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
#define CEIL(x)
XGlyphInfo GlyphInfo
Q_CORE_EXPORT void qWarning(const char *,...)
unsigned int uint
Definition: qglobal.h:996
#define FLOOR(x)
static void set(QJustificationPoint *point, int type, const QGlyphLayout &glyph, QFontEngine *fe)
#define TRUNC(x)
virtual bool uploadGlyphToServer(QGlyphSet *set, uint glyphid, Glyph *g, GlyphInfo *info, int glyphDataSize) const
bool canUploadGlyphsToServer
QFactoryLoader * l
qreal toReal() const
Definition: qfixed_p.h:77
int loadFlags(QGlyphSet *set, GlyphFormat format, int flags, bool &hsubpixel, int &vfactor) const
static void convertRGBToARGB_V(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter)
QFreetypeFace * freetype
static void convoluteBitmap(const uchar *src, uchar *dst, int width, int height, int pitch)
FT_Library qt_getFreetype()
Q_CORE_EXPORT QTextStream & left(QTextStream &s)

◆ loadGlyphs()

bool QFontEngineFT::loadGlyphs ( QGlyphSet gs,
const glyph_t glyphs,
int  num_glyphs,
const QFixedPoint positions,
GlyphFormat  format = Format_Render 
)

Definition at line 1363 of file qfontengine_ft.cpp.

Referenced by QRasterPaintEngine::drawCachedGlyphs(), QX11PaintEngine::drawFreetype(), and QTextureGlyphCache::textureMapForGlyph().

1366 {
1367  FT_Face face = 0;
1368 
1369  for (int i = 0; i < num_glyphs; ++i) {
1370  QFixed spp = subPixelPositionForX(positions[i].x);
1371  Glyph *glyph = gs->getGlyph(glyphs[i], spp);
1372  if (glyph == 0 || glyph->format != format) {
1373  if (!face) {
1374  face = lockFace();
1375  FT_Matrix m = matrix;
1376  FT_Matrix_Multiply(&gs->transformationMatrix, &m);
1377  FT_Set_Transform(face, &m, 0);
1378  freetype->matrix = m;
1379  }
1380  if (!loadGlyph(gs, glyphs[i], spp, format)) {
1381  unlockFace();
1382  return false;
1383  }
1384  }
1385  }
1386 
1387  if (face)
1388  unlockFace();
1389 
1390  return true;
1391 }
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
void unlockFace() const
QFixed subPixelPositionForX(QFixed x)
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const

◆ loadTransformedGlyphSet()

QFontEngineFT::QGlyphSet * QFontEngineFT::loadTransformedGlyphSet ( const QTransform matrix)

Definition at line 1291 of file qfontengine_ft.cpp.

Referenced by QRasterPaintEngine::drawCachedGlyphs(), QX11PaintEngine::drawFreetype(), and QTextureGlyphCache::textureMapForGlyph().

1292 {
1293  if (matrix.type() > QTransform::TxShear)
1294  return 0;
1295 
1296  // FT_Set_Transform only supports scalable fonts
1297  if (!FT_IS_SCALABLE(freetype->face))
1298  return 0;
1299 
1300  FT_Matrix m;
1301  m.xx = FT_Fixed(matrix.m11() * 65536);
1302  m.xy = FT_Fixed(-matrix.m21() * 65536);
1303  m.yx = FT_Fixed(-matrix.m12() * 65536);
1304  m.yy = FT_Fixed(matrix.m22() * 65536);
1305 
1306  QGlyphSet *gs = 0;
1307 
1308  for (int i = 0; i < transformedGlyphSets.count(); ++i) {
1309  const QGlyphSet &g = transformedGlyphSets.at(i);
1310  if (g.transformationMatrix.xx == m.xx
1311  && g.transformationMatrix.xy == m.xy
1312  && g.transformationMatrix.yx == m.yx
1313  && g.transformationMatrix.yy == m.yy) {
1314 
1315  // found a match, move it to the front
1316  transformedGlyphSets.move(i, 0);
1317  gs = &transformedGlyphSets[0];
1318  break;
1319  }
1320  }
1321 
1322  if (!gs) {
1323  // don't try to load huge fonts
1324  bool draw_as_outline = fontDef.pixelSize * qSqrt(qAbs(matrix.det())) >= QT_MAX_CACHED_GLYPH_SIZE;
1325  if (draw_as_outline)
1326  return 0;
1327 
1328  // don't cache more than 10 transformations
1329  if (transformedGlyphSets.count() >= 10) {
1330  transformedGlyphSets.move(transformedGlyphSets.size() - 1, 0);
1332  } else {
1333  transformedGlyphSets.prepend(QGlyphSet());
1334  }
1335  gs = &transformedGlyphSets[0];
1336 
1337  gs->clear();
1338 
1339  gs->id = allocateServerGlyphSet();
1340 
1341  gs->transformationMatrix = m;
1342  gs->outline_drawing = draw_as_outline;
1343  }
1344 
1345  return gs;
1346 }
QList< QGlyphSet > transformedGlyphSets
qreal m21() const
Returns the horizontal shearing factor.
Definition: qtransform.h:249
qreal m22() const
Returns the vertical scaling factor.
Definition: qtransform.h:253
virtual void freeServerGlyphSet(unsigned long id)
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
TransformationType type() const
Returns the transformation type of this matrix.
qreal m12() const
Returns the vertical shearing factor.
Definition: qtransform.h:241
virtual unsigned long allocateServerGlyphSet()
#define QT_MAX_CACHED_GLYPH_SIZE
qreal pixelSize
Definition: qfont_p.h:90
qreal det() const
Returns the matrix&#39;s determinant.
Definition: qtransform.h:233
QFreetypeFace * freetype
QFontDef fontDef
qreal qSqrt(qreal v)
Definition: qmath.h:205
qreal m11() const
Returns the horizontal scaling factor.
Definition: qtransform.h:237

◆ lockFace()

FT_Face QFontEngineFT::lockFace ( Scaling  scale = Scaled) const

Definition at line 1863 of file qfontengine_ft.cpp.

Referenced by QRasterPaintEngine::drawCachedGlyphs(), getPointInOutline(), path_for_glyphs(), and qgl_use_font().

1864 {
1865  freetype->lock();
1866  FT_Face face = freetype->face;
1867  if (scale == Unscaled) {
1868  FT_Set_Char_Size(face, face->units_per_EM << 6, face->units_per_EM << 6, 0, 0);
1869  freetype->xsize = face->units_per_EM << 6;
1870  freetype->ysize = face->units_per_EM << 6;
1871  } else if (freetype->xsize != xsize || freetype->ysize != ysize) {
1872  FT_Set_Char_Size(face, xsize, ysize, 0, 0);
1873  freetype->xsize = xsize;
1874  freetype->ysize = ysize;
1875  }
1876  if (freetype->matrix.xx != matrix.xx ||
1877  freetype->matrix.yy != matrix.yy ||
1878  freetype->matrix.xy != matrix.xy ||
1879  freetype->matrix.yx != matrix.yx) {
1880  freetype->matrix = matrix;
1881  FT_Set_Transform(face, &freetype->matrix, 0);
1882  }
1883 
1884  return face;
1885 }
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
QFreetypeFace * freetype

◆ maxCharWidth()

qreal QFontEngineFT::maxCharWidth ( ) const
virtual

Implements QFontEngine.

Definition at line 1210 of file qfontengine_ft.cpp.

1211 {
1212  return metrics.max_advance >> 6;
1213 }
FT_Size_Metrics metrics

◆ minLeftBearing()

qreal QFontEngineFT::minLeftBearing ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1239 of file qfontengine_ft.cpp.

1240 {
1241  if (lbearing == SHRT_MIN)
1242  (void) minRightBearing(); // calculates both
1243  return lbearing.toReal();
1244 }
virtual qreal minRightBearing() const
qreal toReal() const
Definition: qfixed_p.h:77

◆ minRightBearing()

qreal QFontEngineFT::minRightBearing ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1246 of file qfontengine_ft.cpp.

1247 {
1248  if (rbearing == SHRT_MIN) {
1249  lbearing = rbearing = 0;
1250  const QChar *ch = (const QChar *)(const void*)char_table;
1252  int ng = char_table_entries;
1254  while (--ng) {
1255  if (glyphs.glyphs[ng]) {
1256  glyph_metrics_t gi = const_cast<QFontEngineFT *>(this)->boundingBox(glyphs.glyphs[ng]);
1257  lbearing = qMin(lbearing, gi.x);
1258  rbearing = qMin(rbearing, (gi.xoff - gi.x - gi.width));
1259  }
1260  }
1261  }
1262  return rbearing.toReal();
1263 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
static const ushort char_table[]
HB_Glyph * glyphs
virtual glyph_metrics_t boundingBox(const QGlyphLayout &glyphs)
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
virtual bool stringToCMap(const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
qreal toReal() const
Definition: qfixed_p.h:77
static const int char_table_entries

◆ name()

virtual const char* QFontEngineFT::name ( ) const
inlinevirtual

Implements QFontEngine.

Definition at line 236 of file qfontengine_ft_p.h.

237  { return "freetype"; }

◆ non_locked_face()

FT_Face QFontEngineFT::non_locked_face ( ) const

Definition at line 1892 of file qfontengine_ft.cpp.

Referenced by QFont::freetypeFace(), ft_face(), and qt_x11_set_fallback_font_family().

1893 {
1894  return freetype->face;
1895 }
QFreetypeFace * freetype

◆ properties()

QFontEngine::Properties QFontEngineFT::properties ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1135 of file qfontengine_ft.cpp.

1136 {
1137  Properties p = freetype->properties();
1138  if (p.postscriptName.isEmpty()) {
1140  }
1141 
1142  return freetype->properties();
1143 }
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
Definition: qstring.cpp:4074
QFontEngine::Properties properties() const
static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily)
QFreetypeFace * freetype
QFontDef fontDef
QString family
Definition: qfont_p.h:82

◆ recalcAdvances()

void QFontEngineFT::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 1598 of file qfontengine_ft.cpp.

1599 {
1600  FT_Face face = 0;
1601  bool design = (default_hint_style == HintNone ||
1603  (flags & HB_ShaperFlag_UseDesignMetrics)) && FT_IS_SCALABLE(freetype->face);
1604  for (int i = 0; i < glyphs->numGlyphs; i++) {
1605  Glyph *g = defaultGlyphSet.getGlyph(glyphs->glyphs[i]);
1606  if (g) {
1607  glyphs->advances_x[i] = design ? QFixed::fromFixed(g->linearAdvance) : QFixed(g->advance);
1608  } else {
1609  if (!face)
1610  face = lockFace();
1611  g = loadGlyph(glyphs->glyphs[i], 0, Format_None, true);
1612  glyphs->advances_x[i] = design ? QFixed::fromFixed(face->glyph->linearHoriAdvance >> 10)
1613  : QFixed::fromFixed(face->glyph->metrics.horiAdvance).round();
1614  }
1616  glyphs->advances_x[i] = glyphs->advances_x[i].round();
1617  glyphs->advances_y[i] = 0;
1618  }
1619  if (face)
1620  unlockFace();
1621 }
QGlyphSet defaultGlyphSet
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
Glyph * getGlyph(glyph_t index, QFixed subPixelPosition=0) const
HintStyle default_hint_style
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
QFixed round() const
Definition: qfixed_p.h:80
void unlockFace() const
FT_Size_Metrics metrics
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype
QFontDef fontDef
uint styleStrategy
Definition: qfont_p.h:92
Glyph * loadGlyph(uint glyph, QFixed subPixelPosition, GlyphFormat format=Format_None, bool fetchMetricsOnly=false) const

◆ removeGlyphFromCache()

void QFontEngineFT::removeGlyphFromCache ( glyph_t  glyph)
virtual

Reimplemented from QFontEngine.

Definition at line 1847 of file qfontengine_ft.cpp.

1848 {
1850 }
QGlyphSet defaultGlyphSet
void removeGlyphFromCache(glyph_t index, QFixed subPixelPosition)

◆ setDefaultHintStyle()

void QFontEngineFT::setDefaultHintStyle ( HintStyle  style)

Definition at line 774 of file qfontengine_ft.cpp.

Referenced by QFontconfigDatabase::fontEngine(), and QRawFontPrivate::platformLoadFromData().

775 {
776  default_hint_style = style;
777 }
HintStyle default_hint_style

◆ stringToCMap()

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

Implements QFontEngine.

Definition at line 1501 of file qfontengine_ft.cpp.

1503 {
1504  if (*nglyphs < len) {
1505  *nglyphs = len;
1506  return false;
1507  }
1508 
1509 #if !defined(QT_NO_FONTCONFIG)
1510  extern QMutex *qt_fontdatabase_mutex();
1511  QMutex *mtx = 0;
1512 #endif
1513 
1514  bool mirrored = flags & QTextEngine::RightToLeft;
1515  int glyph_pos = 0;
1516  if (freetype->symbol_map) {
1517  FT_Face face = freetype->face;
1518  for ( int i = 0; i < len; ++i ) {
1519  unsigned int uc = getChar(str, i, len);
1520  glyphs->glyphs[glyph_pos] = uc < QFreetypeFace::cmapCacheSize ? freetype->cmapCache[uc] : 0;
1521  if ( !glyphs->glyphs[glyph_pos] ) {
1522  glyph_t glyph;
1523 #if !defined(QT_NO_FONTCONFIG)
1524  if (!mtx) {
1525  mtx = qt_fontdatabase_mutex();
1526  mtx->lock();
1527  }
1528 
1529  if (freetype->charset != 0 && FcCharSetHasChar(freetype->charset, uc)) {
1530 #else
1531  if (false) {
1532 #endif
1533  redo0:
1534  glyph = FT_Get_Char_Index(face, uc);
1535  if (!glyph && (uc == 0xa0 || uc == 0x9)) {
1536  uc = 0x20;
1537  goto redo0;
1538  }
1539  } else {
1540  FT_Set_Charmap(face, freetype->symbol_map);
1541  glyph = FT_Get_Char_Index(face, uc);
1542  FT_Set_Charmap(face, freetype->unicode_map);
1543  }
1544  glyphs->glyphs[glyph_pos] = glyph;
1546  freetype->cmapCache[uc] = glyph;
1547  }
1548  ++glyph_pos;
1549  }
1550  } else {
1551  FT_Face face = freetype->face;
1552  for (int i = 0; i < len; ++i) {
1553  unsigned int uc = getChar(str, i, len);
1554  if (mirrored)
1555  uc = QChar::mirroredChar(uc);
1556  glyphs->glyphs[glyph_pos] = uc < QFreetypeFace::cmapCacheSize ? freetype->cmapCache[uc] : 0;
1557  if (!glyphs->glyphs[glyph_pos]) {
1558 #if !defined(QT_NO_FONTCONFIG)
1559  if (!mtx) {
1560  mtx = qt_fontdatabase_mutex();
1561  mtx->lock();
1562  }
1563 
1564  if (freetype->charset == 0 || FcCharSetHasChar(freetype->charset, uc))
1565 #endif
1566  {
1567  redo:
1568  glyph_t glyph = FT_Get_Char_Index(face, uc);
1569  if (!glyph && (uc == 0xa0 || uc == 0x9)) {
1570  uc = 0x20;
1571  goto redo;
1572  }
1573  glyphs->glyphs[glyph_pos] = glyph;
1575  freetype->cmapCache[uc] = glyph;
1576  }
1577  }
1578  ++glyph_pos;
1579  }
1580  }
1581 
1582  *nglyphs = glyph_pos;
1583  glyphs->numGlyphs = glyph_pos;
1584 
1585 #if !defined(QT_NO_FONTCONFIG)
1586  if (mtx)
1587  mtx->unlock();
1588 #endif
1589 
1590  if (flags & QTextEngine::GlyphIndicesOnly)
1591  return true;
1592 
1593  recalcAdvances(glyphs, flags);
1594 
1595  return true;
1596 }
void lock()
Locks the mutex.
Definition: qmutex.cpp:151
The QMutex class provides access serialization between threads.
Definition: qmutex.h:60
HB_Glyph * glyphs
virtual void recalcAdvances(QGlyphLayout *glyphs, QTextEngine::ShaperFlags flags) const
struct FT_FaceRec_ * FT_Face
Definition: qfont.h:50
FcCharSet * charset
static unsigned int getChar(const QChar *str, int &i, const int len)
QChar mirroredChar() const
Returns the mirrored character if this character is a mirrored character; otherwise returns the chara...
Definition: qchar.cpp:1016
void unlock()
Unlocks the mutex.
Definition: qmutex.cpp:296
glyph_t cmapCache[cmapCacheSize]
QMutex * qt_fontdatabase_mutex()
FT_CharMap symbol_map
QFreetypeFace * freetype
unsigned int glyph_t
FT_CharMap unicode_map

◆ subPixelPositionForX()

QFixed QFontEngineFT::subPixelPositionForX ( QFixed  x)

Definition at line 1348 of file qfontengine_ft.cpp.

Referenced by QRasterPaintEngine::drawCachedGlyphs().

1349 {
1350  int m_subPixelPositionCount = 4;
1352  return 0;
1353 
1354  QFixed subPixelPosition;
1355  if (x != 0) {
1356  subPixelPosition = x - x.floor();
1357  QFixed fraction = (subPixelPosition / QFixed::fromReal(1.0 / m_subPixelPositionCount)).floor();
1358  subPixelPosition = fraction / QFixed(m_subPixelPositionCount);
1359  }
1360  return subPixelPosition;
1361 }
virtual bool supportsSubPixelPositions() const
static QFixed fromReal(qreal r)
Definition: qfixed_p.h:70
QFixed floor() const
Definition: qfixed_p.h:81
T floor(const T &a)

◆ supportsSubPixelPositions()

virtual bool QFontEngineFT::supportsSubPixelPositions ( ) const
inlinevirtual

Reimplemented from QFontEngine.

Definition at line 211 of file qfontengine_ft_p.h.

Referenced by QRasterPaintEngine::drawCachedGlyphs().

◆ synthesized()

int QFontEngineFT::synthesized ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1158 of file qfontengine_ft.cpp.

1159 {
1160  int s = 0;
1161  if ((fontDef.style != QFont::StyleNormal) && !(freetype->face->style_flags & FT_STYLE_FLAG_ITALIC))
1162  s = SynthesizedItalic;
1163  if ((fontDef.weight == QFont::Bold) && !(freetype->face->style_flags & FT_STYLE_FLAG_BOLD))
1164  s |= SynthesizedBold;
1165  if (fontDef.stretch != 100 && FT_IS_SCALABLE(freetype->face))
1166  s |= SynthesizedStretch;
1167  return s;
1168 }
uint weight
Definition: qfont_p.h:95
uint style
Definition: qfont_p.h:97
uint stretch
Definition: qfont_p.h:98
QFreetypeFace * freetype
QFontDef fontDef

◆ type()

virtual Type QFontEngineFT::type ( ) const
inlinevirtual

Implements QFontEngine.

Definition at line 234 of file qfontengine_ft_p.h.

◆ underlinePosition()

QFixed QFontEngineFT::underlinePosition ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1270 of file qfontengine_ft.cpp.

1271 {
1272  return underline_position;
1273 }
QFixed underline_position

◆ unlockFace()

void QFontEngineFT::unlockFace ( ) const

Definition at line 1887 of file qfontengine_ft.cpp.

Referenced by QRasterPaintEngine::drawCachedGlyphs(), getPointInOutline(), path_for_glyphs(), and qgl_use_font().

1888 {
1889  freetype->unlock();
1890 }
QFreetypeFace * freetype

◆ uploadGlyphToServer()

bool QFontEngineFT::uploadGlyphToServer ( QGlyphSet set,
uint  glyphid,
Glyph g,
GlyphInfo info,
int  glyphDataSize 
) const
protectedvirtual

Reimplemented in QFontEngineX11FT.

Definition at line 1120 of file qfontengine_ft.cpp.

1121 {
1122  Q_UNUSED(set);
1123  Q_UNUSED(glyphid);
1124  Q_UNUSED(g);
1125  Q_UNUSED(info);
1126  Q_UNUSED(glyphDataSize);
1127  return false;
1128 }
static mach_timebase_info_data_t info
#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

◆ xHeight()

QFixed QFontEngineFT::xHeight ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 1186 of file qfontengine_ft.cpp.

1187 {
1188  TT_OS2 *os2 = (TT_OS2 *)FT_Get_Sfnt_Table(freetype->face, ft_sfnt_os2);
1189  if (os2 && os2->sxHeight) {
1190  lockFace();
1191  QFixed answer = QFixed(os2->sxHeight*freetype->face->size->metrics.y_ppem)/freetype->face->units_per_EM;
1192  unlockFace();
1193  return answer;
1194  }
1195  return QFontEngine::xHeight();
1196 }
void unlockFace() const
virtual QFixed xHeight() const
FT_Face lockFace(Scaling scale=Scaled) const
QFreetypeFace * freetype

Friends and Related Functions

◆ QFontEngineFTRawFont

friend class QFontEngineFTRawFont
friend

Definition at line 345 of file qfontengine_ft_p.h.

Properties

◆ antialias

bool QFontEngineFT::antialias
protected

Definition at line 336 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine(), and QFontEngineX11FT::QFontEngineX11FT().

◆ canUploadGlyphsToServer

bool QFontEngineFT::canUploadGlyphsToServer
protected

◆ default_hint_style

HintStyle QFontEngineFT::default_hint_style
protected

Definition at line 334 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine().

◆ default_load_flags

int QFontEngineFT::default_load_flags
protected

Definition at line 331 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine().

◆ defaultFormat

GlyphFormat QFontEngineFT::defaultFormat
private

Definition at line 349 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine().

◆ defaultGlyphSet

QGlyphSet QFontEngineFT::defaultGlyphSet
mutableprivate

Definition at line 353 of file qfontengine_ft_p.h.

◆ embeddedbitmap

bool QFontEngineFT::embeddedbitmap
protected

Definition at line 342 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine().

◆ embolden

bool QFontEngineFT::embolden
protected

Definition at line 338 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine().

◆ face_id

QFontEngine::FaceId QFontEngineFT::face_id
private

Definition at line 355 of file qfontengine_ft_p.h.

Referenced by QFontEngineX11FT::QFontEngineX11FT().

◆ freetype

QFreetypeFace* QFontEngineFT::freetype
protected

◆ kerning_pairs_loaded

bool QFontEngineFT::kerning_pairs_loaded
mutableprivate

Definition at line 366 of file qfontengine_ft_p.h.

◆ lbearing

QFixed QFontEngineFT::lbearing
mutableprivate

Definition at line 360 of file qfontengine_ft_p.h.

◆ lcdFilterType

int QFontEngineFT::lcdFilterType
protected

Definition at line 340 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine().

◆ line_thickness

QFixed QFontEngineFT::line_thickness
private

Definition at line 362 of file qfontengine_ft_p.h.

◆ matrix

FT_Matrix QFontEngineFT::matrix
private

Definition at line 350 of file qfontengine_ft_p.h.

◆ metrics

FT_Size_Metrics QFontEngineFT::metrics
private

Definition at line 365 of file qfontengine_ft_p.h.

◆ rbearing

QFixed QFontEngineFT::rbearing
mutableprivate

Definition at line 361 of file qfontengine_ft_p.h.

◆ subpixelType

SubpixelAntialiasingType QFontEngineFT::subpixelType
protected

Definition at line 339 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine(), and QFontEngineX11FT::QFontEngineX11FT().

◆ transform

bool QFontEngineFT::transform
protected

Definition at line 337 of file qfontengine_ft_p.h.

Referenced by initFromFontEngine().

◆ transformedGlyphSets

QList<QGlyphSet> QFontEngineFT::transformedGlyphSets
private

Definition at line 352 of file qfontengine_ft_p.h.

◆ underline_position

QFixed QFontEngineFT::underline_position
private

Definition at line 363 of file qfontengine_ft_p.h.

◆ xsize

int QFontEngineFT::xsize
private

Definition at line 357 of file qfontengine_ft_p.h.

◆ ysize

int QFontEngineFT::ysize
private

Definition at line 358 of file qfontengine_ft_p.h.


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