1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/mgl/fontenum.cpp
3 // Purpose: wxFontEnumerator class for MGL
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
17 // ============================================================================
19 // ============================================================================
21 // ----------------------------------------------------------------------------
23 // ----------------------------------------------------------------------------
25 #include "wx/fontenum.h"
28 #include "wx/dynarray.h"
29 #include "wx/string.h"
33 #include "wx/encinfo.h"
34 #include "wx/fontutil.h"
38 // ============================================================================
40 // ============================================================================
43 // ----------------------------------------------------------------------------
45 // ----------------------------------------------------------------------------
47 bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding
,
51 wxMGLFontFamilyList
*list
= wxTheFontsManager
->GetFamilyList();
52 wxMGLFontFamilyList::Node
*node
;
53 wxMGLFontFamily
*f
= NULL
;
54 wxNativeEncodingInfo info
;
56 if ( encoding
!= wxFONTENCODING_SYSTEM
)
57 wxGetNativeFontEncoding(encoding
, &info
);
59 for (node
= list
->GetFirst(); node
; node
= node
->GetNext())
62 info
.facename
= f
->GetName();
63 if ( (!fixedWidthOnly
|| f
->GetInfo()->isFixed
) &&
64 (encoding
== wxFONTENCODING_SYSTEM
|| wxTestFontEncoding(info
)) )
67 if ( !OnFacename(f
->GetName()) )
75 bool wxFontEnumerator::EnumerateEncodings(const wxString
& family
)
77 static wxFontEncoding encodings
[] =
79 wxFONTENCODING_ISO8859_1
,
80 wxFONTENCODING_ISO8859_2
,
81 wxFONTENCODING_ISO8859_3
,
82 wxFONTENCODING_ISO8859_4
,
83 wxFONTENCODING_ISO8859_5
,
84 wxFONTENCODING_ISO8859_6
,
85 wxFONTENCODING_ISO8859_7
,
86 wxFONTENCODING_ISO8859_8
,
87 wxFONTENCODING_ISO8859_9
,
88 wxFONTENCODING_ISO8859_10
,
89 //wxFONTENCODING_ISO8859_11,
90 //wxFONTENCODING_ISO8859_12,
91 wxFONTENCODING_ISO8859_13
,
92 wxFONTENCODING_ISO8859_14
,
93 wxFONTENCODING_ISO8859_15
,
94 wxFONTENCODING_CP1250
,
95 wxFONTENCODING_CP1251
,
96 wxFONTENCODING_CP1252
,
97 wxFONTENCODING_CP1253
,
98 wxFONTENCODING_CP1254
,
99 wxFONTENCODING_CP1255
,
100 wxFONTENCODING_CP1256
,
101 wxFONTENCODING_CP1257
,
104 wxFONTENCODING_SYSTEM
107 static const char *encodingNames
[] =
134 wxNativeEncodingInfo info
;
135 info
.facename
= family
;
137 for (size_t i
= 0; encodings
[i
] != wxFONTENCODING_SYSTEM
; i
++)
139 if ( !wxGetNativeFontEncoding(encodings
[i
], &info
) ||
140 !wxTestFontEncoding(info
) )
142 if ( !OnFontEncoding(family
, encodingNames
[i
]) )