]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/fontutil.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: msw/fontutil.cpp
3 // Purpose: font-related helper functions for wxMSW
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
19 #include "wx/string.h"
24 #include "wx/fontutil.h"
25 #include "wx/fontmap.h"
26 #include "wx/encinfo.h"
27 #include "wx/tokenzr.h"
30 // convert to/from the string representation:
31 // format is facename[;charset]
33 bool wxNativeEncodingInfo::FromString( const wxString
& s
)
35 wxStringTokenizer
tokenizer(s
, wxT(";"));
37 facename
= tokenizer
.GetNextToken();
41 wxString tmp
= tokenizer
.GetNextToken();
44 // default charset (don't use DEFAULT_CHARSET though because of subtle
45 // Windows 9x/NT differences in handling it)
50 if ( wxSscanf( tmp
, wxT("%u"), &charset
) != 1 )
51 // should be a number!
58 wxString
wxNativeEncodingInfo::ToString() const
62 s
<< wxT(';') << charset
;
67 // ----------------------------------------------------------------------------
69 // ----------------------------------------------------------------------------
71 bool wxGetNativeFontEncoding( wxFontEncoding encoding
, wxNativeEncodingInfo
*info
)
73 wxCHECK_MSG( info
, false, wxT("bad pointer in wxGetNativeFontEncoding") );
75 if ( encoding
== wxFONTENCODING_DEFAULT
)
76 encoding
= wxFont::GetDefaultEncoding();
78 info
->encoding
= encoding
;
83 bool wxTestFontEncoding( const wxNativeEncodingInfo
& info
)
85 // basically we should be able to support every encoding via the OS