a namespace used to convert Mac font characters in unicode More...
#include <MWAWFontConverter.hxx>
Public Types | |
| enum | Encoding { E_DEFAULT , E_SJIS } |
| the character encoding type More... | |
Public Member Functions | |
| MWAWFontConverter () | |
| the constructor | |
| ~MWAWFontConverter () | |
| the destructor | |
| int | getId (std::string const &name, std::string family="") const |
| returns an unique id > 255, if unknown | |
| std::string | getName (int macId) const |
| returns empty string if unknown | |
| void | setCorrespondance (int macId, std::string const &name, std::string family="") |
| fixes the name corresponding to an id | |
| void | getOdtInfo (int macId, std::string &name, int &deltaSize) const |
| final font name and a delta which can be used to change the size if no name is found, return "Times New Roman" | |
| int | unicode (int macId, unsigned char c) const |
| converts a character in unicode | |
| int | unicode (int macId, unsigned char c, MWAWInputStreamPtr &input) const |
| converts a character in unicode, if needed can read the next input caracter | |
| int | unicode (int macId, unsigned char c, unsigned char const *(&str), int len) const |
| converts a character in unicode, if needed can read the next input caracter in str | |
Static Protected Member Functions | |
| static std::string | getValidName (std::string const &name) |
| check if a string is valid, if not, convert it to a valid string | |
Protected Attributes | |
| std::shared_ptr< MWAWFontConverterInternal::State > | m_manager |
| the main manager | |
a namespace used to convert Mac font characters in unicode
On old mac system, a font is either determined by a name or an unique id. The standart font have a "fixed" id < 35, the user font can have different id, (ie. when you installed a font with some id, if a font with the same id already exists, a new id will generated for this font). Unfortunatly, Microsoft files seem to only store the font id....
A font also consists in 256 independent characters which are not normalised (and a user can easily modify a characters of a font).
| MWAWFontConverter::MWAWFontConverter | ( | ) |
the constructor
| MWAWFontConverter::~MWAWFontConverter | ( | ) |
the destructor
| int MWAWFontConverter::getId | ( | std::string const & | name, |
| std::string | family = "" ) const |
returns an unique id > 255, if unknown
| std::string MWAWFontConverter::getName | ( | int | macId | ) | const |
returns empty string if unknown
| void MWAWFontConverter::getOdtInfo | ( | int | macId, |
| std::string & | name, | ||
| int & | deltaSize ) const |
final font name and a delta which can be used to change the size if no name is found, return "Times New Roman"
|
staticprotected |
check if a string is valid, if not, convert it to a valid string
Referenced by getId(), and setCorrespondance().
| void MWAWFontConverter::setCorrespondance | ( | int | macId, |
| std::string const & | name, | ||
| std::string | family = "" ) |
fixes the name corresponding to an id
| int MWAWFontConverter::unicode | ( | int | macId, |
| unsigned char | c ) const |
converts a character in unicode
Referenced by MWAWCellContent::FormulaInstruction::getPropertyList().
| int MWAWFontConverter::unicode | ( | int | macId, |
| unsigned char | c, | ||
| MWAWInputStreamPtr & | input ) const |
converts a character in unicode, if needed can read the next input caracter
| int MWAWFontConverter::unicode | ( | int | macId, |
| unsigned char | c, | ||
| unsigned char const *& | str, | ||
| int | len ) const |
converts a character in unicode, if needed can read the next input caracter in str
|
mutableprotected |
the main manager
Referenced by getId(), getName(), getOdtInfo(), setCorrespondance(), unicode(), unicode(), and unicode().