]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/fontenum.tex
added null pointer check and assert
[wxWidgets.git] / docs / latex / wx / fontenum.tex
CommitLineData
775a998e
VZ
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
8795498c 9%% License: wxWindows license
775a998e
VZ
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxFontEnumerator}}\label{wxfontenumerator}
13
14wxFontEnumerator enumerates either all available fonts on the system or only
15the ones with given attributes - either only fixed-width (suited for use in
16programs such as terminal emulators and the like) or the fonts available in
17the given \helpref{encoding}{wxfontencodingoverview}.
18
19To do this, you just have to call one of EnumerateXXX() functions - either
3c1866e8 20\helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames} or
775a998e 21\helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings} and the
c0ffb626 22corresponding callback (\helpref{OnFacename}{wxfontenumeratoronfacename} or
775a998e 23\helpref{OnFontEncoding}{wxfontenumeratoronfontencoding}) will be called
fa482912 24repeatedly until either all fonts satisfying the specified criteria are
cc81d32f 25exhausted or the callback returns false.
775a998e
VZ
26
27\wxheading{Virtual functions to override}
28
3c1866e8 29Either \helpref{OnFacename}{wxfontenumeratoronfacename} or
775a998e
VZ
30\helpref{OnFontEncoding}{wxfontenumeratoronfontencoding} should be overridden
31depending on whether you plan to call
3c1866e8 32\helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames} or
775a998e
VZ
33\helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings}. Of course,
34if you call both of them, you should override both functions.
35
36\wxheading{Derived from}
37
38None
39
40\wxheading{Include files}
41
42<wx/fontenum.h>
43
a7af285d
VZ
44\wxheading{Library}
45
46\helpref{wxCore}{librarieslist}
47
775a998e
VZ
48\wxheading{See also}
49
50\helpref{Font encoding overview}{wxfontencodingoverview},
51\helpref{Font sample}{samplefont},
52\helpref{wxFont}{wxfont},
53\helpref{wxFontMapper}{wxfontmapper}
54
6540132f
VZ
55
56
775a998e
VZ
57\latexignore{\rtfignore{\wxheading{Members}}}
58
3c1866e8 59\membersection{wxFontEnumerator::EnumerateFacenames}\label{wxfontenumeratorenumeratefacenames}
775a998e 60
3c1866e8 61\func{virtual bool}{EnumerateFacenames}{
775a998e 62 \param{wxFontEncoding }{encoding = wxFONTENCODING\_SYSTEM},
cc81d32f 63 \param{bool }{fixedWidthOnly = false}}
775a998e 64
3c1866e8 65Call \helpref{OnFacename}{wxfontenumeratoronfacename} for each font which
775a998e 66supports given encoding (only if it is not wxFONTENCODING\_SYSTEM) and is of
6540132f 67fixed width (if \arg{fixedWidthOnly} is true).
775a998e
VZ
68
69Calling this function with default arguments will result in enumerating all
70fonts available on the system.
71
6540132f 72
775a998e
VZ
73\membersection{wxFontEnumerator::EnumerateEncodings}\label{wxfontenumeratorenumerateencodings}
74
75\func{virtual bool}{EnumerateEncodings}{\param{const wxString\& }{font = ""}}
76
77Call \helpref{OnFontEncoding}{wxfontenumeratoronfontencoding} for each
78encoding supported by the given font - or for each encoding supported by at
79least some font if {\it font} is not specified.
80
435151d7
VS
81
82\membersection{wxFontEnumerator::GetEncodings}\label{wxfontenumeratorgetencodings}
83
6540132f 84\func{static wxArrayString}{GetEncodings}{\param{const wxString\&}{ facename = ""}}
435151d7
VS
85
86Return array of strings containing all encodings found by
6540132f
VZ
87\helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings}.
88
435151d7
VS
89
90\membersection{wxFontEnumerator::GetFacenames}\label{wxfontenumeratorgetfacenames}
91
6540132f 92\func{static wxArrayString}{GetFacenames}{\param{wxFontEncoding }{encoding = wxFONTENCODING\_SYSTEM}, \param{bool }{fixedWidthOnly = false}}
435151d7
VS
93
94Return array of strings containing all facenames found by
6540132f 95\helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames}.
435151d7
VS
96
97
85ab460e
VZ
98\membersection{wxFontEnumerator::IsValidFacename}\label{wxfontenumeratorisvalidfacename}
99
100\func{static bool}{IsValidFacename}{\param{const wxString \&}{ facename}}
101
102Returns \true if the given string is valid face name, i.e. it's the face name of an installed
103font and it can safely be used with \helpref{wxFont::SetFaceName}{wxfontsetfacename}.
104
105
3c1866e8 106\membersection{wxFontEnumerator::OnFacename}\label{wxfontenumeratoronfacename}
775a998e 107
3c1866e8 108\func{virtual bool}{OnFacename}{\param{const wxString\& }{font}}
775a998e 109
3c1866e8 110Called by \helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames} for
cc81d32f 111each match. Return true to continue enumeration or false to stop it.
775a998e 112
6540132f 113
775a998e
VZ
114\membersection{wxFontEnumerator::OnFontEncoding}\label{wxfontenumeratoronfontencoding}
115
6540132f 116\func{virtual bool}{OnFontEncoding}{\param{const wxString\& }{font}, \param{const wxString\& }{encoding}}
775a998e
VZ
117
118Called by \helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings} for
cc81d32f 119each match. Return true to continue enumeration or false to stop it.
775a998e 120