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 std::shared_ptr<MWAWFontConverterInternal::State>
m_manager;
ConversionData m_unknown200Conv
Internal and Low level: the converter for font 200.
Definition: MWAWFontConverter.cxx:814
static int const s_windowsCP1254Unicode[]
Internal and Low Level: the Windows CP1254 encoding.
Definition: MWAWFontConverter.cxx:552
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
static int const s_turkishUnicode[]
Internal and Low level: vector (char, unicode) for Turkish font ( diff to mac roman)
Definition: MWAWFontConverter.cxx:199
static int const s_centralEuroUnicode[]
Internal and Low level: vector (char, unicode) for Central european font.
Definition: MWAWFontConverter.cxx:133
Definition: MWAWFontConverter.cxx:636
@ E_DEFAULT
Definition: MWAWFontConverter.hxx:66
@ E_SJIS
Definition: MWAWFontConverter.hxx:66
small structure to speedup unicode
Definition: MWAWFontConverter.cxx:1050
#define MWAW_DEBUG_MSG(M)
Definition: libmwaw_internal.hxx:129
ConversionData m_unknown107Conv
Internal and Low level: the converter for font 107.
Definition: MWAWFontConverter.cxx:810
ConversionData m_windowsCP1250Conv
Internal and Low level: the converter for Windows CP1250.
Definition: MWAWFontConverter.cxx:817
Internal and low level: a class to store a conversion map for character, ...
Definition: MWAWFontConverter.cxx:49
std::map< unsigned char, unsigned long > m_windowsCP1251Map
Internal and Low level: map char -> unicode for Windows CP1251.
Definition: MWAWFontConverter.cxx:764
static int const s_unknown200IncompleteUnicode[]
Internal and Low level: vector (char, unicode) for font 200.
Definition: MWAWFontConverter.cxx:450
std::map< unsigned char, unsigned long > m_dingbatsMap
Internal and Low level: map char -> unicode for dingbats font.
Definition: MWAWFontConverter.cxx:742
std::map< unsigned char, unsigned long > m_wingdingsMap
Internal and Low level: map char -> unicode for wingdings font.
Definition: MWAWFontConverter.cxx:752
static int const s_wingdingsUnicode[]
Internal and Low level: vector (char, unicode) for wingdings font.
Definition: MWAWFontConverter.cxx:350
static int const s_unknown128IncompleteUnicode[]
Internal and Low level: vector (char, unicode) for font 128.
Definition: MWAWFontConverter.cxx:444
ConversionData m_windowsCP1258Conv
Internal and Low level: the converter for Windows CP1258.
Definition: MWAWFontConverter.cxx:833
static int const s_windowsCP1257Unicode[]
Internal and Low Level: the Windows CP1257 encoding.
Definition: MWAWFontConverter.cxx:602
static int const s_windowsCP1253Unicode[]
Internal and Low Level: the Windows CP1253 encoding.
Definition: MWAWFontConverter.cxx:531
ConversionData m_dingbatsConv
Internal and Low level: the converter for dingbats font.
Definition: MWAWFontConverter.cxx:796
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:1241
UnicodeCache()
constructor
Definition: MWAWFontConverter.cxx:1052
MWAWFontConverter()
the constructor
Definition: MWAWFontConverter.cxx:1268
int getId(std::string const &name, std::string const &family="")
returns the identificator for a name, if not set creates one
Definition: MWAWFontConverter.cxx:985
std::map< unsigned char, unsigned long > m_symbolMap
Internal and Low level: map char -> unicode for symbol font.
Definition: MWAWFontConverter.cxx:740
ConversionData m_unknown128Conv
Internal and Low level: the converter for font 128.
Definition: MWAWFontConverter.cxx:812
ConversionData m_mathConv
Internal and Low level: the converter for math font.
Definition: MWAWFontConverter.cxx:800
std::map< unsigned char, unsigned long > m_scientificMap
Internal and Low level: map char -> unicode for scientific font.
Definition: MWAWFontConverter.cxx:750
ConversionData m_scientificConv
Internal and Low level: the converter for scientific font.
Definition: MWAWFontConverter.cxx:804
int m_uniqueId
a int used to create new id for a name
Definition: MWAWFontConverter.cxx:1044
static int const s_windowsCP1251Unicode[]
Internal and Low Level: the Windows CP1251 encoding.
Definition: MWAWFontConverter.cxx:503
long m_nameIdCounter
actual counter
Definition: MWAWFontConverter.cxx:1059
ConversionData m_windowsCP1254Conv
Internal and Low level: the converter for Windows CP1254.
Definition: MWAWFontConverter.cxx:825
int m_macId
actual macId
Definition: MWAWFontConverter.cxx:1061
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:1038
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:1018
ConversionData m_windowsCP1257Conv
Internal and Low level: the converter for Windows CP1257.
Definition: MWAWFontConverter.cxx:831
ConversionData m_cyrillicConv
Internal and Low level: the default converter: cyrillic.
Definition: MWAWFontConverter.cxx:785
std::map< std::string, std::string > m_familyMap
Internal and Low level: map font name -> family font name.
Definition: MWAWFontConverter.cxx:728
ConversionData m_windowsCP1255Conv
Internal and Low level: the converter for Windows CP1255.
Definition: MWAWFontConverter.cxx:827
std::map< unsigned char, unsigned long > m_windowsCP1252Map
Internal and Low level: map char -> unicode for Windows CP1252.
Definition: MWAWFontConverter.cxx:766
ConversionData m_defaultConv
Internal and Low level: the default converter: roman.
Definition: MWAWFontConverter.cxx:781
static int const s_windowsCP1252Unicode[]
Internal and Low Level: the Windows CP1252 encoding.
Definition: MWAWFontConverter.cxx:523
ConversionData m_turkishConv
Internal and Low level: the default converter: turkish.
Definition: MWAWFontConverter.cxx:787
ConversionData m_windowsCP1252Conv
Internal and Low level: the converter for Windows CP1252.
Definition: MWAWFontConverter.cxx:821
std::shared_ptr< MWAWFontConverterInternal::State > m_manager
the main manager
Definition: MWAWFontConverter.hxx:104
ConversionData m_wingdingsConv
Internal and Low level: the converter for wingdings font.
Definition: MWAWFontConverter.cxx:806
int getUnusedId()
returns an unused id
Definition: MWAWFontConverter.cxx:976
std::map< unsigned char, unsigned long > m_windowsCP1256Map
Internal and Low level: map char -> unicode for Windows CP1256.
Definition: MWAWFontConverter.cxx:774
static int const s_windowsCP1250Unicode[]
Internal and Low Level: the Windows CP1250 encoding.
Definition: MWAWFontConverter.cxx:483
std::map< unsigned char, unsigned long > m_windowsCP1255Map
Internal and Low level: map char -> unicode for Windows CP1255.
Definition: MWAWFontConverter.cxx:772
MWAWFontConverter::Encoding m_encoding
the character encoding
Definition: MWAWFontConverter.cxx:69
ConversionData m_zapfChanceryConv
Internal and Low level: the converter for zapfChancery font.
Definition: MWAWFontConverter.cxx:792
static int const s_mathIncompleteUnicode[]
Internal and Low level: vector (char, unicode) for math font.
Definition: MWAWFontConverter.cxx:415
int unicode(int macId, unsigned char c) const
converts a character in unicode
Definition: MWAWFontConverter.cxx:1316
KnownConversion()
constructor
Definition: MWAWFontConverter.cxx:639
std::map< unsigned char, unsigned long > m_SJISMap
Internal and Low level: simplified map char -> unicode for SJIS font.
Definition: MWAWFontConverter.cxx:754
ConversionData m_symbolConv
Internal and Low level: the converter for symbol font.
Definition: MWAWFontConverter.cxx:794
long m_nameIdCounter
Internal: a counter modified when a new correspondance name<->id is found.
Definition: MWAWFontConverter.cxx:1041
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:715
ConversionData m_timeConv
Internal and Low level: the converter for times font.
Definition: MWAWFontConverter.cxx:790
State()
the constructor
Definition: MWAWFontConverter.cxx:963
ConversionData m_cursiveConv
Internal and Low level: the converter for cursive font.
Definition: MWAWFontConverter.cxx:798
the default font converter
Definition: MWAWFontConverter.cxx:960
std::map< unsigned char, unsigned long > m_unknown128Map
Internal and Low level: map char -> unicode for font 128.
Definition: MWAWFontConverter.cxx:758
static int const s_windowsCP1255Unicode[]
Internal and Low Level: the Windows CP1255 encoding.
Definition: MWAWFontConverter.cxx:564
std::map< unsigned char, unsigned long > m_cyrillicMap
Internal and Low level: map char -> unicode for cyrillic font.
Definition: MWAWFontConverter.cxx:735
struct MWAWFontConverterInternal::State::UnicodeCache m_unicodeCache
ConversionData m_SJISConv
Internal and Low level: the converter for SJIS font.
Definition: MWAWFontConverter.cxx:808
std::map< unsigned char, unsigned long > m_unknown200Map
Internal and Low level: map char -> unicode for font 200.
Definition: MWAWFontConverter.cxx:760
std::map< unsigned char, unsigned long > m_windowsCP1254Map
Internal and Low level: map char -> unicode for Windows CP1254.
Definition: MWAWFontConverter.cxx:770
int getId(std::string const &name, std::string family="") const
returns an unique id > 255, if unknown
Definition: MWAWFontConverter.cxx:1301
void setFamily(std::string const &fName, std::string const &family)
set a family correspondance
Definition: MWAWFontConverter.cxx:700
void initMaps()
initializes the map
Definition: MWAWFontConverter.cxx:1069
ConversionData m_windowsCP1253Conv
Internal and Low level: the converter for Windows CP1253.
Definition: MWAWFontConverter.cxx:823
static int const s_windowsCP1258Unicode[]
Internal and Low Level: the Windows CP1258 encoding.
Definition: MWAWFontConverter.cxx:620
ConversionData m_centralEuroConv
Internal and Low level: the default converter: central european.
Definition: MWAWFontConverter.cxx:783
void setCorrespondance(int macId, std::string const &name, std::string family="")
fixes the name corresponding to an id
Definition: MWAWFontConverter.cxx:1296
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:438
static int const s_windowsCP1256Unicode[]
Internal and Low Level: the Windows CP1256 encoding.
Definition: MWAWFontConverter.cxx:583
~MWAWFontConverter()
the destructor
Definition: MWAWFontConverter.cxx:1272
std::map< unsigned char, unsigned long > m_mathMap
Internal and Low level: map char -> unicode for math font.
Definition: MWAWFontConverter.cxx:746
std::map< int, std::string > m_idNameMap
map sysid -> font name
Definition: MWAWFontConverter.cxx:1036
bool updateCache(int macId)
try to update the cache
Definition: MWAWFontConverter.cxx:1186
static int const s_SJISSimplifiedUnicode[]
Internal and Low level: vector (char, unicode) for SJIS font (see MWAWFontSJISConverter )
Definition: MWAWFontConverter.cxx:455
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:819
Data::ConversionData const & getConversionMaps(std::string fName)
returns the conversion map which corresponds to a name, or the default map
Definition: MWAWFontConverter.cxx:922
std::map< unsigned char, unsigned long > m_centralEuroMap
Internal and Low level: map char -> unicode for central european font.
Definition: MWAWFontConverter.cxx:733
static int const s_scientificIncompleteUnicode[]
Internal and Low level: vector (char, unicode) for scientific font.
Definition: MWAWFontConverter.cxx:426
int m_deltaSize
the size delta: odtSize = fSize + deltaSize
Definition: MWAWFontConverter.cxx:75
std::map< unsigned char, unsigned long > m_monotypeSortsMap
Internal and Low level: map char -> unicode for monotypeSorts font.
Definition: MWAWFontConverter.cxx:748
static int const s_cursiveIncompleteUnicode[]
Internal and Low level: vector (char, unicode) for cursive font.
Definition: MWAWFontConverter.cxx:407
std::map< unsigned char, unsigned long > m_cursiveMap
Internal and Low level: map char -> unicode for cursive font.
Definition: MWAWFontConverter.cxx:744
ConversionData(std::map< unsigned char, unsigned long > &map, MWAWFontConverter::Encoding encoding, char const *odtName="", int delta=0)
constructor for different encoding
Definition: MWAWFontConverter.cxx:60
std::shared_ptr< MWAWFontSJISConverter > m_sjisConverter
a SJIS convertor to convert Shit-JIS font
Definition: MWAWFontConverter.cxx:1047
int unicode(int macId, unsigned char c)
Definition: MWAWFontConverter.cxx:1201
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:1277
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:166
std::string m_name
the odt font name (if empty used the name)
Definition: MWAWFontConverter.cxx:73
std::map< unsigned char, unsigned long > m_unknown107Map
Internal and Low level: map char -> unicode for font 107.
Definition: MWAWFontConverter.cxx:756
static int const s_symbolUnicode[]
Internal and Low level: vector (char, unicode) for symbol font.
Definition: MWAWFontConverter.cxx:205
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:1311
std::string getName(int macId)
returns the name corresponding to an id or return std::string("")
Definition: MWAWFontConverter.cxx:996
std::map< unsigned char, unsigned long > & m_conversion
the conversion map character -> unicode
Definition: MWAWFontConverter.cxx:71
std::map< unsigned char, unsigned long > m_windowsCP1257Map
Internal and Low level: map char -> unicode for Windows CP1257.
Definition: MWAWFontConverter.cxx:776
ConversionData m_windowsCP1256Conv
Internal and Low level: the converter for Windows CP1256.
Definition: MWAWFontConverter.cxx:829
MWAWFontConverterInternal::Data::ConversionData const * m_conv
actual convertor
Definition: MWAWFontConverter.cxx:1063
ConversionData m_monotypeSortsConv
Internal and Low level: the converter for monotypeSorts font.
Definition: MWAWFontConverter.cxx:802
static int const s_monotypeSortsUnicode[]
Internal and Low level: vector (char, unicode) for Monotype Sorts font.
Definition: MWAWFontConverter.cxx:293
std::map< unsigned char, unsigned long > m_romanMap
Internal and Low level: map char -> unicode for roman font.
Definition: MWAWFontConverter.cxx:731
std::string getName(int macId) const
returns empty string if unknown
Definition: MWAWFontConverter.cxx:1306
std::map< unsigned char, unsigned long > m_windowsCP1250Map
Internal and Low level: map char -> unicode for Windows CP1250.
Definition: MWAWFontConverter.cxx:762
std::map< unsigned char, unsigned long > m_turkishMap
Internal and Low level: map char -> unicode for turkish font.
Definition: MWAWFontConverter.cxx:737
void initMaps()
Internal and Low level: initializes all the conversion maps.
Definition: MWAWFontConverter.cxx:838
std::map< std::string, ConversionData const * > m_convertMap
the conversiont map fName -> ConversionData
Definition: MWAWFontConverter.cxx:725
ConversionData const & getDefault() const
return the default converter
Definition: MWAWFontConverter.cxx:706
static int const s_romanUnicode[]
Internal and Low level: vector ( char, unicode) for roman font.
Definition: MWAWFontConverter.cxx:80
std::map< unsigned char, unsigned long > m_windowsCP1253Map
Internal and Low level: map char -> unicode for Windows CP1253.
Definition: MWAWFontConverter.cxx:768
std::map< unsigned char, unsigned long > m_windowsCP1258Map
Internal and Low level: map char -> unicode for Windows CP1258.
Definition: MWAWFontConverter.cxx:778
static int const s_dingbatsUnicode[]
Internal and Low level: vector (char, unicode) for dingbats font.
Definition: MWAWFontConverter.cxx:248
MWAWFontConverterInternal::Data::KnownConversion m_knownConversion
the basic conversion map
Definition: MWAWFontConverter.cxx:1034
Generated on Fri Sep 18 2020 18:14:52 for libmwaw by
doxygen 1.8.20