]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/fontenc.h | |
3 | // Purpose: wxFontEncoding constants | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 29.03.00 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Vadim Zeitlin | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_FONTENC_H_ | |
13 | #define _WX_FONTENC_H_ | |
14 | ||
15 | #include "wx/string.h" | |
16 | ||
17 | // font encodings | |
18 | enum wxFontEncoding | |
19 | { | |
20 | wxFONTENCODING_SYSTEM = -1, // system default | |
21 | wxFONTENCODING_DEFAULT, // current default encoding | |
22 | ||
23 | // ISO8859 standard defines a number of single-byte charsets | |
24 | wxFONTENCODING_ISO8859_1, // West European (Latin1) | |
25 | wxFONTENCODING_ISO8859_2, // Central and East European (Latin2) | |
26 | wxFONTENCODING_ISO8859_3, // Esperanto (Latin3) | |
27 | wxFONTENCODING_ISO8859_4, // Baltic (old) (Latin4) | |
28 | wxFONTENCODING_ISO8859_5, // Cyrillic | |
29 | wxFONTENCODING_ISO8859_6, // Arabic | |
30 | wxFONTENCODING_ISO8859_7, // Greek | |
31 | wxFONTENCODING_ISO8859_8, // Hebrew | |
32 | wxFONTENCODING_ISO8859_9, // Turkish (Latin5) | |
33 | wxFONTENCODING_ISO8859_10, // Variation of Latin4 (Latin6) | |
34 | wxFONTENCODING_ISO8859_11, // Thai | |
35 | wxFONTENCODING_ISO8859_12, // doesn't exist currently, but put it | |
36 | // here anyhow to make all ISO8859 | |
37 | // consecutive numbers | |
38 | wxFONTENCODING_ISO8859_13, // Baltic (Latin7) | |
39 | wxFONTENCODING_ISO8859_14, // Latin8 | |
40 | wxFONTENCODING_ISO8859_15, // Latin9 (a.k.a. Latin0, includes euro) | |
41 | wxFONTENCODING_ISO8859_MAX, | |
42 | ||
43 | // Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html) | |
44 | wxFONTENCODING_KOI8, // we don't support any of KOI8 variants | |
45 | wxFONTENCODING_ALTERNATIVE, // same as MS-DOS CP866 | |
46 | wxFONTENCODING_BULGARIAN, // used under Linux in Bulgaria | |
47 | ||
48 | // what would we do without Microsoft? They have their own encodings | |
49 | // for DOS | |
50 | wxFONTENCODING_CP437, // original MS-DOS codepage | |
51 | wxFONTENCODING_CP850, // CP437 merged with Latin1 | |
52 | wxFONTENCODING_CP852, // CP437 merged with Latin2 | |
53 | wxFONTENCODING_CP855, // another cyrillic encoding | |
54 | wxFONTENCODING_CP866, // and another one | |
55 | // and for Windows | |
56 | wxFONTENCODING_CP874, // WinThai | |
57 | wxFONTENCODING_CP932, // Japanese (shift-JIS) | |
58 | wxFONTENCODING_CP936, // Chinese simplified (GB) | |
59 | wxFONTENCODING_CP949, // Korean (Hangul charset) | |
60 | wxFONTENCODING_CP950, // Chinese (traditional - Big5) | |
61 | wxFONTENCODING_CP1250, // WinLatin2 | |
62 | wxFONTENCODING_CP1251, // WinCyrillic | |
63 | wxFONTENCODING_CP1252, // WinLatin1 | |
64 | wxFONTENCODING_CP1253, // WinGreek (8859-7) | |
65 | wxFONTENCODING_CP1254, // WinTurkish | |
66 | wxFONTENCODING_CP1255, // WinHebrew | |
67 | wxFONTENCODING_CP1256, // WinArabic | |
68 | wxFONTENCODING_CP1257, // WinBaltic (same as Latin 7) | |
69 | wxFONTENCODING_CP12_MAX, | |
70 | ||
71 | wxFONTENCODING_UTF7, // UTF-7 Unicode encoding | |
72 | wxFONTENCODING_UTF8, // UTF-8 Unicode encoding | |
73 | ||
74 | // Far Eastern encodings | |
75 | // Chinese | |
76 | wxFONTENCODING_GB2312 = wxFONTENCODING_CP936, // Simplified Chinese | |
77 | wxFONTENCODING_BIG5 = wxFONTENCODING_CP950, // Traditional Chinese | |
78 | ||
79 | // Japanese (see http://zsigri.tripod.com/fontboard/cjk/jis.html) | |
80 | wxFONTENCODING_SHIFT_JIS = wxFONTENCODING_CP932, // Shift JIS | |
81 | wxFONTENCODING_EUC_JP = wxFONTENCODING_UTF8 + 1, // Extended Unix Codepage | |
82 | // for Japanese | |
83 | ||
84 | wxFONTENCODING_UNICODE, // Unicode (for wxEncodingConverter only) | |
85 | ||
86 | wxFONTENCODING_MAX | |
87 | }; | |
88 | ||
89 | // ---------------------------------------------------------------------------- | |
90 | // types | |
91 | // ---------------------------------------------------------------------------- | |
92 | ||
93 | #if wxUSE_GUI | |
94 | ||
95 | // This private structure specifies all the parameters needed to create a font | |
96 | // with the given encoding on this platform. | |
97 | // | |
98 | // Under X, it contains the last 2 elements of the font specifications | |
99 | // (registry and encoding). | |
100 | // | |
101 | // Under Windows, it contains a number which is one of predefined CHARSET_XXX | |
102 | // values. | |
103 | // | |
104 | // Under all platforms it also contains a facename string which should be | |
105 | // used, if not empty, to create fonts in this encoding (this is the only way | |
106 | // to create a font of non-standard encoding (like KOI8) under Windows - the | |
107 | // facename specifies the encoding then) | |
108 | ||
109 | struct WXDLLEXPORT wxNativeEncodingInfo | |
110 | { | |
111 | wxString facename; // may be empty meaning "any" | |
112 | wxFontEncoding encoding; // so that we know what this struct represents | |
113 | ||
114 | #if defined(__WXMSW__) || defined(__WXPM__) || defined(__WXMAC__) || defined(__WXCOCOA__) // FIXME: __WXCOCOA__ | |
115 | wxNativeEncodingInfo() | |
116 | : facename() | |
117 | , encoding(wxFONTENCODING_SYSTEM) | |
118 | , charset(0) /* ANSI_CHARSET */ | |
119 | { } | |
120 | ||
121 | int charset; | |
122 | #elif defined(_WX_X_FONTLIKE) | |
123 | wxString xregistry, | |
124 | xencoding; | |
125 | #elif defined(__WXGTK20__) | |
126 | // No way to specify this in Pango as this | |
127 | // seems to be handled internally. | |
128 | #elif defined(__WXMGL__) | |
129 | int mglEncoding; | |
130 | #else | |
131 | #error "Unsupported toolkit" | |
132 | #endif | |
133 | ||
134 | // this struct is saved in config by wxFontMapper, so it should know to | |
135 | // serialise itself (implemented in platform-specific code) | |
136 | bool FromString(const wxString& s); | |
137 | wxString ToString() const; | |
138 | }; | |
139 | ||
140 | #endif // wxUSE_GUI | |
141 | ||
142 | #endif // _WX_FONTENC_H_ |