]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/tfont.tex
updated legalese regarding libtiff, libjpeg
[wxWidgets.git] / docs / latex / wx / tfont.tex
1 \section{wxFont overview}\label{wxfontoverview}
2
3 Class: \helpref{wxFont}{wxfont}
4
5 A font is an object which determines the appearance of text, primarily
6 when drawing text to a window or device context. A font is determined by
7 the following parameters (not all of them have to be specified, of course):
8
9 \begin{twocollist}\itemsep=0pt
10 \twocolitem{Point size}{This is the standard way of referring to text size.}
11 \twocolitem{Family}{Supported families are:
12 {\bf wxDEFAULT, wxDECORATIVE, wxROMAN, wxSCRIPT, wxSWISS, wxMODERN}.
13 {\bf wxMODERN} is a fixed pitch font; the others are either fixed or variable pitch.}
14 \twocolitem{Style}{The value can be {\bf wxNORMAL, wxSLANT} or {\bf wxITALIC}.}
15 \twocolitem{Weight}{The value can be {\bf wxNORMAL, wxLIGHT} or {\bf wxBOLD}.}
16 \twocolitem{Underlining}{The value can be TRUE or FALSE.}
17 \twocolitem{Face name}{An optional string specifying the actual typeface to be used. If NULL,
18 a default typeface will chosen based on the family.}
19 \twocolitem{Encoding}{The font encoding (see {\bf wxFONTENCODING\_XXX}
20 constants and the \helpref{font overview}{wxfontencodingoverview} for more
21 details)}
22 \end{twocollist}
23
24 Specifying a family, rather than a specific typeface name, ensures a degree of
25 portability across platforms because a suitable font will be chosen for the
26 given font family.
27
28 Under Windows, the face name can be one of the installed fonts on the user's
29 system. Since the choice of fonts differs from system to system, either choose
30 standard Windows fonts, or if allowing the user to specify a face name, store
31 the family id with any file that might be transported to a different Windows
32 machine or other platform.
33
34 \normalbox{{\bf Note:} There is currently a difference between the appearance
35 of fonts on the two platforms, if the mapping mode is anything other than
36 wxMM\_TEXT. Under X, font size is always specified in points. Under MS
37 Windows, the unit for text is points but the text is scaled according to the
38 current mapping mode. However, user scaling on a device context will also
39 scale fonts under both environments.}
40