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