Go to the documentation of this file.
38 #ifndef MWAW_FONT_CONVERTER
39 # define MWAW_FONT_CONVERTER
74 int getId(std::string
const &name, std::string family=
"")
const;
76 std::string
getName(
int macId)
const;
78 void setCorrespondance(
int macId, std::string
const &name, std::string family=
"");
86 void getOdtInfo(
int macId, std::string &name,
int &deltaSize)
const;
90 int unicode(
int macId,
unsigned char c)
const;
98 int unicode(
int macId,
unsigned char c,
unsigned char const *(&str),
int len)
const;
101 static std::string
getValidName(std::string
const &name);
104 mutable shared_ptr<MWAWFontConverterInternal::State>
m_manager;
ConversionData m_unknown200Conv
Internal and Low level: the converter for font 200.
Definition: MWAWFontConverter.cxx:768
static int const s_windowsCP1254Unicode[]
Internal and Low Level: the Windows CP1254 encoding.
Definition: MWAWFontConverter.cxx:542
static int const s_turkishUnicode[]
Internal and Low level: vector (char, unicode) for Turkish font ( diff to mac roman)
Definition: MWAWFontConverter.cxx:189
static int const s_centralEuroUnicode[]
Internal and Low level: vector (char, unicode) for Central european font.
Definition: MWAWFontConverter.cxx:123
Definition: MWAWFontConverter.cxx:626
@ E_DEFAULT
Definition: MWAWFontConverter.hxx:66
@ E_SJIS
Definition: MWAWFontConverter.hxx:66
small structure to speedup unicode
Definition: MWAWFontConverter.cxx:998
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:127
ConversionData m_unknown107Conv
Internal and Low level: the converter for font 107.
Definition: MWAWFontConverter.cxx:764
ConversionData m_windowsCP1250Conv
Internal and Low level: the converter for Windows CP1250.
Definition: MWAWFontConverter.cxx:771
Internal and low level: a class to store a conversion map for character, ...
Definition: MWAWFontConverter.cxx:49
shared_ptr< MWAWFontSJISConverter > m_sjisConverter
a SJIS convertor to convert Shit-JIS font
Definition: MWAWFontConverter.cxx:995
std::map< unsigned char, unsigned long > m_windowsCP1251Map
Internal and Low level: map char -> unicode for Windows CP1251.
Definition: MWAWFontConverter.cxx:718
static int const s_unknown200IncompleteUnicode[]
Internal and Low level: vector (char, unicode) for font 200.
Definition: MWAWFontConverter.cxx:440
std::map< unsigned char, unsigned long > m_dingbatsMap
Internal and Low level: map char -> unicode for dingbats font.
Definition: MWAWFontConverter.cxx:696
std::map< unsigned char, unsigned long > m_wingdingsMap
Internal and Low level: map char -> unicode for wingdings font.
Definition: MWAWFontConverter.cxx:706
static int const s_wingdingsUnicode[]
Internal and Low level: vector (char, unicode) for wingdings font.
Definition: MWAWFontConverter.cxx:340
static int const s_unknown128IncompleteUnicode[]
Internal and Low level: vector (char, unicode) for font 128.
Definition: MWAWFontConverter.cxx:434
ConversionData m_windowsCP1258Conv
Internal and Low level: the converter for Windows CP1258.
Definition: MWAWFontConverter.cxx:787
static int const s_windowsCP1257Unicode[]
Internal and Low Level: the Windows CP1257 encoding.
Definition: MWAWFontConverter.cxx:592
static int const s_windowsCP1253Unicode[]
Internal and Low Level: the Windows CP1253 encoding.
Definition: MWAWFontConverter.cxx:521
ConversionData m_dingbatsConv
Internal and Low level: the converter for dingbats font.
Definition: MWAWFontConverter.cxx:750
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,...
Definition: MWAWFontConverter.cxx:1186
UnicodeCache()
constructor
Definition: MWAWFontConverter.cxx:1000
MWAWFontConverter()
the constructor
Definition: MWAWFontConverter.cxx:1213
std::map< unsigned char, unsigned long > m_symbolMap
Internal and Low level: map char -> unicode for symbol font.
Definition: MWAWFontConverter.cxx:694
ConversionData m_unknown128Conv
Internal and Low level: the converter for font 128.
Definition: MWAWFontConverter.cxx:766
ConversionData m_mathConv
Internal and Low level: the converter for math font.
Definition: MWAWFontConverter.cxx:754
std::map< unsigned char, unsigned long > m_scientificMap
Internal and Low level: map char -> unicode for scientific font.
Definition: MWAWFontConverter.cxx:704
ConversionData m_scientificConv
Internal and Low level: the converter for scientific font.
Definition: MWAWFontConverter.cxx:758
int m_uniqueId
a int used to create new id for a name
Definition: MWAWFontConverter.cxx:992
static int const s_windowsCP1251Unicode[]
Internal and Low Level: the Windows CP1251 encoding.
Definition: MWAWFontConverter.cxx:493
long m_nameIdCounter
actual counter
Definition: MWAWFontConverter.cxx:1002
ConversionData m_windowsCP1254Conv
Internal and Low level: the converter for Windows CP1254.
Definition: MWAWFontConverter.cxx:779
int m_macId
actual macId
Definition: MWAWFontConverter.cxx:1004
a namespace used to convert Mac SJIS font characters in unicode
Definition: MWAWFontSJISConverter.hxx:48
std::map< std::string, int > m_nameIdMap
map font name -> sysid
Definition: MWAWFontConverter.cxx:986
Encoding
the character encoding type
Definition: MWAWFontConverter.hxx:66
void setCorrespondance(int macId, std::string const &name, std::string family="")
fixes the name corresponding to an id
Definition: MWAWFontConverter.cxx:966
ConversionData m_windowsCP1257Conv
Internal and Low level: the converter for Windows CP1257.
Definition: MWAWFontConverter.cxx:785
ConversionData m_cyrillicConv
Internal and Low level: the default converter: cyrillic.
Definition: MWAWFontConverter.cxx:739
std::map< std::string, std::string > m_familyMap
Internal and Low level: map font name -> family font name.
Definition: MWAWFontConverter.cxx:682
ConversionData m_windowsCP1255Conv
Internal and Low level: the converter for Windows CP1255.
Definition: MWAWFontConverter.cxx:781
std::map< unsigned char, unsigned long > m_windowsCP1252Map
Internal and Low level: map char -> unicode for Windows CP1252.
Definition: MWAWFontConverter.cxx:720
ConversionData m_defaultConv
Internal and Low level: the default converter: roman.
Definition: MWAWFontConverter.cxx:735
static int const s_windowsCP1252Unicode[]
Internal and Low Level: the Windows CP1252 encoding.
Definition: MWAWFontConverter.cxx:513
ConversionData m_turkishConv
Internal and Low level: the default converter: turkish.
Definition: MWAWFontConverter.cxx:741
ConversionData m_windowsCP1252Conv
Internal and Low level: the converter for Windows CP1252.
Definition: MWAWFontConverter.cxx:775
ConversionData m_wingdingsConv
Internal and Low level: the converter for wingdings font.
Definition: MWAWFontConverter.cxx:760
int getUnusedId()
returns an unused id
Definition: MWAWFontConverter.cxx:924
std::map< unsigned char, unsigned long > m_windowsCP1256Map
Internal and Low level: map char -> unicode for Windows CP1256.
Definition: MWAWFontConverter.cxx:728
static int const s_windowsCP1250Unicode[]
Internal and Low Level: the Windows CP1250 encoding.
Definition: MWAWFontConverter.cxx:473
std::map< unsigned char, unsigned long > m_windowsCP1255Map
Internal and Low level: map char -> unicode for Windows CP1255.
Definition: MWAWFontConverter.cxx:726
MWAWFontConverter::Encoding m_encoding
the character encoding
Definition: MWAWFontConverter.cxx:59
ConversionData m_zapfChanceryConv
Internal and Low level: the converter for zapfChancery font.
Definition: MWAWFontConverter.cxx:746
static int const s_mathIncompleteUnicode[]
Internal and Low level: vector (char, unicode) for math font.
Definition: MWAWFontConverter.cxx:405
int unicode(int macId, unsigned char c) const
converts a character in unicode
Definition: MWAWFontConverter.cxx:1256
KnownConversion()
constructor
Definition: MWAWFontConverter.cxx:629
std::map< unsigned char, unsigned long > m_SJISMap
Internal and Low level: simplified map char -> unicode for SJIS font.
Definition: MWAWFontConverter.cxx:708
ConversionData m_symbolConv
Internal and Low level: the converter for symbol font.
Definition: MWAWFontConverter.cxx:748
long m_nameIdCounter
Internal: a counter modified when a new correspondance name<->id is found.
Definition: MWAWFontConverter.cxx:989
static void initAMap(int const *arr, size_t numElt, std::map< unsigned char, unsigned long > &map)
Internal and Low level: initializes a map with a vector of numElt elements (char, unicode)
Definition: MWAWFontConverter.cxx:669
ConversionData m_timeConv
Internal and Low level: the converter for times font.
Definition: MWAWFontConverter.cxx:744
State()
the constructor
Definition: MWAWFontConverter.cxx:917
ConversionData m_cursiveConv
Internal and Low level: the converter for cursive font.
Definition: MWAWFontConverter.cxx:752
the default font converter
Definition: MWAWFontConverter.cxx:914
std::map< unsigned char, unsigned long > m_unknown128Map
Internal and Low level: map char -> unicode for font 128.
Definition: MWAWFontConverter.cxx:712
static int const s_windowsCP1255Unicode[]
Internal and Low Level: the Windows CP1255 encoding.
Definition: MWAWFontConverter.cxx:554
std::map< unsigned char, unsigned long > m_cyrillicMap
Internal and Low level: map char -> unicode for cyrillic font.
Definition: MWAWFontConverter.cxx:689
struct MWAWFontConverterInternal::State::UnicodeCache m_unicodeCache
ConversionData m_SJISConv
Internal and Low level: the converter for SJIS font.
Definition: MWAWFontConverter.cxx:762
std::map< unsigned char, unsigned long > m_unknown200Map
Internal and Low level: map char -> unicode for font 200.
Definition: MWAWFontConverter.cxx:714
std::map< unsigned char, unsigned long > m_windowsCP1254Map
Internal and Low level: map char -> unicode for Windows CP1254.
Definition: MWAWFontConverter.cxx:724
int getId(std::string const &name, std::string family="") const
returns an unique id > 255, if unknown
Definition: MWAWFontConverter.cxx:1241
void setFamily(std::string const &fName, std::string const &family)
set a family correspondance
Definition: MWAWFontConverter.cxx:654
void initMaps()
initializes the map
Definition: MWAWFontConverter.cxx:1012
ConversionData m_windowsCP1253Conv
Internal and Low level: the converter for Windows CP1253.
Definition: MWAWFontConverter.cxx:777
static int const s_windowsCP1258Unicode[]
Internal and Low Level: the Windows CP1258 encoding.
Definition: MWAWFontConverter.cxx:610
ConversionData m_centralEuroConv
Internal and Low level: the default converter: central european.
Definition: MWAWFontConverter.cxx:737
void setCorrespondance(int macId, std::string const &name, std::string family="")
fixes the name corresponding to an id
Definition: MWAWFontConverter.cxx:1236
ConversionData(std::map< unsigned char, unsigned long > &map, char const *odtName="", int delta=0)
constructor
Definition: MWAWFontConverter.cxx:51
static int const s_unknown107IncompleteUnicode[]
Internal and Low level: vector (char, unicode) for font 107.
Definition: MWAWFontConverter.cxx:428
static int const s_windowsCP1256Unicode[]
Internal and Low Level: the Windows CP1256 encoding.
Definition: MWAWFontConverter.cxx:573
~MWAWFontConverter()
the destructor
Definition: MWAWFontConverter.cxx:1214
std::map< unsigned char, unsigned long > m_mathMap
Internal and Low level: map char -> unicode for math font.
Definition: MWAWFontConverter.cxx:700
shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:503
std::map< int, std::string > m_idNameMap
map sysid -> font name
Definition: MWAWFontConverter.cxx:984
bool updateCache(int macId)
try to update the cache
Definition: MWAWFontConverter.cxx:1130
static int const s_SJISSimplifiedUnicode[]
Internal and Low level: vector (char, unicode) for SJIS font (see MWAWFontSJISConverter )
Definition: MWAWFontConverter.cxx:445
Internal namespace used to store the data used by MWAWFontConverterInternal.
Definition: MWAWFontConverter.cxx:44
ConversionData m_windowsCP1251Conv
Internal and Low level: the converter for Windows CP1251.
Definition: MWAWFontConverter.cxx:773
Data::ConversionData const & getConversionMaps(std::string fName)
returns the conversion map which corresponds to a name, or the default map
Definition: MWAWFontConverter.cxx:876
int getId(std::string const &name, std::string family="")
returns the identificator for a name, if not set creates one
Definition: MWAWFontConverter.cxx:933
std::map< unsigned char, unsigned long > m_centralEuroMap
Internal and Low level: map char -> unicode for central european font.
Definition: MWAWFontConverter.cxx:687
static int const s_scientificIncompleteUnicode[]
Internal and Low level: vector (char, unicode) for scientific font.
Definition: MWAWFontConverter.cxx:416
int m_deltaSize
the size delta: odtSize = fSize + deltaSize
Definition: MWAWFontConverter.cxx:65
std::map< unsigned char, unsigned long > m_monotypeSortsMap
Internal and Low level: map char -> unicode for monotypeSorts font.
Definition: MWAWFontConverter.cxx:702
static int const s_cursiveIncompleteUnicode[]
Internal and Low level: vector (char, unicode) for cursive font.
Definition: MWAWFontConverter.cxx:397
std::map< unsigned char, unsigned long > m_cursiveMap
Internal and Low level: map char -> unicode for cursive font.
Definition: MWAWFontConverter.cxx:698
ConversionData(std::map< unsigned char, unsigned long > &map, MWAWFontConverter::Encoding encoding, char const *odtName="", int delta=0)
constructor for different encoding
Definition: MWAWFontConverter.cxx:55
int unicode(int macId, unsigned char c)
Definition: MWAWFontConverter.cxx:1145
static std::string getValidName(std::string const &name)
check if a string is valid, if not, convert it to a valid string
Definition: MWAWFontConverter.cxx:1217
a namespace used to convert Mac font characters in unicode
Definition: MWAWFontConverter.hxx:63
static int const s_cyrillicUnicode[]
Internal and Low level: vector (char, unicode) for Cyrillic font.
Definition: MWAWFontConverter.cxx:156
std::string m_name
the odt font name (if empty used the name)
Definition: MWAWFontConverter.cxx:63
std::map< unsigned char, unsigned long > m_unknown107Map
Internal and Low level: map char -> unicode for font 107.
Definition: MWAWFontConverter.cxx:710
static int const s_symbolUnicode[]
Internal and Low level: vector (char, unicode) for symbol font.
Definition: MWAWFontConverter.cxx:195
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,...
Definition: MWAWFontConverter.cxx:1251
std::string getName(int macId)
returns the name corresponding to an id or return std::string("")
Definition: MWAWFontConverter.cxx:944
std::map< unsigned char, unsigned long > & m_conversion
the conversion map character -> unicode
Definition: MWAWFontConverter.cxx:61
std::map< unsigned char, unsigned long > m_windowsCP1257Map
Internal and Low level: map char -> unicode for Windows CP1257.
Definition: MWAWFontConverter.cxx:730
ConversionData m_windowsCP1256Conv
Internal and Low level: the converter for Windows CP1256.
Definition: MWAWFontConverter.cxx:783
MWAWFontConverterInternal::Data::ConversionData const * m_conv
actual convertor
Definition: MWAWFontConverter.cxx:1006
ConversionData m_monotypeSortsConv
Internal and Low level: the converter for monotypeSorts font.
Definition: MWAWFontConverter.cxx:756
static int const s_monotypeSortsUnicode[]
Internal and Low level: vector (char, unicode) for Monotype Sorts font.
Definition: MWAWFontConverter.cxx:283
std::map< unsigned char, unsigned long > m_romanMap
Internal and Low level: map char -> unicode for roman font.
Definition: MWAWFontConverter.cxx:685
std::string getName(int macId) const
returns empty string if unknown
Definition: MWAWFontConverter.cxx:1246
std::map< unsigned char, unsigned long > m_windowsCP1250Map
Internal and Low level: map char -> unicode for Windows CP1250.
Definition: MWAWFontConverter.cxx:716
std::map< unsigned char, unsigned long > m_turkishMap
Internal and Low level: map char -> unicode for turkish font.
Definition: MWAWFontConverter.cxx:691
void initMaps()
Internal and Low level: initializes all the conversion maps.
Definition: MWAWFontConverter.cxx:792
std::map< std::string, ConversionData const * > m_convertMap
the conversiont map fName -> ConversionData
Definition: MWAWFontConverter.cxx:679
ConversionData const & getDefault() const
return the default converter
Definition: MWAWFontConverter.cxx:660
static int const s_romanUnicode[]
Internal and Low level: vector ( char, unicode) for roman font.
Definition: MWAWFontConverter.cxx:70
std::map< unsigned char, unsigned long > m_windowsCP1253Map
Internal and Low level: map char -> unicode for Windows CP1253.
Definition: MWAWFontConverter.cxx:722
std::map< unsigned char, unsigned long > m_windowsCP1258Map
Internal and Low level: map char -> unicode for Windows CP1258.
Definition: MWAWFontConverter.cxx:732
shared_ptr< MWAWFontConverterInternal::State > m_manager
the main manager
Definition: MWAWFontConverter.hxx:104
static int const s_dingbatsUnicode[]
Internal and Low level: vector (char, unicode) for dingbats font.
Definition: MWAWFontConverter.cxx:238
MWAWFontConverterInternal::Data::KnownConversion m_knownConversion
the basic conversion map
Definition: MWAWFontConverter.cxx:982
Generated on Wed Jun 17 2020 06:30:11 for libmwaw by
doxygen 1.8.18