moved system-fontencoding conversions to fontutil.cpp

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25313 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2004-01-22 18:41:58 +00:00
parent 3af5821cf9
commit 8057c6d68f

View File

@ -1194,12 +1194,12 @@ public:
wxMBConv_mac(const wxChar* name)
{
Init( EncodingToSystem(wxFontMapper::Get()->CharsetToEncoding(name, FALSE) ) ) ;
Init( wxMacGetSystemEncFromFontEnc(wxFontMapper::Get()->CharsetToEncoding(name, FALSE) ) ) ;
}
wxMBConv_mac(wxFontEncoding encoding)
{
Init( EncodingToSystem(encoding) );
Init( wxMacGetSystemEncFromFontEnc(encoding) );
}
~wxMBConv_mac()
@ -1209,143 +1209,6 @@ public:
status = TECDisposeConverter(m_WC2MB_converter);
}
static TextEncodingBase EncodingToSystem(wxFontEncoding encoding)
{
TextEncodingBase enc = CFStringGetSystemEncoding() ;
switch( encoding)
{
case wxFONTENCODING_ISO8859_1 :
enc = kTextEncodingISOLatin1 ;
break ;
case wxFONTENCODING_ISO8859_2 :
enc = kTextEncodingISOLatin2;
break ;
case wxFONTENCODING_ISO8859_3 :
enc = kTextEncodingISOLatin3 ;
break ;
case wxFONTENCODING_ISO8859_4 :
enc = kTextEncodingISOLatin4;
break ;
case wxFONTENCODING_ISO8859_5 :
enc = kTextEncodingISOLatinCyrillic;
break ;
case wxFONTENCODING_ISO8859_6 :
enc = kTextEncodingISOLatinArabic;
break ;
case wxFONTENCODING_ISO8859_7 :
enc = kTextEncodingISOLatinGreek;
break ;
case wxFONTENCODING_ISO8859_8 :
enc = kTextEncodingISOLatinHebrew;
break ;
case wxFONTENCODING_ISO8859_9 :
enc = kTextEncodingISOLatin5;
break ;
case wxFONTENCODING_ISO8859_10 :
enc = kTextEncodingISOLatin6;
break ;
case wxFONTENCODING_ISO8859_13 :
enc = kTextEncodingISOLatin7;
break ;
case wxFONTENCODING_ISO8859_14 :
enc = kTextEncodingISOLatin8;
break ;
case wxFONTENCODING_ISO8859_15 :
enc = kTextEncodingISOLatin9;
break ;
case wxFONTENCODING_KOI8 :
enc = kTextEncodingKOI8_R;
break ;
case wxFONTENCODING_ALTERNATIVE : // MS-DOS CP866
enc = kTextEncodingDOSRussian;
break ;
/*
case wxFONTENCODING_BULGARIAN :
enc = ;
break ;
*/
case wxFONTENCODING_CP437 :
enc =kTextEncodingDOSLatinUS ;
break ;
case wxFONTENCODING_CP850 :
enc = kTextEncodingDOSLatin1;
break ;
case wxFONTENCODING_CP852 :
enc = kTextEncodingDOSLatin2;
break ;
case wxFONTENCODING_CP855 :
enc = kTextEncodingDOSCyrillic;
break ;
case wxFONTENCODING_CP866 :
enc =kTextEncodingDOSRussian ;
break ;
case wxFONTENCODING_CP874 :
enc = kTextEncodingDOSThai;
break ;
case wxFONTENCODING_CP932 :
enc = kTextEncodingDOSJapanese;
break ;
case wxFONTENCODING_CP936 :
enc =kTextEncodingDOSChineseSimplif ;
break ;
case wxFONTENCODING_CP949 :
enc = kTextEncodingDOSKorean;
break ;
case wxFONTENCODING_CP950 :
enc = kTextEncodingDOSChineseTrad;
break ;
case wxFONTENCODING_CP1250 :
enc = kTextEncodingWindowsLatin2;
break ;
case wxFONTENCODING_CP1251 :
enc =kTextEncodingWindowsCyrillic ;
break ;
case wxFONTENCODING_CP1252 :
enc =kTextEncodingWindowsLatin1 ;
break ;
case wxFONTENCODING_CP1253 :
enc = kTextEncodingWindowsGreek;
break ;
case wxFONTENCODING_CP1254 :
enc = kTextEncodingWindowsLatin5;
break ;
case wxFONTENCODING_CP1255 :
enc =kTextEncodingWindowsHebrew ;
break ;
case wxFONTENCODING_CP1256 :
enc =kTextEncodingWindowsArabic ;
break ;
case wxFONTENCODING_CP1257 :
enc = kTextEncodingWindowsBalticRim;
break ;
case wxFONTENCODING_UTF7 :
enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF7Format) ;
break ;
case wxFONTENCODING_UTF8 :
enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicodeUTF8Format) ;
break ;
case wxFONTENCODING_EUC_JP :
enc = kTextEncodingEUC_JP;
break ;
case wxFONTENCODING_UTF16BE :
enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ;
break ;
case wxFONTENCODING_UTF16LE :
enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode16BitFormat) ;
break ;
case wxFONTENCODING_UTF32BE :
enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ;
break ;
case wxFONTENCODING_UTF32LE :
enc = CreateTextEncoding(kTextEncodingUnicodeDefault,0,kUnicode32BitFormat) ;
break ;
} ;
return enc ;
}
void Init( TextEncodingBase encoding)
{