The QAbstractFontEngine class is the base class for font engine plugins in Qt for Embedded Linux. 更多...
| 头: | #include <QAbstractFontEngine> |
| Since: | Qt 4.3 |
| 继承: | QObject |
该类在开发且可能改变。
(preliminary)
class
|
FixedPoint |
(preliminary)
class
|
GlyphMetrics |
| 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 |
| 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 ) |
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 .
另请参阅 QFontEnginePlugin and QFontEngineInfo .
This enum describes the capabilities of a font engine.
| 常量 | 值 | 描述 |
|---|---|---|
QAbstractFontEngine::CanRenderGlyphs_Gray
|
4
|
The font engine can render individual glyphs into 8 bpp images. |
QAbstractFontEngine::CanRenderGlyphs_Mono
|
2
|
The font engine can render individual glyphs into 1 bpp images. |
QAbstractFontEngine::CanRenderGlyphs
|
CanRenderGlyphs_Mono | CanRenderGlyphs_Gray
|
The font engine can render individual glyphs into images. |
QAbstractFontEngine::CanOutlineGlyphs
|
1
|
The font engine can convert glyphs to painter paths. |
Capabilities 类型是 typedef 对于 QFlags <Capability>。它存储 Capability 值的 OR 组合。
This type is
int
, interpreted as a 26.6 fixed point value.
This enum describes the properties of a font provided by a font engine.
| 常量 | 值 | 描述 |
|---|---|---|
QAbstractFontEngine::Ascent
|
0
|
The ascent of the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::Descent
|
1
|
The descent of the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::Leading
|
2
|
The leading of the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::XHeight
|
3
|
The 'x' height of the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::AverageCharWidth
|
4
|
The average character width of the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::LineThickness
|
5
|
The thickness of the underline and strikeout lines for the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::UnderlinePosition
|
6
|
The distance from the base line to the underline position for the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::MaxCharWidth
|
7
|
The width of the widest character in the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::MinLeftBearing
|
8
|
The minimum left bearing of the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::MinRightBearing
|
9
|
The maximum right bearing of the font, specified as a 26.6 fixed point value. |
QAbstractFontEngine::GlyphCount
|
10
|
The number of glyphs in the font, specified as an integer value. |
QAbstractFontEngine::CacheGlyphsHint
|
11
|
A boolean value specifying whether rendered glyphs should be cached by Qt. |
QAbstractFontEngine::OutlineGlyphsHint
|
12
|
A boolean value specifying whether the font engine prefers outline drawing over image rendering for uncached glyphs. |
This enum describes flags controlling conversion of characters to glyphs and their metrics.
| 常量 | 值 | 描述 |
|---|---|---|
QAbstractFontEngine::RightToLeft
|
0x0001
|
The text is used in a right-to-left context. |
QAbstractFontEngine::ReturnDesignMetrics
|
0x0002
|
Return font design metrics instead of pixel metrics. |
The TextShapingFlags type is a typedef for QFlags <TextShapingFlag>. It stores an OR combination of TextShapingFlag values.
构造新的 QAbstractFontEngine 采用给定 parent .
销毁此 QAbstractFontEngine 对象。
[虚拟]
void
QAbstractFontEngine::
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 specified positions to the painter path path .
[pure virtual]
Capabilities
QAbstractFontEngine::
capabilities
() const
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.
[pure virtual]
bool
QAbstractFontEngine::
convertStringToGlyphIndices
(const
QChar
*
string
,
int
length
,
uint
*
glyphs
,
int
*
numGlyphs
,
TextShapingFlags
flags
) const
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.
[pure virtual]
QVariant
QAbstractFontEngine::
fontProperty
(
FontProperty
property
) const
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.
[pure virtual]
void
QAbstractFontEngine::
getGlyphAdvances
(const
uint
*
glyphs
,
int
numGlyphs
,
Fixed
*
advances
,
TextShapingFlags
flags
) const
Implemented in subclasses to retrieve the advances of the array specified by glyphs and numGlyphs ,使用 flags . The result is returned in advances , which is allocated by the caller and contains numGlyphs 元素。
[pure virtual]
GlyphMetrics
QAbstractFontEngine::
glyphMetrics
(
uint
glyph
) const
Implemented in subclass to return the metrics for glyph .
[虚拟]
bool
QAbstractFontEngine::
renderGlyph
(
uint
glyph
,
int
depth
,
int
bytesPerLine
,
int
height
,
uchar
*
buffer
)
Implemented in subclasses to render the specified glyph 成 buffer 采用给定 depth , bytesPerLine and height .
Returns true if rendering succeeded, false otherwise.