C
QSafeFont Class
class SafeRenderer::QSafeFontQSafeFont class reads the QPF2 font file. More...
Header: | #include <QSafeFont> |
Since: | QtSafeRenderer 1.1 |
Inherited By: |
This class was introduced in QtSafeRenderer 1.1.
Public Types
enum | BlockTag { CMapBlock, GMapBlock, GlyphBlock } |
enum | FontHeaderOffset { HeaderMagicQ, HeaderMagicP, HeaderMagicF, HeaderMagic2, HeaderLock, …, HeaderDataSize } |
enum | FontReaderException { UnsupportedCmapFormat, InvalidFontHeader, InvalidGlyphMap, GlyphNotFound, InvalidCmapTable, …, DataSizeMismatch } |
enum | HeaderTag { Tag_FontName, Tag_FileName, Tag_FileIndex, Tag_FontRevision, Tag_FreeText, …, Tag_NumTags } |
enum | TagType { StringType, FixedType, UInt8Type, UInt32Type, BitFieldType } |
enum | anonymous { CurrentMajorVersion, CurrentMinorVersion } |
Public Functions
SafeRenderer::quint32 | averageCharWidth() const |
SafeRenderer::quint32 | descent() const |
const SafeRenderer::Glyph * | glyphForCharacter(const SafeRenderer::quint32 chrArg) const |
SafeRenderer::quint32 | pixelSize() const |
Protected Functions
QSafeFont() | |
void | load(const SafeRenderer::quchar *const fontData, const SafeRenderer::quint32 dataSize) |
Member Type Documentation
enum QSafeFont::BlockTag
Constant | Value |
---|---|
SafeRenderer::QSafeFont::CMapBlock | 0 |
SafeRenderer::QSafeFont::GMapBlock | 1 |
SafeRenderer::QSafeFont::GlyphBlock | 2 |
enum QSafeFont::FontHeaderOffset
Constant | Value |
---|---|
SafeRenderer::QSafeFont::HeaderMagicQ | 0U |
SafeRenderer::QSafeFont::HeaderMagicP | 1U |
SafeRenderer::QSafeFont::HeaderMagicF | 2U |
SafeRenderer::QSafeFont::HeaderMagic2 | 3U |
SafeRenderer::QSafeFont::HeaderLock | 4U |
SafeRenderer::QSafeFont::HeaderMajorVersion | 8U |
SafeRenderer::QSafeFont::HeaderMinorVersion | 9U |
SafeRenderer::QSafeFont::HeaderDataSize | 10U |
enum QSafeFont::FontReaderException
This enum describes the exception values in the QSafeFont class.
Constant | Value | Description |
---|---|---|
SafeRenderer::QSafeFont::UnsupportedCmapFormat | 0 | Cmap format in the font file is not supported. |
SafeRenderer::QSafeFont::InvalidFontHeader | 1 | Header in font file is invalid. |
SafeRenderer::QSafeFont::InvalidGlyphMap | 2 | Glyph map in the font file is invalid. |
SafeRenderer::QSafeFont::GlyphNotFound | 3 | Glyph not found for the requested character. |
SafeRenderer::QSafeFont::InvalidCmapTable | 4 | Cmap table in the font file is invalid. |
SafeRenderer::QSafeFont::GlyphMapNotFound | 5 | Glyph map is missing in the font file. |
SafeRenderer::QSafeFont::DataSizeMismatch | 6 | Data index is out of boundary. |
enum QSafeFont::HeaderTag
Constant | Value |
---|---|
SafeRenderer::QSafeFont::Tag_FontName | 0 |
SafeRenderer::QSafeFont::Tag_FileName | 1 |
SafeRenderer::QSafeFont::Tag_FileIndex | 2 |
SafeRenderer::QSafeFont::Tag_FontRevision | 3 |
SafeRenderer::QSafeFont::Tag_FreeText | 4 |
SafeRenderer::QSafeFont::Tag_Ascent | 5 |
SafeRenderer::QSafeFont::Tag_Descent | 6 |
SafeRenderer::QSafeFont::Tag_Leading | 7 |
SafeRenderer::QSafeFont::Tag_XHeight | 8 |
SafeRenderer::QSafeFont::Tag_AverageCharWidth | 9 |
SafeRenderer::QSafeFont::Tag_MaxCharWidth | 10 |
SafeRenderer::QSafeFont::Tag_LineThickness | 11 |
SafeRenderer::QSafeFont::Tag_MinLeftBearing | 12 |
SafeRenderer::QSafeFont::Tag_MinRightBearing | 13 |
SafeRenderer::QSafeFont::Tag_UnderlinePosition | 14 |
SafeRenderer::QSafeFont::Tag_GlyphFormat | 15 |
SafeRenderer::QSafeFont::Tag_PixelSize | 16 |
SafeRenderer::QSafeFont::Tag_Weight | 17 |
SafeRenderer::QSafeFont::Tag_Style | 18 |
SafeRenderer::QSafeFont::Tag_EndOfHeader | 19 |
SafeRenderer::QSafeFont::Tag_WritingSystems | 20 |
SafeRenderer::QSafeFont::Tag_NumTags | 21 |
enum QSafeFont::TagType
Constant | Value |
---|---|
SafeRenderer::QSafeFont::StringType | 0 |
SafeRenderer::QSafeFont::FixedType | 1 |
SafeRenderer::QSafeFont::UInt8Type | 2 |
SafeRenderer::QSafeFont::UInt32Type | 3 |
SafeRenderer::QSafeFont::BitFieldType | 4 |
enum QSafeFont::anonymous
Constant | Value |
---|---|
SafeRenderer::QSafeFont::CurrentMajorVersion | 2 |
SafeRenderer::QSafeFont::CurrentMinorVersion | 0 |
Member Function Documentation
[protected]
QSafeFont::QSafeFont()
Constructs a QSafeFont object.
SafeRenderer::quint32 QSafeFont::averageCharWidth() const
Returns the average character width in font.
SafeRenderer::quint32 QSafeFont::descent() const
Returns the descent size in pixels.
const SafeRenderer::Glyph *QSafeFont::glyphForCharacter(const SafeRenderer::quint32 chrArg) const
Returns a pointer to the Glyph object which contains the alpha map for the requested characher chrArg character, for example 'c'
.
Throws QSafeFont::FontReaderException::GlyphNotFound if the glyph was not found.
[protected]
void QSafeFont::load(const SafeRenderer::quchar *const fontData, const SafeRenderer::quint32 dataSize)
Loads, validates, and parses the fontData with size dataSize.
In case of a invalid font data, one of the following exceptions are thrown:
Constant | Value |
---|---|
SafeRenderer::QSafeFont::FontReaderException::UnsupportedCmapFormat | |
SafeRenderer::QSafeFont::FontReaderException::InvalidFontHeader | |
SafeRenderer::QSafeFont::FontReaderException::InvalidGlyphMap | |
SafeRenderer::QSafeFont::FontReaderException::InvalidCmapTable | |
SafeRenderer::QSafeFont::FontReaderException::DataSizeMismatch |
SafeRenderer::quint32 QSafeFont::pixelSize() const
Returns the pixel size.
Available under certain Qt licenses.
Find out more.