I. font type:
1. GDI font. Stored in hard disk files.
1.1 dot matrix font. It is also called a bitmap font. It is stored in the form of Bitmap pixels. Do not scale at will. The advantage is fast display and good readability. Each dot matrix font cannot exceed 6 types.
Example: system, fixedsys, terminal, courier, MS Serif, MS sans serif, small fonts
1.2 strokes. The advantage is random scaling, slow display, and poor readability of small fonts. Suitable for plotter.
Example: Modern, Roman, script
1.3 TrueType font, which can be infinitely scaled and used for video display and printer.
Example: Courier New..., Times New Roman..., Arial..., symol
2. device font. Inherent in the output device.
2. character output functions.
Settextalign (
Nflags) // Note: ta_updatecp indicates that all X and Y set in textout are invalid, but take the coordinates after the previous change.
Textout
Tabbedtextout
Exttextout
Drawtext
Drawtextex
Device description table:
Settextcolor
Setbkmode
Setbkcolor
Get the system color set by the user. getsyscolor (color_window ...)
CDC: settextcharacterextra // Character Spacing
SelectObject (HDC, getstockobject (system_font ))
Some functions:
Createfont or createfontindirect // create a font
Gettextface // get the font name
Bool gettextmetrics (HDCHDC,LptextmetricLptm );// Obtain the current font information
Bool gettextextentpoint32 (HDCHDC,LpctstrLpstring,IntCbstring,LpsizeLpsize ); // Obtain the string size.
Settextjustification (HDC, PRC-> right-PRC-> left-size. CX, cspacechars); // used for the two segments. The following cspacechars space must be evenly divided (PrC-> right-PRC-> left-size. (CX) space. After a row ends, use settextjustification (HDC, 0, 0) to eliminate the uplink errors.
Three, logfont structure, member Description: http://baike.baidu.com/view/2421591.html? Fromtaglist
You can use logfont to set many font information. Including font rotation. For example, LF. lforientation = 300; converts to 30 degrees.
GetObject (hfont, sizeof (logfont), & lf); // get logfont
Hfont = createfontindirect (& lf); // set logfont
Iv. enumfonts enumfontfamiliesex
5. Select a fontBool choosefont (lpchoosefontLpcf );