3 <TITLE>FontStyle.htm
</TITLE>
4 <style type=
"text/css">
6 .Default {background-color: rgb
(255,255,255); color: rgb
(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
7 .OBOS-Function-Def {background-color: rgb
(255,255,255); color: rgb
(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
8 .OBOS-Title {background-color: rgb
(255,255,255); color: rgb
(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
9 .Text-Background {background-color: rgb
(255,255,255)}
14 .WP-Default {text-align: left
; text-indent: 0px; margin-left: 0px; margin-right: 0px}
18 <BODY BGCOLOR=
"#ffffff">
19 <DIV class=
"sheet" id=
"Sheet 1">
20 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Title">FontStyle class : public SharedObject
</span><span style=
"color: rgb(0,0,0); font-size: 24pt"></span></P>
21 <P class=
"Body" style=
"margin: 0px"><BR>
23 <P class=
"Body" style=
"margin: 0px">FontStyle objects represent a font's look, such as bold, italics, etc.
</P>
24 <P class=
"Body" style=
"margin: 0px"><BR>
28 <P class=
"Body" style=
"margin: 0px">Type Definitions
</P>
29 <P class=
"Body" style=
"margin: 0px"><BR>
30 typedef struct CachedFaceRec_
</P>
31 <P class=
"Body" style=
"margin: 0px">{
</P>
32 <P class=
"Body" style=
"margin: 0px"> BString file_path;
</P>
33 <P class=
"Body" style=
"margin: 0px"> uint32 face_index;
</P>
34 <P class=
"Body" style=
"margin: 0px">} CachedFaceRec, *CachedFace;
</P>
35 <P class=
"Body" style=
"margin: 0px"><BR>
36 A record used in FreeType caching.
</P>
37 <P class=
"Body" style=
"margin: 0px"><BR>
40 <P class=
"Body" style=
"margin: 0px"><BR>
42 <TABLE WIDTH=
618 HEIGHT=
198 BORDER=
1 CELLPADDING=
1 CELLSPACING=
2>
44 <TD WIDTH=
213 HEIGHT=
32>
45 <P class=
"Body" style=
"margin: 0px">FontStyle(const char *filepath, FT_Face face)
</P>
47 <TD WIDTH=
250 HEIGHT=
32>
48 <P class=
"Body" style=
"margin: 0px">~FontStyle(void)
</P>
52 <TD WIDTH=
213 HEIGHT=
32>
53 <P class=
"Body" style=
"margin: 0px">ServerFont *Instantiate(float size, float rotation=
0.0, float shear=
90.0)
</P>
55 <TD WIDTH=
250 HEIGHT=
32>
56 <P class=
"Body" style=
"margin: 0px">bool IsFixedWidth(void)
</P>
60 <TD WIDTH=
213 HEIGHT=
17>
61 <P class=
"Body" style=
"margin: 0px">bool IsScalable(void)
</P>
63 <TD WIDTH=
250 HEIGHT=
17>
64 <P class=
"Body" style=
"margin: 0px">bool HasKerning(void)
</P>
68 <TD WIDTH=
213 HEIGHT=
17>
69 <P class=
"Body" style=
"margin: 0px">bool HasTuned(void)
</P>
71 <TD WIDTH=
250 HEIGHT=
17>
72 <P class=
"Body" style=
"margin: 0px">uint16 GlyphCount(void)
</P>
76 <TD WIDTH=
213 HEIGHT=
17>
77 <P class=
"Body" style=
"margin: 0px">uint16 CharMapCount(void)
</P>
79 <TD WIDTH=
250 HEIGHT=
17>
80 <P class=
"Body" style=
"margin: 0px">const char *Style(void)
</P>
84 <TD WIDTH=
213 HEIGHT=
17>
85 <P class=
"Body" style=
"margin: 0px">FontFamily *Family(void)
</P>
87 <TD WIDTH=
250 HEIGHT=
17>
88 <P class=
"Body" style=
"margin: 0px">FT_Face GetFace(void)
</P>
92 <TD WIDTH=
213 HEIGHT=
17>
93 <P class=
"Body" style=
"margin: 0px">const char *GetPath(void)
</P>
95 <TD WIDTH=
250 HEIGHT=
17>
96 <P class=
"Body" style=
"margin: 0px">int16 ConvertToUni code(uint16 c)
</P>
100 <P class=
"Body" style=
"margin: 0px"><BR>
105 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">FontStyle(const char *filepath, FT_Face face)
</span></P>
106 <P class=
"Body" style=
"margin: 0px"><BR>
107 1) set name from face
</P>
108 <P class=
"Body" style=
"margin: 0px">2) create a CachedFaceRec object and generate the handle as being the memory address converted to an integer. Assign the path from the parameter.
</P>
109 <P class=
"Body" style=
"margin: 0px">3) set the path from the parameter
</P>
110 <P class=
"Body" style=
"margin: 0px">4) set family to NULL
</P>
111 <P class=
"Body" style=
"margin: 0px">5) create the instance list
</P>
112 <P class=
"Body" style=
"margin: 0px">6) check to see if face object has ready-made strikes and set IsTuned flags as appropriate
</P>
113 <P class=
"Body" style=
"margin: 0px">7) set fixed-width, kerning, and scalable flags as appropriate, based on face data
</P>
114 <P class=
"Body" style=
"margin: 0px">8) get and assign glyph and charmap count
</P>
115 <P class=
"Body" style=
"margin: 0px">9) set bounds to an invalid rectangle
</P>
116 <P class=
"Body" style=
"margin: 0px"><BR>
118 <span class=
"OBOS-Function-Def">~FontStyle(void)
</span></P>
119 <P class=
"Body" style=
"margin: 0px"><BR>
120 1) delete all pointer objects
</P>
121 <P class=
"Body" style=
"margin: 0px">2) empty instance list, delete all attached instances, and delete the list
</P>
122 <P class=
"Body" style=
"margin: 0px"><BR>
124 <span class=
"OBOS-Function-Def">ServerFont *Instantiate(float size, float rotation=
0.0, float shear=
90.0)
</span></P>
125 <P class=
"Body" style=
"margin: 0px"><BR>
126 Retrieves a specific instance of the font style, based on the size, rotation, and shear values
</P>
127 <P class=
"Body" style=
"margin: 0px"><BR>
128 1) create a new ServerFont object
</P>
129 <P class=
"Body" style=
"margin: 0px">2) add the new object to the instance list and return it
</P>
130 <P class=
"Body" style=
"margin: 0px"><BR>
132 <span class=
"OBOS-Function-Def">bool IsFixedWidth(void)
</span></P>
133 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">bool IsScalable(void)
</span></P>
134 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">bool HasKerning(void)
</span></P>
135 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">bool HasTuned(void)
</span></P>
136 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">uint16 GlyphCount(void)
</span></P>
137 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">uint16 CharMapCount(void)
</span></P>
138 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">const char *GetPath(void)
</span></P>
139 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">FT_Face GetFace(void)
</span></P>
140 <P class=
"Body" style=
"margin: 0px"><BR>
141 These merely return the appropriate flags/values which are assigned values in the constructor.
</P>
142 <P class=
"Body" style=
"margin: 0px"><BR>
144 <span class=
"OBOS-Function-Def">const char *Style(void)
</span></P>
145 <P class=
"Body" style=
"margin: 0px"><BR>
146 Returns the string value for the particular style.
</P>
147 <P class=
"Body" style=
"margin: 0px"><BR>
149 <span class=
"OBOS-Function-Def">FontFamily *Family(void)
</span></P>
150 <P class=
"Body" style=
"margin: 0px"><BR>
151 Returns the pointer to the FontStyle object's family. Do NOT delete this pointer.
</P>
152 <P class=
"Body" style=
"margin: 0px"><BR>
154 <span class=
"OBOS-Function-Def">int16 ConvertToUnicode(uint16 c)
</span></P>
155 <P class=
"Body" style=
"margin: 0px"><BR>
156 Converts a character code to a UTF-
8 string
</P>
157 <P class=
"Body" style=
"margin: 0px"><BR>
158 1) Look up the face from the cache manager
</P>
159 <P class=
"Body" style=
"margin: 0px">2) Call FT_Get_Char_Index for the particular character code and return the value
</P>
160 <DIV class=
"layer" id=
"Layer 1">