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/dynarray.h"
26 #include "wx/string.h"
29 #include "wx/fontenum.h"
30 #include "wx/encinfo.h"
31 #include "wx/fontutil.h"
35 // ============================================================================
37 // ============================================================================
40 // ----------------------------------------------------------------------------
42 // ----------------------------------------------------------------------------
44 bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding
,
48 wxMGLFontFamilyList
*list
= wxTheFontsManager
->GetFamilyList();
49 wxMGLFontFamilyList::Node
*node
;
50 wxMGLFontFamily
*f
= NULL
;
51 wxNativeEncodingInfo info
;
53 if ( encoding
!= wxFONTENCODING_SYSTEM
)
54 wxGetNativeFontEncoding(encoding
, &info
);
56 for (node
= list
->GetFirst(); node
; node
= node
->GetNext())
59 info
.facename
= f
->GetName();
60 if ( (!fixedWidthOnly
|| f
->GetInfo()->isFixed
) &&
61 (encoding
== wxFONTENCODING_SYSTEM
|| wxTestFontEncoding(info
)) )
64 if ( !OnFacename(f
->GetName()) )
72 bool wxFontEnumerator::EnumerateEncodings(const wxString
& family
)
74 static wxFontEncoding encodings
[] =
76 wxFONTENCODING_ISO8859_1
,
77 wxFONTENCODING_ISO8859_2
,
78 wxFONTENCODING_ISO8859_3
,
79 wxFONTENCODING_ISO8859_4
,
80 wxFONTENCODING_ISO8859_5
,
81 wxFONTENCODING_ISO8859_6
,
82 wxFONTENCODING_ISO8859_7
,
83 wxFONTENCODING_ISO8859_8
,
84 wxFONTENCODING_ISO8859_9
,
85 wxFONTENCODING_ISO8859_10
,
86 //wxFONTENCODING_ISO8859_11,
87 //wxFONTENCODING_ISO8859_12,
88 wxFONTENCODING_ISO8859_13
,
89 wxFONTENCODING_ISO8859_14
,
90 wxFONTENCODING_ISO8859_15
,
91 wxFONTENCODING_CP1250
,
92 wxFONTENCODING_CP1251
,
93 wxFONTENCODING_CP1252
,
94 wxFONTENCODING_CP1253
,
95 wxFONTENCODING_CP1254
,
96 wxFONTENCODING_CP1255
,
97 wxFONTENCODING_CP1256
,
98 wxFONTENCODING_CP1257
,
101 wxFONTENCODING_SYSTEM
104 static const char *encodingNames
[] =
131 wxNativeEncodingInfo info
;
132 info
.facename
= family
;
134 for (size_t i
= 0; encodings
[i
] != wxFONTENCODING_SYSTEM
; i
++)
136 if ( !wxGetNativeFontEncoding(encodings
[i
], &info
) ||
137 !wxTestFontEncoding(info
) )
139 if ( !OnFontEncoding(family
, encodingNames
[i
]) )