1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxFontEnumerator documentation
4 %% Author: Vadim Zeitlin
8 %% Copyright: (c) Vadim Zeitlin
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxFontEnumerator
}}\label{wxfontenumerator
}
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
}.
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 (
\helpref{OnFacename
}{wxfontenumeratoronfacename
} or
23 \helpref{OnFontEncoding
}{wxfontenumeratoronfontencoding
}) will be called
24 repeatedly until either all fonts satisfying the specified criteria are
25 exhausted or the callback returns false.
27 \wxheading{Virtual functions to override
}
29 Either
\helpref{OnFacename
}{wxfontenumeratoronfacename
} or
30 \helpref{OnFontEncoding
}{wxfontenumeratoronfontencoding
} should be overridden
31 depending on whether you plan to call
32 \helpref{EnumerateFacenames
}{wxfontenumeratorenumeratefacenames
} or
33 \helpref{EnumerateEncodings
}{wxfontenumeratorenumerateencodings
}. Of course,
34 if you call both of them, you should override both functions.
36 \wxheading{Derived from
}
40 \wxheading{Include files
}
46 \helpref{wxCore
}{librarieslist
}
50 \helpref{Font encoding overview
}{wxfontencodingoverview
},
51 \helpref{Font sample
}{samplefont
},
52 \helpref{wxFont
}{wxfont
},
53 \helpref{wxFontMapper
}{wxfontmapper
}
57 \latexignore{\rtfignore{\wxheading{Members
}}}
59 \membersection{wxFontEnumerator::EnumerateFacenames
}\label{wxfontenumeratorenumeratefacenames
}
61 \func{virtual bool
}{EnumerateFacenames
}{
62 \param{wxFontEncoding
}{encoding = wxFONTENCODING
\_SYSTEM},
63 \param{bool
}{fixedWidthOnly = false
}}
65 Call
\helpref{OnFacename
}{wxfontenumeratoronfacename
} for each font which
66 supports given encoding (only if it is not wxFONTENCODING
\_SYSTEM) and is of
67 fixed width (if
\arg{fixedWidthOnly
} is true).
69 Calling this function with default arguments will result in enumerating all
70 fonts available on the system.
73 \membersection{wxFontEnumerator::EnumerateEncodings
}\label{wxfontenumeratorenumerateencodings
}
75 \func{virtual bool
}{EnumerateEncodings
}{\param{const wxString\&
}{font = ""
}}
77 Call
\helpref{OnFontEncoding
}{wxfontenumeratoronfontencoding
} for each
78 encoding supported by the given font - or for each encoding supported by at
79 least some font if
{\it font
} is not specified.
82 \membersection{wxFontEnumerator::GetEncodings
}\label{wxfontenumeratorgetencodings
}
84 \func{static wxArrayString
}{GetEncodings
}{\param{const wxString\&
}{ facename = ""
}}
86 Return array of strings containing all encodings found by
87 \helpref{EnumerateEncodings
}{wxfontenumeratorenumerateencodings
}.
90 \membersection{wxFontEnumerator::GetFacenames
}\label{wxfontenumeratorgetfacenames
}
92 \func{static wxArrayString
}{GetFacenames
}{\param{wxFontEncoding
}{encoding = wxFONTENCODING
\_SYSTEM},
\param{bool
}{fixedWidthOnly = false
}}
94 Return array of strings containing all facenames found by
95 \helpref{EnumerateFacenames
}{wxfontenumeratorenumeratefacenames
}.
98 \membersection{wxFontEnumerator::IsValidFacename
}\label{wxfontenumeratorisvalidfacename
}
100 \func{static bool
}{IsValidFacename
}{\param{const wxString \&
}{ facename
}}
102 Returns
\true if the given string is valid face name, i.e. it's the face name of an installed
103 font and it can safely be used with
\helpref{wxFont::SetFaceName
}{wxfontsetfacename
}.
106 \membersection{wxFontEnumerator::OnFacename
}\label{wxfontenumeratoronfacename
}
108 \func{virtual bool
}{OnFacename
}{\param{const wxString\&
}{font
}}
110 Called by
\helpref{EnumerateFacenames
}{wxfontenumeratorenumeratefacenames
} for
111 each match. Return true to continue enumeration or false to stop it.
114 \membersection{wxFontEnumerator::OnFontEncoding
}\label{wxfontenumeratoronfontencoding
}
116 \func{virtual bool
}{OnFontEncoding
}{\param{const wxString\&
}{font
},
\param{const wxString\&
}{encoding
}}
118 Called by
\helpref{EnumerateEncodings
}{wxfontenumeratorenumerateencodings
} for
119 each match. Return true to continue enumeration or false to stop it.