C

QSafeFont Class

class SafeRenderer::QSafeFont

QSafeFont class reads the QPF2 font file. More...

Header: #include <QSafeFont>
Since: QtSafeRenderer 1.1
Inherited By:

SafeRenderer::QSafeFontLoader

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)

Detailed Description

The QSafeFont class reads the QPF2 font file.

Member Type Documentation

enum QSafeFont::BlockTag

ConstantValue
SafeRenderer::QSafeFont::CMapBlock0
SafeRenderer::QSafeFont::GMapBlock1
SafeRenderer::QSafeFont::GlyphBlock2

Enum containing different BlockTags available.

enum QSafeFont::FontHeaderOffset

ConstantValue
SafeRenderer::QSafeFont::HeaderMagicQ0U
SafeRenderer::QSafeFont::HeaderMagicP1U
SafeRenderer::QSafeFont::HeaderMagicF2U
SafeRenderer::QSafeFont::HeaderMagic23U
SafeRenderer::QSafeFont::HeaderLock4U
SafeRenderer::QSafeFont::HeaderMajorVersion8U
SafeRenderer::QSafeFont::HeaderMinorVersion9U
SafeRenderer::QSafeFont::HeaderDataSize10U

Enum containing Offsets for Font Header data.

enum QSafeFont::HeaderTag

ConstantValue
SafeRenderer::QSafeFont::Tag_FontName0
SafeRenderer::QSafeFont::Tag_FileName1
SafeRenderer::QSafeFont::Tag_FileIndex2
SafeRenderer::QSafeFont::Tag_FontRevision3
SafeRenderer::QSafeFont::Tag_FreeText4
SafeRenderer::QSafeFont::Tag_Ascent5
SafeRenderer::QSafeFont::Tag_Descent6
SafeRenderer::QSafeFont::Tag_Leading7
SafeRenderer::QSafeFont::Tag_XHeight8
SafeRenderer::QSafeFont::Tag_AverageCharWidth9
SafeRenderer::QSafeFont::Tag_MaxCharWidth10
SafeRenderer::QSafeFont::Tag_LineThickness11
SafeRenderer::QSafeFont::Tag_MinLeftBearing12
SafeRenderer::QSafeFont::Tag_MinRightBearing13
SafeRenderer::QSafeFont::Tag_UnderlinePosition14
SafeRenderer::QSafeFont::Tag_GlyphFormat15
SafeRenderer::QSafeFont::Tag_PixelSize16
SafeRenderer::QSafeFont::Tag_Weight17
SafeRenderer::QSafeFont::Tag_Style18
SafeRenderer::QSafeFont::Tag_EndOfHeader19
SafeRenderer::QSafeFont::Tag_WritingSystems20
SafeRenderer::QSafeFont::Tag_NumTags21

Enum containing different header tags for data.

enum QSafeFont::TagType

ConstantValue
SafeRenderer::QSafeFont::StringType0
SafeRenderer::QSafeFont::FixedType1
SafeRenderer::QSafeFont::UInt8Type2
SafeRenderer::QSafeFont::UInt32Type3
SafeRenderer::QSafeFont::BitFieldType4

Enum containing different TagTypes available.

enum QSafeFont::anonymous

ConstantValue
SafeRenderer::QSafeFont::CurrentMajorVersion2
SafeRenderer::QSafeFont::CurrentMinorVersion0

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:

ExceptionIdDescription
SafeRenderer::QSafeFontExceptionSafeRenderer::QSafeFontException::SafeFontException::UnsupportedCmapFormatCMap format is unsupported.
SafeRenderer::QSafeFontExceptionSafeRenderer::QSafeFontException::SafeFontException::InvalidFontHeaderFont header is invalid.
SafeRenderer::QSafeFontExceptionSafeRenderer::QSafeFontException::SafeFontException::InvalidGlyphMapGlyphmap is invalid.
SafeRenderer::QSafeFontExceptionSafeRenderer::QSafeFontException::SafeFontException::InvalidCmapTableCMaptable is invalid.
SafeRenderer::QSafeFontExceptionSafeRenderer::QSafeFontException::SafeFontException::DataSizeMismatchData size mismatch.

SafeRenderer::quint32 QSafeFont::pixelSize() const

Returns the pixel size.

Available under certain Qt licenses.
Find out more.