1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/unix/fontenum.cpp
3 // Purpose: wxFontEnumerator class for MGL
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // ============================================================================
12 // ============================================================================
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
19 #pragma implementation "fontenum.h"
23 #include "wx/dynarray.h"
24 #include "wx/string.h"
27 #include "wx/fontenum.h"
28 #include "wx/fontutil.h"
32 // ============================================================================
34 // ============================================================================
37 // ----------------------------------------------------------------------------
39 // ----------------------------------------------------------------------------
41 bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding
,
45 wxMGLFontFamilyList
*list
= wxTheFontsManager
->GetFamilyList();
46 wxMGLFontFamilyList::Node
*node
;
47 wxMGLFontFamily
*f
= NULL
;
48 wxNativeEncodingInfo info
;
50 if ( encoding
!= wxFONTENCODING_SYSTEM
)
51 wxGetNativeFontEncoding(encoding
, &info
);
53 for (node
= list
->GetFirst(); node
; node
= node
->GetNext())
56 info
.facename
= f
->GetName();
57 if ( (!fixedWidthOnly
|| f
->GetInfo()->isFixed
) &&
58 (encoding
== wxFONTENCODING_SYSTEM
|| wxTestFontEncoding(info
)) )
61 if ( !OnFacename(f
->GetName()) )
69 bool wxFontEnumerator::EnumerateEncodings(const wxString
& family
)
71 static wxFontEncoding encodings
[] =
73 wxFONTENCODING_ISO8859_1
,
74 wxFONTENCODING_ISO8859_2
,
75 wxFONTENCODING_ISO8859_3
,
76 wxFONTENCODING_ISO8859_4
,
77 wxFONTENCODING_ISO8859_5
,
78 wxFONTENCODING_ISO8859_6
,
79 wxFONTENCODING_ISO8859_7
,
80 wxFONTENCODING_ISO8859_8
,
81 wxFONTENCODING_ISO8859_9
,
82 wxFONTENCODING_ISO8859_10
,
83 //wxFONTENCODING_ISO8859_11,
84 //wxFONTENCODING_ISO8859_12,
85 wxFONTENCODING_ISO8859_13
,
86 wxFONTENCODING_ISO8859_14
,
87 wxFONTENCODING_ISO8859_15
,
88 wxFONTENCODING_CP1250
,
89 wxFONTENCODING_CP1251
,
90 wxFONTENCODING_CP1252
,
91 wxFONTENCODING_CP1253
,
92 wxFONTENCODING_CP1254
,
93 wxFONTENCODING_CP1255
,
94 wxFONTENCODING_CP1256
,
95 wxFONTENCODING_CP1257
,
101 static const char *encodingNames
[] =
128 wxNativeEncodingInfo info
;
129 info
.facename
= family
;
131 for (size_t i
= 0; encodings
[i
] != wxFONTENCODING_SYSTEM
; i
++)
133 if ( !wxGetNativeFontEncoding(encodings
[i
], &info
) ||
134 !wxTestFontEncoding(info
) )
136 if ( !OnFontEncoding(family
, encodingNames
[i
]) )