GL Studio C++ Runtime API
GlsUnicodeFontDBUFReader Class Reference

#include <gls_unicode_font_base.h>

Public Member Functions

 GlsUnicodeFontDBUFReader (const unsigned char *const *inlineDBUFData, const unsigned int lineLength, const unsigned int totalInlineSize, const bool isCompressed, unsigned long uncompressedSize)
 
 GlsUnicodeFontDBUFReader (const unsigned char *const dbufData, const unsigned int dbufDataLength)
 
 ~GlsUnicodeFontDBUFReader ()
 
GlsFontBase::FontAttr_t GetGlsFontBaseFontAttributes ()
 
GlsFontBase::AttrCont_t GetGlsFontBaseCharAttributes ()
 
ImageGetGlsFontBaseTexture ()
 
GlsUnicodeFontBase::FontAttrUnicode_t GetGlsUnicodeFontBaseFontAttributes ()
 
GlsUnicodeFontBase::AttrContUnicode_t GetGlsUnicodeFontBaseCharAttributes ()
 
std::vector< Image * > GetGlsUnicodeFontBaseTextures ()
 
bool IsValid () const
 
std::string GetErrorMsg () const
 

Protected Member Functions

void InitializeFromDBUF (const unsigned char *const dbufData, const unsigned int dbufDataLength)
 

Protected Attributes

bool _isValid
 
std::string _errMsg
 
GlsUnicodeFontBase::FontAttrUnicode_t _fontAttrUnicode
 
GlsUnicodeFontBase::AttrContUnicode_t _charAttrUnicode
 
std::vector< Image * > _fontTextures
 

Detailed Description

helper class for reading a binary unicode font (DBUF)

Constructor & Destructor Documentation

◆ GlsUnicodeFontDBUFReader() [1/2]

GlsUnicodeFontDBUFReader ( const unsigned char *const *  inlineDBUFData,
const unsigned int  lineLength,
const unsigned int  totalInlineSize,
const bool  isCompressed,
unsigned long  uncompressedSize 
)

ctor – construct from inline data (optionally compressed)

Parameters
inlineDBUFDatainline DBUF data to read
lineLengthlength of lines in inline data
totalInlineSizetotal number of bytes (not including NULL terminators) of inline data
isCompressedtrue if dbuf data is zlib compressed else false
uncompressedSizeuncompressed size of data if isCompressed else ignored

◆ GlsUnicodeFontDBUFReader() [2/2]

GlsUnicodeFontDBUFReader ( const unsigned char *const  dbufData,
const unsigned int  dbufDataLength 
)

ctor – construct from noninline data (not compressed)

Parameters
dbufDataDBUF data to read
dbufDataLengthnumber of bytes of data in dbufData

◆ ~GlsUnicodeFontDBUFReader()

Member Function Documentation

◆ GetErrorMsg()

std::string GetErrorMsg ( ) const

Get an error message if !IsValid()

Returns
an error message if !IsValid()

◆ GetGlsFontBaseCharAttributes()

GlsFontBase::AttrCont_t GetGlsFontBaseCharAttributes ( )

Get the GlsFontBase::AttrCont_t associated with the unicode font

Returns
the GlsFontBase::AttrCont_t associated with the unicode font

◆ GetGlsFontBaseFontAttributes()

GlsFontBase::FontAttr_t GetGlsFontBaseFontAttributes ( )

Get the GlsFontBase::FontAttr_t associated with the unicode font

Returns
the GlsFontBase::FontAttr_t associated with the unicode font

◆ GetGlsFontBaseTexture()

Image * GetGlsFontBaseTexture ( )

Get the first image associated with the unicode font (suitable for use by GlsFontBase)

Returns
the first image associated with the unicode font (suitable for use by GlsFontBase)
Note
will increase usage count on texture by one so caller should call DeleteUsage when texture is no longer needed

◆ GetGlsUnicodeFontBaseCharAttributes()

GlsUnicodeFontBase::AttrContUnicode_t GetGlsUnicodeFontBaseCharAttributes ( )

Get the GlsUnicodeFontBase::AttrContUnicode_t associated with the unicode font

Returns
the GlsFontBase::AttrContUnicode_t associated with the unicode font

◆ GetGlsUnicodeFontBaseFontAttributes()

GlsUnicodeFontBase::FontAttrUnicode_t GetGlsUnicodeFontBaseFontAttributes ( )

Get the GlsUnicodeFontBase::FontAttrUnicode_t associated with the unicode font

Returns
the GlsFontBase::FontAttrUnicode_t associated with the unicode font

◆ GetGlsUnicodeFontBaseTextures()

std::vector< Image * > GetGlsUnicodeFontBaseTextures ( )

Get the textures associated with the unicode font

Returns
the textures associated with the unicode font
Note
each texture will have its usage count increased by one so caller should call DeleteUsage on each texture when they are no longer needed

◆ InitializeFromDBUF()

void InitializeFromDBUF ( const unsigned char *const  dbufData,
const unsigned int  dbufDataLength 
)
protected

initialize the reader from the given DBUF data

Parameters
dbufDataDBUF data to read
dbufDataLengthnumber of bytes of data in dbufData

◆ IsValid()

bool IsValid ( ) const

Determine if a valid DBUF was read

Returns
true if a valid DBUF was read else false

Member Data Documentation

◆ _charAttrUnicode

GlsUnicodeFontBase::AttrContUnicode_t _charAttrUnicode
protected

unicode char attributes read from DBUF data

◆ _errMsg

std::string _errMsg
protected

error message if !IsValid()

◆ _fontAttrUnicode

GlsUnicodeFontBase::FontAttrUnicode_t _fontAttrUnicode
protected

unicode font attributes read from DBUF data

◆ _fontTextures

std::vector<Image*> _fontTextures
protected

font textures read from DBUF data

◆ _isValid

bool _isValid
protected

true if a valid DBUF was read else false


The documentation for this class was generated from the following file: