X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1e1d0be19102670c4ea8c08ec5b9fd9467dcf02c..6ac23e25b85468c7885f6ab43ca0a45f6458af2e:/src/mac/carbon/fontutil.cpp?ds=inline diff --git a/src/mac/carbon/fontutil.cpp b/src/mac/carbon/fontutil.cpp index c5a0f583d6..6318e4a807 100644 --- a/src/mac/carbon/fontutil.cpp +++ b/src/mac/carbon/fontutil.cpp @@ -6,7 +6,7 @@ // Created: 05.11.99 // RCS-ID: $Id$ // Copyright: (c) 1999 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "fontutil.h" #endif @@ -36,6 +36,7 @@ #include "wx/fontutil.h" #include "wx/fontmap.h" +#include "wx/encinfo.h" #include "wx/tokenzr.h" @@ -48,18 +49,12 @@ // ---------------------------------------------------------------------------- // convert to/from the string representation: format is -// encodingid;facename[;charset] +// facename[;charset] bool wxNativeEncodingInfo::FromString(const wxString& s) { wxStringTokenizer tokenizer(s, _T(";")); - wxString encid = tokenizer.GetNextToken(); - long enc; - if ( !encid.ToLong(&enc) ) - return FALSE; - encoding = (wxFontEncoding)enc; - facename = tokenizer.GetNextToken(); if ( !facename ) return FALSE; @@ -85,10 +80,7 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) wxString wxNativeEncodingInfo::ToString() const { - wxString s; - - s << (long)encoding << _T(';') << facename; - + wxString s(facename); if ( charset != 0 ) { s << _T(';') << charset; @@ -111,60 +103,15 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, encoding = wxFont::GetDefaultEncoding(); } - switch ( encoding ) - { - // although this function is supposed to return an exact match, do do - // some mappings here for the most common case of "standard" encoding - case wxFONTENCODING_SYSTEM: - case wxFONTENCODING_ISO8859_1: - case wxFONTENCODING_ISO8859_15: - case wxFONTENCODING_CP1252: - info->charset = 0; - break; - - case wxFONTENCODING_CP1250: - info->charset = 0; - break; - - case wxFONTENCODING_CP1251: - info->charset = 0; - break; - - case wxFONTENCODING_CP1253: - info->charset = 0; - break; - - case wxFONTENCODING_CP1254: - info->charset = 0; - break; - - case wxFONTENCODING_CP1255: - info->charset = 0; - break; - - case wxFONTENCODING_CP1256: - info->charset = 0; - break; - - case wxFONTENCODING_CP1257: - info->charset = 0; - break; - - case wxFONTENCODING_CP437: - info->charset = 0; - break; - - default: - // no way to translate this encoding into a Windows charset - return FALSE; - } - - info->encoding = encoding; + info->encoding = encoding ; return TRUE; } bool wxTestFontEncoding(const wxNativeEncodingInfo& info) { - return TRUE; + // basically we should be able to support every encoding via the OS + return true ; } + +