Qt 4.8
Public Functions | Properties | List of all members
QProxyFontEngine Class Reference

#include <qabstractfontengine_p.h>

Inheritance diagram for QProxyFontEngine:
QFontEngine QObject

Public Functions

virtual void addGlyphsToPath (glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
 
virtual QImage alphaMapForGlyph (glyph_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 bool canRender (const QChar *string, int len)
 
QAbstractFontEngine::Capabilities capabilities () const
 
virtual QFixed descent () const
 
bool drawAsOutline () const
 
virtual int glyphCount () const
 
virtual QFixed leading () const
 
virtual QFixed lineThickness () const
 
virtual qreal maxCharWidth () const
 
virtual qreal minLeftBearing () const
 
virtual qreal minRightBearing () const
 
virtual const char * name () const
 
 QProxyFontEngine (QAbstractFontEngine *engine, const QFontDef &def)
 
virtual void recalcAdvances (QGlyphLayout *, QTextEngine::ShaperFlags) const
 
virtual bool stringToCMap (const QChar *str, int len, QGlyphLayout *glyphs, int *nglyphs, QTextEngine::ShaperFlags flags) const
 
virtual Type type () const
 
virtual QFixed underlinePosition () const
 
virtual QFixed xHeight () const
 
virtual ~QProxyFontEngine ()
 
- Public Functions inherited from QFontEngine
void addBitmapFontToPath (qreal x, qreal y, const QGlyphLayout &, QPainterPath *, QTextItem::RenderFlags)
 
virtual void addOutlineToPath (qreal, qreal, const QGlyphLayout &, QPainterPath *, 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 glyph_metrics_t boundingBox (glyph_t glyph, const QTransform &matrix)
 
virtual QFontEnginecloneWithSize (qreal) const
 
virtual void doKerning (QGlyphLayout *, QTextEngine::ShaperFlags) const
 
virtual QFixed emSquareSize () const
 
virtual FaceId faceId () 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)
 
virtual HB_Error getPointInOutline (HB_Glyph glyph, int flags, hb_uint32 point, HB_Fixed *xpos, HB_Fixed *ypos, hb_uint32 *nPoints)
 
QByteArray getSfntTable (uint) const
 
virtual bool getSfntTableData (uint, uchar *, 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 ~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...
 

Properties

QAbstractFontEngineengine
 
QAbstractFontEngine::Capabilities engineCapabilities
 

Additional Inherited Members

- 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 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...
 
- 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 63 of file qabstractfontengine_p.h.

Constructors and Destructors

◆ QProxyFontEngine()

QProxyFontEngine::QProxyFontEngine ( QAbstractFontEngine engine,
const QFontDef def 
)

Definition at line 579 of file qabstractfontengine_qws.cpp.

580  : engine(customEngine)
581 {
582  fontDef = def;
583  engineCapabilities = engine->capabilities();
584 }
virtual Capabilities capabilities() const =0
Implemented in subclasses to specify the font engine&#39;s capabilities.
QAbstractFontEngine * engine
QAbstractFontEngine::Capabilities engineCapabilities
QFontDef fontDef

◆ ~QProxyFontEngine()

QProxyFontEngine::~QProxyFontEngine ( )
virtual

Definition at line 586 of file qabstractfontengine_qws.cpp.

587 {
588  delete engine;
589 }
QAbstractFontEngine * engine

Functions

◆ addGlyphsToPath()

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

Reimplemented from QFontEngine.

Definition at line 695 of file qabstractfontengine_qws.cpp.

696 {
698  engine->addGlyphOutlinesToPath(glyphs, nglyphs, reinterpret_cast<QAbstractFontEngine::FixedPoint *>(positions), path);
699  else
700  QFontEngine::addGlyphsToPath(glyphs, positions, nglyphs, path, flags);
701 }
virtual void addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int nglyphs, QPainterPath *path, QTextItem::RenderFlags flags)
QAbstractFontEngine * engine
QAbstractFontEngine::Capabilities engineCapabilities
virtual void addGlyphOutlinesToPath(uint *glyphs, int numGlyphs, FixedPoint *positions, QPainterPath *path)
Implemented in subclasses to add the outline of the glyphs specified by glyphs and numGlyphs at the s...

◆ alphaMapForGlyph()

QImage QProxyFontEngine::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 669 of file qabstractfontengine_qws.cpp.

Referenced by canRender().

670 {
672  return alphaMapFromPath(this, glyph);
673 
675  if (metrics.width <= 0 || metrics.height <= 0)
676  return QImage();
677 
678  QImage img(metrics.width >> 6, metrics.height >> 6, QImage::Format_Indexed8);
679 
680  // ### we should have QImage::Format_GrayScale8
681  static QVector<QRgb> colorMap;
682  if (colorMap.isEmpty()) {
683  colorMap.resize(256);
684  for (int i=0; i<256; ++i)
685  colorMap[i] = qRgba(0, 0, 0, i);
686  }
687 
688  img.setColorTable(colorMap);
689 
690  engine->renderGlyph(glyph, /*depth*/8, img.bytesPerLine(), img.height(), img.bits());
691 
692  return img;
693 }
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
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
virtual GlyphMetrics glyphMetrics(uint glyph) const =0
Implemented in subclass to return the metrics for glyph.
Fixed height
The height of the glyph.
QAbstractFontEngine::GlyphMetrics defines the metrics of a single glyph.
QAbstractFontEngine * engine
Fixed width
The width of the glyph.
QAbstractFontEngine::Capabilities engineCapabilities
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
Definition: qvector.h:139
static QImage alphaMapFromPath(QFontEngine *fe, glyph_t glyph)
virtual bool renderGlyph(uint glyph, int depth, int bytesPerLine, int height, uchar *buffer)
Implemented in subclasses to render the specified glyph into a buffer with the given depth ...

◆ ascent()

QFixed QProxyFontEngine::ascent ( ) const
virtual

Implements QFontEngine.

Definition at line 729 of file qabstractfontengine_qws.cpp.

Referenced by boundingBox().

730 {
732 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine

◆ averageCharWidth()

QFixed QProxyFontEngine::averageCharWidth ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 749 of file qabstractfontengine_qws.cpp.

750 {
752 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine

◆ boundingBox() [1/2]

glyph_metrics_t QProxyFontEngine::boundingBox ( const QGlyphLayout glyphs)
virtual

Implements QFontEngine.

Definition at line 703 of file qabstractfontengine_qws.cpp.

704 {
705  if (glyphs.numGlyphs == 0)
706  return glyph_metrics_t();
707 
708  QFixed w = 0;
709  for (int i = 0; i < glyphs.numGlyphs; ++i)
710  w += glyphs.effectiveAdvance(i);
711 
712  return glyph_metrics_t(0, -ascent(), w, ascent() + descent(), w, 0);
713 }
virtual QFixed descent() const
QFixed effectiveAdvance(int item) const
virtual QFixed ascent() const

◆ boundingBox() [2/2]

glyph_metrics_t QProxyFontEngine::boundingBox ( glyph_t  glyph)
virtual

Implements QFontEngine.

Definition at line 715 of file qabstractfontengine_qws.cpp.

716 {
717  glyph_metrics_t m;
718 
720  m.x = QFixed::fromFixed(metrics.x);
721  m.y = QFixed::fromFixed(metrics.y);
722  m.width = QFixed::fromFixed(metrics.width);
723  m.height = QFixed::fromFixed(metrics.height);
724  m.xoff = QFixed::fromFixed(metrics.advance);
725 
726  return m;
727 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
Fixed advance
The advance of the glyph.
virtual GlyphMetrics glyphMetrics(uint glyph) const =0
Implemented in subclass to return the metrics for glyph.
Fixed height
The height of the glyph.
QAbstractFontEngine::GlyphMetrics defines the metrics of a single glyph.
QAbstractFontEngine * engine
Fixed width
The width of the glyph.
Fixed x
The horizontal offset from the origin.
Fixed y
The vertical offset from the origin (baseline).

◆ canRender()

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

Implements QFontEngine.

Definition at line 784 of file qabstractfontengine_qws.cpp.

785 {
786  QVarLengthArray<uint> glyphs(len);
787  int numGlyphs = len;
788 
789  if (!engine->convertStringToGlyphIndices(string, len, glyphs.data(), &numGlyphs, /*flags*/0))
790  return false;
791 
792  for (int i = 0; i < numGlyphs; ++i)
793  if (!glyphs[i])
794  return false;
795 
796  return true;
797 }
virtual bool convertStringToGlyphIndices(const QChar *string, int length, uint *glyphs, int *numGlyphs, TextShapingFlags flags) const =0
Implemented in subclasses to convert the characters specified by string and length to glyph indicies...
QAbstractFontEngine * engine

◆ capabilities()

QAbstractFontEngine::Capabilities QProxyFontEngine::capabilities ( ) const
inline

Definition at line 98 of file qabstractfontengine_p.h.

99  { return engineCapabilities; }
QAbstractFontEngine::Capabilities engineCapabilities

◆ descent()

QFixed QProxyFontEngine::descent ( ) const
virtual

Implements QFontEngine.

Definition at line 734 of file qabstractfontengine_qws.cpp.

Referenced by boundingBox().

735 {
737 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine

◆ drawAsOutline()

bool QProxyFontEngine::drawAsOutline ( ) const

Definition at line 839 of file qabstractfontengine_qws.cpp.

Referenced by capabilities().

840 {
842  return false;
843 
845  return !outlineHint.isValid() || outlineHint.toBool();
846 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
Definition: qvariant.cpp:2691
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
QAbstractFontEngine * engine
QAbstractFontEngine::Capabilities engineCapabilities
bool isValid() const
Returns true if the storage type of this variant is not QVariant::Invalid; otherwise returns false...
Definition: qvariant.h:485

◆ glyphCount()

int QProxyFontEngine::glyphCount ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 779 of file qabstractfontengine_qws.cpp.

780 {
782 }
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine

◆ leading()

QFixed QProxyFontEngine::leading ( ) const
virtual

Implements QFontEngine.

Definition at line 739 of file qabstractfontengine_qws.cpp.

740 {
742 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine

◆ lineThickness()

QFixed QProxyFontEngine::lineThickness ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 754 of file qabstractfontengine_qws.cpp.

755 {
757 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine

◆ maxCharWidth()

qreal QProxyFontEngine::maxCharWidth ( ) const
virtual

Implements QFontEngine.

Definition at line 764 of file qabstractfontengine_qws.cpp.

765 {
767 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine
static qreal toReal(Register *reg, int type, bool *ok=0)

◆ minLeftBearing()

qreal QProxyFontEngine::minLeftBearing ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 769 of file qabstractfontengine_qws.cpp.

770 {
772 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine
static qreal toReal(Register *reg, int type, bool *ok=0)

◆ minRightBearing()

qreal QProxyFontEngine::minRightBearing ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 774 of file qabstractfontengine_qws.cpp.

775 {
777 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine
static qreal toReal(Register *reg, int type, bool *ok=0)

◆ name()

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

Implements QFontEngine.

Definition at line 92 of file qabstractfontengine_p.h.

92 { return "proxy engine"; }

◆ recalcAdvances()

void QProxyFontEngine::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 612 of file qabstractfontengine_qws.cpp.

Referenced by stringToCMap().

613 {
614  const int nglyphs = glyphs->numGlyphs;
615 
617  engine->getGlyphAdvances(glyphs->glyphs, nglyphs, advances.data(), QAbstractFontEngine::TextShapingFlags(int(flags)));
618 
619 
620  // ### use memcopy instead
621  for (int i = 0; i < nglyphs; ++i) {
622  glyphs->advances_x[i] = QFixed::fromFixed(advances[i]);
623  glyphs->advances_y[i] = 0;
624  }
625 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
QAbstractFontEngine * engine
virtual void getGlyphAdvances(const uint *glyphs, int numGlyphs, Fixed *advances, TextShapingFlags flags) const =0
Implemented in subclasses to retrieve the advances of the array specified by glyphs and numGlyphs...

◆ stringToCMap()

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

Implements QFontEngine.

Definition at line 591 of file qabstractfontengine_qws.cpp.

592 {
593  if (*nglyphs < len) {
594  *nglyphs = len;
595  return false;
596  }
597 
598  QVarLengthArray<uint> glyphIndicies(*nglyphs);
599  if (!engine->convertStringToGlyphIndices(str, len, glyphIndicies.data(), nglyphs, QAbstractFontEngine::TextShapingFlags(int(flags))))
600  return false;
601 
602  // ### use memcopy instead
603  for (int i = 0; i < *nglyphs; ++i) {
604  glyphs->glyphs[i] = glyphIndicies[i];
605  }
606  glyphs->numGlyphs = *nglyphs;
607 
608  recalcAdvances(glyphs, flags);
609  return true;
610 }
HB_Glyph * glyphs
virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const
virtual bool convertStringToGlyphIndices(const QChar *string, int length, uint *glyphs, int *numGlyphs, TextShapingFlags flags) const =0
Implemented in subclasses to convert the characters specified by string and length to glyph indicies...
QAbstractFontEngine * engine

◆ type()

virtual Type QProxyFontEngine::type ( ) const
inlinevirtual

Implements QFontEngine.

Definition at line 91 of file qabstractfontengine_p.h.

91 { return Proxy; }

◆ underlinePosition()

QFixed QProxyFontEngine::underlinePosition ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 759 of file qabstractfontengine_qws.cpp.

760 {
762 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine

◆ xHeight()

QFixed QProxyFontEngine::xHeight ( ) const
virtual

Reimplemented from QFontEngine.

Definition at line 744 of file qabstractfontengine_qws.cpp.

745 {
747 }
static QFixed fromFixed(int fixed)
Definition: qfixed_p.h:71
virtual QVariant fontProperty(FontProperty property) const =0
Implemented in subclasses to return the value of the font attribute property.
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
QAbstractFontEngine * engine

Properties

◆ engine

QAbstractFontEngine* QProxyFontEngine::engine
private

◆ engineCapabilities

QAbstractFontEngine::Capabilities QProxyFontEngine::engineCapabilities
private

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