]>
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 | |
f6bcfd97 | 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 |
fa482912 | 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 |
775a998e VZ |
25 | exhausted or the callback returns FALSE. |
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 | ||
51 | \latexignore{\rtfignore{\wxheading{Members}}} | |
52 | ||
3c1866e8 | 53 | \membersection{wxFontEnumerator::EnumerateFacenames}\label{wxfontenumeratorenumeratefacenames} |
775a998e | 54 | |
3c1866e8 | 55 | \func{virtual bool}{EnumerateFacenames}{ |
775a998e VZ |
56 | \param{wxFontEncoding }{encoding = wxFONTENCODING\_SYSTEM}, |
57 | \param{bool }{fixedWidthOnly = FALSE}} | |
58 | ||
3c1866e8 | 59 | Call \helpref{OnFacename}{wxfontenumeratoronfacename} for each font which |
775a998e VZ |
60 | supports given encoding (only if it is not wxFONTENCODING\_SYSTEM) and is of |
61 | fixed width (if {\it fixedWidthOnly} is TRUE). | |
62 | ||
63 | Calling this function with default arguments will result in enumerating all | |
64 | fonts available on the system. | |
65 | ||
66 | \membersection{wxFontEnumerator::EnumerateEncodings}\label{wxfontenumeratorenumerateencodings} | |
67 | ||
68 | \func{virtual bool}{EnumerateEncodings}{\param{const wxString\& }{font = ""}} | |
69 | ||
70 | Call \helpref{OnFontEncoding}{wxfontenumeratoronfontencoding} for each | |
71 | encoding supported by the given font - or for each encoding supported by at | |
72 | least some font if {\it font} is not specified. | |
73 | ||
435151d7 VS |
74 | |
75 | \membersection{wxFontEnumerator::GetEncodings}\label{wxfontenumeratorgetencodings} | |
76 | ||
77 | \func{wxArrayString*}{GetEncodings}{\void} | |
78 | ||
79 | Return array of strings containing all encodings found by | |
80 | \helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings}. This is convenience function. It is | |
81 | based on default implementation of \helpref{OnFontEncoding}{wxfontenumeratoronfontencoding} so don't expect | |
82 | it to work if you overwrite that method. | |
83 | ||
84 | \membersection{wxFontEnumerator::GetFacenames}\label{wxfontenumeratorgetfacenames} | |
85 | ||
86 | \func{wxArrayString*}{GetFacenames}{\void} | |
87 | ||
88 | Return array of strings containing all facenames found by | |
89 | \helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames}. This is convenience function. It is | |
90 | based on default implementation of \helpref{OnFacename}{wxfontenumeratoronfacename} so don't expect | |
91 | it to work if you overwrite that method. | |
92 | ||
93 | ||
3c1866e8 | 94 | \membersection{wxFontEnumerator::OnFacename}\label{wxfontenumeratoronfacename} |
775a998e | 95 | |
3c1866e8 | 96 | \func{virtual bool}{OnFacename}{\param{const wxString\& }{font}} |
775a998e | 97 | |
3c1866e8 | 98 | Called by \helpref{EnumerateFacenames}{wxfontenumeratorenumeratefacenames} for |
775a998e VZ |
99 | each match. Return TRUE to continue enumeration or FALSE to stop it. |
100 | ||
101 | \membersection{wxFontEnumerator::OnFontEncoding}\label{wxfontenumeratoronfontencoding} | |
102 | ||
103 | \func{virtual bool}{OnFontEncoding}{ | |
cd77c085 JS |
104 | \param{const wxString\& }{font}, |
105 | \param{const wxString\& }{encoding} | |
775a998e VZ |
106 | } |
107 | ||
108 | Called by \helpref{EnumerateEncodings}{wxfontenumeratorenumerateencodings} for | |
109 | each match. Return TRUE to continue enumeration or FALSE to stop it. | |
110 |