]>
Commit | Line | Data |
---|---|---|
a660d684 KB |
1 | \section{Font 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 canvas or device context. A font is determined by | |
7 | up to six parameters: | |
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 | \end{twocollist} | |
20 | ||
21 | Specifying a family, rather than a specific typeface name, ensures a degree of portability | |
22 | across platforms because a suitable font will be chosen for the given font family. | |
23 | ||
24 | Under Windows, the face name can be one of the installed fonts on the user's system. Since | |
25 | the choice of fonts differs from system to system, either choose standard Windows fonts, | |
26 | or if allowing the user to specify a face name, store the family id with any file that | |
27 | might be transported to a different Windows machine or other platform. | |
28 | ||
29 | \normalbox{{\bf Note:} There is currently a difference between the appearance of fonts on the | |
30 | two platforms, if the mapping mode is anything other than MM\_TEXT. | |
31 | Under X, font size is always specified in points. Under MS Windows, the | |
32 | unit for text is points but the text is scaled according to the | |
33 | current mapping mode. However, user scaling on a device canvas will | |
34 | also scale fonts under both environments.} | |
35 | ||
36 |