]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/fontenum.tex
note about WX_DEFIN_EOBJARRAY added
[wxWidgets.git] / docs / latex / wx / fontenum.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: fontenum.tex
3 %% Purpose: wxFontEnumerator documentation
4 %% Author: Vadim Zeitlin
5 %% Modified by:
6 %% Created: 03.11.99
7 %% RCS-ID: $Id$
8 %% Copyright: (c) Vadim Zeitlin
9 %% Licence: wxWindows licence
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 \section{\class{wxFontEnumerator}}\label{wxfontenumerator}
13
14 wxFontEnumerator enumerates either all available fonts on the system or only
15 the ones with given attributes - either only fixed-width (suited for use in
16 programs such as terminal emulators and the like) or the fonts available in
17 the given \helpref{encoding}{wxfontencodingoverview}.
18
19 To do this, you just have to call one of EnumerateXXX() functions - either
20 \helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames} or
21 \helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings} and the
22 corresponding callback (
23 \helpref{OnFacename}{wxFontEnumeratoronfacename} or
24 \helpref{OnFontEncoding}{wxfontenumeratoronfontencoding}) will be called
25 repeatedly until either all fonts (satisfying the specified criteria) are
26 exhausted or the callback returns FALSE.
27
28 \wxheading{Virtual functions to override}
29
30 Either \helpref{OnFacename}{wxfontenumeratoronfacename} or
31 \helpref{OnFontEncoding}{wxfontenumeratoronfontencoding} should be overridden
32 depending on whether you plan to call
33 \helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames} or
34 \helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings}. Of course,
35 if you call both of them, you should override both functions.
36
37 \wxheading{Derived from}
38
39 None
40
41 \wxheading{Include files}
42
43 <wx/fontenum.h>
44
45 \wxheading{See also}
46
47 \helpref{Font encoding overview}{wxfontencodingoverview},
48 \helpref{Font sample}{samplefont},
49 \helpref{wxFont}{wxfont},
50 \helpref{wxFontMapper}{wxfontmapper}
51
52 \latexignore{\rtfignore{\wxheading{Members}}}
53
54 \membersection{wxFontEnumerator::EnumerateFacenames}\label{wxfontenumeratorenumeratefacenames}
55
56 \func{virtual bool}{EnumerateFacenames}{
57 \param{wxFontEncoding }{encoding = wxFONTENCODING\_SYSTEM},
58 \param{bool }{fixedWidthOnly = FALSE}}
59
60 Call \helpref{OnFacename}{wxfontenumeratoronfacename} for each font which
61 supports given encoding (only if it is not wxFONTENCODING\_SYSTEM) and is of
62 fixed width (if {\it fixedWidthOnly} is TRUE).
63
64 Calling this function with default arguments will result in enumerating all
65 fonts available on the system.
66
67 \membersection{wxFontEnumerator::EnumerateEncodings}\label{wxfontenumeratorenumerateencodings}
68
69 \func{virtual bool}{EnumerateEncodings}{\param{const wxString\& }{font = ""}}
70
71 Call \helpref{OnFontEncoding}{wxfontenumeratoronfontencoding} for each
72 encoding supported by the given font - or for each encoding supported by at
73 least some font if {\it font} is not specified.
74
75
76 \membersection{wxFontEnumerator::GetEncodings}\label{wxfontenumeratorgetencodings}
77
78 \func{wxArrayString*}{GetEncodings}{\void}
79
80 Return array of strings containing all encodings found by
81 \helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings}. This is convenience function. It is
82 based on default implementation of \helpref{OnFontEncoding}{wxfontenumeratoronfontencoding} so don't expect
83 it to work if you overwrite that method.
84
85 \membersection{wxFontEnumerator::GetFacenames}\label{wxfontenumeratorgetfacenames}
86
87 \func{wxArrayString*}{GetFacenames}{\void}
88
89 Return array of strings containing all facenames found by
90 \helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames}. This is convenience function. It is
91 based on default implementation of \helpref{OnFacename}{wxfontenumeratoronfacename} so don't expect
92 it to work if you overwrite that method.
93
94
95 \membersection{wxFontEnumerator::OnFacename}\label{wxfontenumeratoronfacename}
96
97 \func{virtual bool}{OnFacename}{\param{const wxString\& }{font}}
98
99 Called by \helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames} for
100 each match. Return TRUE to continue enumeration or FALSE to stop it.
101
102 \membersection{wxFontEnumerator::OnFontEncoding}\label{wxfontenumeratoronfontencoding}
103
104 \func{virtual bool}{OnFontEncoding}{
105 \param{const wxString\& }{font},
106 \param{const wxString\& }{encoding}
107 }
108
109 Called by \helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings} for
110 each match. Return TRUE to continue enumeration or FALSE to stop it.
111