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 // For compilers that support precompilation, includes "wx.h".
19 #include "wx/wxprec.h"
26 #include "wx/dynarray.h"
27 #include "wx/string.h"
30 #include "wx/fontenum.h"
31 #include "wx/encinfo.h"
32 #include "wx/fontutil.h"
36 // ============================================================================
38 // ============================================================================
41 // ----------------------------------------------------------------------------
43 // ----------------------------------------------------------------------------
45 bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding
,
49 wxMGLFontFamilyList
*list
= wxTheFontsManager
->GetFamilyList();
50 wxMGLFontFamilyList::Node
*node
;
51 wxMGLFontFamily
*f
= NULL
;
52 wxNativeEncodingInfo info
;
54 if ( encoding
!= wxFONTENCODING_SYSTEM
)
55 wxGetNativeFontEncoding(encoding
, &info
);
57 for (node
= list
->GetFirst(); node
; node
= node
->GetNext())
60 info
.facename
= f
->GetName();
61 if ( (!fixedWidthOnly
|| f
->GetInfo()->isFixed
) &&
62 (encoding
== wxFONTENCODING_SYSTEM
|| wxTestFontEncoding(info
)) )
65 if ( !OnFacename(f
->GetName()) )
73 bool wxFontEnumerator::EnumerateEncodings(const wxString
& family
)
75 static wxFontEncoding encodings
[] =
77 wxFONTENCODING_ISO8859_1
,
78 wxFONTENCODING_ISO8859_2
,
79 wxFONTENCODING_ISO8859_3
,
80 wxFONTENCODING_ISO8859_4
,
81 wxFONTENCODING_ISO8859_5
,
82 wxFONTENCODING_ISO8859_6
,
83 wxFONTENCODING_ISO8859_7
,
84 wxFONTENCODING_ISO8859_8
,
85 wxFONTENCODING_ISO8859_9
,
86 wxFONTENCODING_ISO8859_10
,
87 //wxFONTENCODING_ISO8859_11,
88 //wxFONTENCODING_ISO8859_12,
89 wxFONTENCODING_ISO8859_13
,
90 wxFONTENCODING_ISO8859_14
,
91 wxFONTENCODING_ISO8859_15
,
92 wxFONTENCODING_CP1250
,
93 wxFONTENCODING_CP1251
,
94 wxFONTENCODING_CP1252
,
95 wxFONTENCODING_CP1253
,
96 wxFONTENCODING_CP1254
,
97 wxFONTENCODING_CP1255
,
98 wxFONTENCODING_CP1256
,
99 wxFONTENCODING_CP1257
,
102 wxFONTENCODING_SYSTEM
105 static const char *encodingNames
[] =
132 wxNativeEncodingInfo info
;
133 info
.facename
= family
;
135 for (size_t i
= 0; encodings
[i
] != wxFONTENCODING_SYSTEM
; i
++)
137 if ( !wxGetNativeFontEncoding(encodings
[i
], &info
) ||
138 !wxTestFontEncoding(info
) )
140 if ( !OnFontEncoding(family
, encodingNames
[i
]) )