MWAWFontConverterInternal::State Class Reference

the default font converter More...

Classes

struct  UnicodeCache
 small structure to speedup unicode More...
 

Public Member Functions

 State ()
 the constructor
 
int getUnusedId ()
 returns an unused id
 
int getId (std::string const &name, std::string const &family="")
 returns the identificator for a name, if not set creates one
 
std::string getName (int macId)
 returns the name corresponding to an id or return std::string("")
 
int unicode (int macId, unsigned char c)
 
int unicode (int macId, unsigned char c, MWAWInputStreamPtr &input)
 
int unicode (int macId, unsigned char c, unsigned char const *(&str), int len)
 converts a character in unicode, if needed can read the next input caracter in str
 
void getOdtInfo (int macId, std::string &nm, int &deltaSize)
 final font name and a delta which can be used to change the size if no name is found, return "Times New Roman"
 
void setCorrespondance (int macId, std::string const &name, std::string const &family="")
 fixes the name corresponding to an id
 

Protected Member Functions

void initMaps ()
 initializes the map
 
bool updateCache (int macId)
 try to update the cache
 

Protected Attributes

MWAWFontConverterInternal::Data::KnownConversion m_knownConversion
 the basic conversion map
 
std::map< int, std::string > m_idNameMap
 map sysid -> font name
 
std::map< std::string, int > m_nameIdMap
 map font name -> sysid
 
long m_nameIdCounter
 Internal: a counter modified when a new correspondance name<->id is found.
 
int m_uniqueId
 a int used to create new id for a name
 
std::shared_ptr< MWAWFontSJISConverterm_sjisConverter
 a SJIS convertor to convert Shit-JIS font
 
struct MWAWFontConverterInternal::State::UnicodeCache m_unicodeCache
 

Detailed Description

the default font converter

Constructor & Destructor Documentation

◆ State()

MWAWFontConverterInternal::State::State ( )
inline

the constructor

Member Function Documentation

◆ getId()

int MWAWFontConverterInternal::State::getId ( std::string const &  name,
std::string const &  family = "" 
)
inline

returns the identificator for a name, if not set creates one

◆ getName()

std::string MWAWFontConverterInternal::State::getName ( int  macId)
inline

returns the name corresponding to an id or return std::string("")

Referenced by getOdtInfo(), and updateCache().

◆ getOdtInfo()

void MWAWFontConverterInternal::State::getOdtInfo ( int  macId,
std::string &  nm,
int &  deltaSize 
)

final font name and a delta which can be used to change the size if no name is found, return "Times New Roman"

◆ getUnusedId()

int MWAWFontConverterInternal::State::getUnusedId ( )
inline

returns an unused id

Referenced by getId().

◆ initMaps()

void MWAWFontConverterInternal::State::initMaps ( )
protected

initializes the map

Referenced by State().

◆ setCorrespondance()

void MWAWFontConverterInternal::State::setCorrespondance ( int  macId,
std::string const &  name,
std::string const &  family = "" 
)
inline

fixes the name corresponding to an id

Referenced by getId().

◆ unicode() [1/3]

int MWAWFontConverterInternal::State::unicode ( int  macId,
unsigned char  c 
)

◆ unicode() [2/3]

int MWAWFontConverterInternal::State::unicode ( int  macId,
unsigned char  c,
MWAWInputStreamPtr input 
)

◆ unicode() [3/3]

int MWAWFontConverterInternal::State::unicode ( int  macId,
unsigned char  c,
unsigned char const *&  str,
int  len 
)

converts a character in unicode, if needed can read the next input caracter in str

Returns
-1 if the character is not transformed

◆ updateCache()

bool MWAWFontConverterInternal::State::updateCache ( int  macId)
protected

try to update the cache

Referenced by unicode().

Member Data Documentation

◆ m_idNameMap

std::map<int, std::string> MWAWFontConverterInternal::State::m_idNameMap
protected

map sysid -> font name

Referenced by getName(), getUnusedId(), initMaps(), and setCorrespondance().

◆ m_knownConversion

MWAWFontConverterInternal::Data::KnownConversion MWAWFontConverterInternal::State::m_knownConversion
protected

the basic conversion map

Referenced by getOdtInfo(), setCorrespondance(), and updateCache().

◆ m_nameIdCounter

long MWAWFontConverterInternal::State::m_nameIdCounter
protected

Internal: a counter modified when a new correspondance name<->id is found.

Referenced by setCorrespondance(), and updateCache().

◆ m_nameIdMap

std::map<std::string, int> MWAWFontConverterInternal::State::m_nameIdMap
protected

map font name -> sysid

Referenced by getId(), initMaps(), and setCorrespondance().

◆ m_sjisConverter

std::shared_ptr<MWAWFontSJISConverter> MWAWFontConverterInternal::State::m_sjisConverter
protected

a SJIS convertor to convert Shit-JIS font

Referenced by unicode().

◆ m_unicodeCache

struct MWAWFontConverterInternal::State::UnicodeCache MWAWFontConverterInternal::State::m_unicodeCache
protected

Referenced by unicode(), and updateCache().

◆ m_uniqueId

int MWAWFontConverterInternal::State::m_uniqueId
protected

a int used to create new id for a name

Referenced by getUnusedId().


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

Generated on Wed May 3 2023 07:18:29 for libmwaw by doxygen 1.9.6