C
QSafeFont Class
class SafeRenderer::QSafeFontQSafeFont class reads the QPF2 font file. More...
Header: | #include <QSafeFont> |
Since: | QtSafeRenderer 1.1 |
Inherited By: |
Public Types
enum | BlockTag { CMapBlock, GMapBlock, GlyphBlock } |
enum | FontHeaderOffset { HeaderMagicQ, HeaderMagicP, HeaderMagicF, HeaderMagic2, HeaderLock, …, HeaderDataSize } |
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 containing different BlockTags available.
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 containing Offsets for Font Header data.
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 containing different header tags for data.
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 containing different TagTypes available.
enum QSafeFont::anonymous
Constant | Value |
---|---|
SafeRenderer::QSafeFont::CurrentMajorVersion | 2 |
SafeRenderer::QSafeFont::CurrentMinorVersion | 0 |
Enum containing versioning tags.
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 QSafeFontException with id QSafeFontException::SafeFontException::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:
Exception | Id | Description |
---|---|---|
SafeRenderer::QSafeFontException | SafeRenderer::QSafeFontException::SafeFontException::UnsupportedCmapFormat | CMap format is unsupported. |
SafeRenderer::QSafeFontException | SafeRenderer::QSafeFontException::SafeFontException::InvalidFontHeader | Font header is invalid. |
SafeRenderer::QSafeFontException | SafeRenderer::QSafeFontException::SafeFontException::InvalidGlyphMap | Glyphmap is invalid. |
SafeRenderer::QSafeFontException | SafeRenderer::QSafeFontException::SafeFontException::InvalidCmapTable | CMaptable is invalid. |
SafeRenderer::QSafeFontException | SafeRenderer::QSafeFontException::SafeFontException::DataSizeMismatch | Data size mismatch. |
SafeRenderer::quint32 QSafeFont::pixelSize() const
Returns the pixel size.
Available under certain Qt licenses.
Find out more.