1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/unix/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 // ============================================================================
12 // ============================================================================
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
18 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
19 #pragma implementation "fontenum.h"
22 // For compilers that support precompilation, includes "wx.h".
23 #include "wx/wxprec.h"
30 #include "wx/dynarray.h"
31 #include "wx/string.h"
34 #include "wx/fontenum.h"
35 #include "wx/encinfo.h"
36 #include "wx/fontutil.h"
40 // ============================================================================
42 // ============================================================================
45 // ----------------------------------------------------------------------------
47 // ----------------------------------------------------------------------------
49 bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding
,
53 wxMGLFontFamilyList
*list
= wxTheFontsManager
->GetFamilyList();
54 wxMGLFontFamilyList::Node
*node
;
55 wxMGLFontFamily
*f
= NULL
;
56 wxNativeEncodingInfo info
;
58 if ( encoding
!= wxFONTENCODING_SYSTEM
)
59 wxGetNativeFontEncoding(encoding
, &info
);
61 for (node
= list
->GetFirst(); node
; node
= node
->GetNext())
64 info
.facename
= f
->GetName();
65 if ( (!fixedWidthOnly
|| f
->GetInfo()->isFixed
) &&
66 (encoding
== wxFONTENCODING_SYSTEM
|| wxTestFontEncoding(info
)) )
69 if ( !OnFacename(f
->GetName()) )
77 bool wxFontEnumerator::EnumerateEncodings(const wxString
& family
)
79 static wxFontEncoding encodings
[] =
81 wxFONTENCODING_ISO8859_1
,
82 wxFONTENCODING_ISO8859_2
,
83 wxFONTENCODING_ISO8859_3
,
84 wxFONTENCODING_ISO8859_4
,
85 wxFONTENCODING_ISO8859_5
,
86 wxFONTENCODING_ISO8859_6
,
87 wxFONTENCODING_ISO8859_7
,
88 wxFONTENCODING_ISO8859_8
,
89 wxFONTENCODING_ISO8859_9
,
90 wxFONTENCODING_ISO8859_10
,
91 //wxFONTENCODING_ISO8859_11,
92 //wxFONTENCODING_ISO8859_12,
93 wxFONTENCODING_ISO8859_13
,
94 wxFONTENCODING_ISO8859_14
,
95 wxFONTENCODING_ISO8859_15
,
96 wxFONTENCODING_CP1250
,
97 wxFONTENCODING_CP1251
,
98 wxFONTENCODING_CP1252
,
99 wxFONTENCODING_CP1253
,
100 wxFONTENCODING_CP1254
,
101 wxFONTENCODING_CP1255
,
102 wxFONTENCODING_CP1256
,
103 wxFONTENCODING_CP1257
,
106 wxFONTENCODING_SYSTEM
109 static const char *encodingNames
[] =
136 wxNativeEncodingInfo info
;
137 info
.facename
= family
;
139 for (size_t i
= 0; encodings
[i
] != wxFONTENCODING_SYSTEM
; i
++)
141 if ( !wxGetNativeFontEncoding(encodings
[i
], &info
) ||
142 !wxTestFontEncoding(info
) )
144 if ( !OnFontEncoding(family
, encodingNames
[i
]) )