Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QAbstractFontEngine Class Reference

The QAbstractFontEngine class is the base class for font engine plugins in Qt for Embedded Linux. More...

 #include <QAbstractFontEngine>

This class is under development and is subject to change.

Inherits: QObject.

This class was introduced in Qt 4.3.

Public Types

class FixedPoint (preliminary)
class GlyphMetrics (preliminary)
flags Capabilities
enum Capability { CanRenderGlyphs_Gray, CanRenderGlyphs_Mono, CanRenderGlyphs, CanOutlineGlyphs }
typedef Fixed
enum FontProperty { Ascent, Descent, Leading, XHeight, ..., OutlineGlyphsHint }
enum TextShapingFlag { RightToLeft, ReturnDesignMetrics }
flags TextShapingFlags

Public Functions

QAbstractFontEngine ( QObject * parent = 0 )
~QAbstractFontEngine ()
virtual void addGlyphOutlinesToPath ( uint * glyphs, int numGlyphs, FixedPoint * positions, QPainterPath * path )
virtual Capabilities capabilities () const = 0
virtual bool convertStringToGlyphIndices ( const QChar * string, int length, uint * glyphs, int * numGlyphs, TextShapingFlags flags ) const = 0
virtual QVariant fontProperty ( FontProperty property ) const = 0
virtual void getGlyphAdvances ( const uint * glyphs, int numGlyphs, Fixed * advances, TextShapingFlags flags ) const = 0
virtual GlyphMetrics glyphMetrics ( uint glyph ) const = 0
virtual bool renderGlyph ( uint glyph, int depth, int bytesPerLine, int height, uchar * buffer )
  • 29 public functions inherited from QObject

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 signal inherited from QObject
  • 5 static public members inherited from QObject
  • 7 protected functions inherited from QObject

Detailed Description

The QAbstractFontEngine class is the base class for font engine plugins in Qt for Embedded Linux.

QAbstractFontEngine is implemented by font engine plugins through QFontEnginePlugin.

See also QFontEnginePlugin and QFontEngineInfo.

Member Type Documentation

enum QAbstractFontEngine::Capability
flags QAbstractFontEngine::Capabilities

This enum describes the capabilities of a font engine.

ConstantValueDescription
QAbstractFontEngine::CanRenderGlyphs_Gray4The font engine can render individual glyphs into 8 bpp images.
QAbstractFontEngine::CanRenderGlyphs_Mono2The font engine can render individual glyphs into 1 bpp images.
QAbstractFontEngine::CanRenderGlyphsCanRenderGlyphs_Mono | CanRenderGlyphs_GrayThe font engine can render individual glyphs into images.
QAbstractFontEngine::CanOutlineGlyphs1The font engine can convert glyphs to painter paths.

The Capabilities type is a typedef for QFlags<Capability>. It stores an OR combination of Capability values.

typedef QAbstractFontEngine::Fixed

This type is int, interpreted as a 26.6 fixed point value.

enum QAbstractFontEngine::FontProperty

This enum describes the properties of a font provided by a font engine.

ConstantValueDescription
QAbstractFontEngine::Ascent0The ascent of the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::Descent1The descent of the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::Leading2The leading of the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::XHeight3The 'x' height of the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::AverageCharWidth4The average character width of the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::LineThickness5The thickness of the underline and strikeout lines for the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::UnderlinePosition6The distance from the base line to the underline position for the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::MaxCharWidth7The width of the widest character in the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::MinLeftBearing8The minimum left bearing of the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::MinRightBearing9The maximum right bearing of the font, specified as a 26.6 fixed point value.
QAbstractFontEngine::GlyphCount10The number of glyphs in the font, specified as an integer value.
QAbstractFontEngine::CacheGlyphsHint11A boolean value specifying whether rendered glyphs should be cached by Qt.
QAbstractFontEngine::OutlineGlyphsHint12A boolean value specifying whether the font engine prefers outline drawing over image rendering for uncached glyphs.

enum QAbstractFontEngine::TextShapingFlag
flags QAbstractFontEngine::TextShapingFlags

This enum describes flags controlling conversion of characters to glyphs and their metrics.

ConstantValueDescription
QAbstractFontEngine::RightToLeft0x0001The text is used in a right-to-left context.
QAbstractFontEngine::ReturnDesignMetrics0x0002Return font design metrics instead of pixel metrics.

The TextShapingFlags type is a typedef for QFlags<TextShapingFlag>. It stores an OR combination of TextShapingFlag values.

Member Function Documentation

QAbstractFontEngine::QAbstractFontEngine ( QObject * parent = 0 )

Constructs a new QAbstractFontEngine with the given parent.

QAbstractFontEngine::~QAbstractFontEngine ()

Destroys this QAbstractFontEngine object.

void QAbstractFontEngine::addGlyphOutlinesToPath ( uint * glyphs, int numGlyphs, FixedPoint * positions, QPainterPath * path ) [virtual]

Implemented in subclasses to add the outline of the glyphs specified by glyphs and numGlyphs at the specified positions to the painter path path.

Capabilities QAbstractFontEngine::capabilities () const [pure virtual]

Implemented in subclasses to specify the font engine's capabilities. The return value may be cached by the caller and is expected not to change during the lifetime of the font engine.

bool QAbstractFontEngine::convertStringToGlyphIndices ( const QChar * string, int length, uint * glyphs, int * numGlyphs, TextShapingFlags flags ) const [pure virtual]

Implemented in subclasses to convert the characters specified by string and length to glyph indicies, using flags. The glyph indicies should be returned in the glyphs array provided by the caller. The maximum size of glyphs is specified by the value pointed to by numGlyphs. If successful, the subclass implementation sets the value pointed to by numGlyphs to the actual number of glyph indices generated, and returns true. Otherwise, e.g. if there is not enough space in the provided glyphs array, it should set numGlyphs to the number of glyphs needed for the conversion and return false.

QVariant QAbstractFontEngine::fontProperty ( FontProperty property ) const [pure virtual]

Implemented in subclasses to return the value of the font attribute property. The return value may be cached by the caller and is expected not to change during the lifetime of the font engine.

void QAbstractFontEngine::getGlyphAdvances ( const uint * glyphs, int numGlyphs, Fixed * advances, TextShapingFlags flags ) const [pure virtual]

Implemented in subclasses to retrieve the advances of the array specified by glyphs and numGlyphs, using flags. The result is returned in advances, which is allocated by the caller and contains numGlyphs elements.

GlyphMetrics QAbstractFontEngine::glyphMetrics ( uint glyph ) const [pure virtual]

Implemented in subclass to return the metrics for glyph.

bool QAbstractFontEngine::renderGlyph ( uint glyph, int depth, int bytesPerLine, int height, uchar * buffer ) [virtual]

Implemented in subclasses to render the specified glyph into a buffer with the given depth , bytesPerLine and height.

Returns true if rendering succeeded, false otherwise.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 44
  2. Microsoft ouvre aux autres compilateurs C++ AMP, la spécification pour la conception d'applications parallèles C++ utilisant le GPU 22
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. RIM : « 13 % des développeurs ont gagné plus de 100 000 $ sur l'AppWord », Qt et open-source au menu du BlackBerry DevCon Europe 0
  5. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 4.7
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web