3 <TITLE>FontFamily.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">FontFamily class
</span><span style=
"color: rgb(0,0,0); font-size: 24pt"></span></P>
21 <P class=
"Body" style=
"margin: 0px"><BR>
22 FontFamily objects are used to tie together all related font styles.
</P>
23 <P class=
"Body" style=
"margin: 0px"><BR>
26 <P class=
"Body" style=
"margin: 0px">Member Functions
</P>
27 <P class=
"Body" style=
"margin: 0px"><BR>
29 <TABLE WIDTH=
463 HEIGHT=
90 BORDER=
1 CELLPADDING=
1 CELLSPACING=
2>
31 <TD WIDTH=
203 HEIGHT=
17>
32 <P class=
"Body" style=
"margin: 0px">FontFamily(const char *name)
</P>
34 <TD WIDTH=
260 HEIGHT=
17>
35 <P class=
"Body" style=
"margin: 0px">~FontFamily(void)
</P>
39 <TD WIDTH=
203 HEIGHT=
22>
40 <P class=
"Body" style=
"margin: 0px">const char *GetName(void)
</P>
42 <TD WIDTH=
260 HEIGHT=
22>
43 <P class=
"Body" style=
"margin: 0px">void AddStyle(const char *path, FT_Face face)
</P>
47 <TD WIDTH=
203 HEIGHT=
17>
48 <P class=
"Body" style=
"margin: 0px">void RemoveStyle(const char *style)
</P>
50 <TD WIDTH=
260 HEIGHT=
17>
51 <P class=
"Body" style=
"margin: 0px">FontStyle *GetStyle(const char *stylename)
</P>
55 <TD WIDTH=
203 HEIGHT=
17>
56 <P class=
"Body" style=
"margin: 0px">const char *GetStyle(int32 index)
</P>
58 <TD WIDTH=
260 HEIGHT=
17>
59 <P class=
"Body" style=
"margin: 0px">int32 CountStyles(void)
</P>
63 <TD WIDTH=
203 HEIGHT=
17>
64 <P class=
"Body" style=
"margin: 0px">bool HasStyle(const char *style)
</P>
66 <TD WIDTH=
260 HEIGHT=
17>
71 <P class=
"Body" style=
"margin: 0px"><BR>
76 <P class=
"Body" style=
"margin: 0px"><span class=
"OBOS-Function-Def">FontFamily(const char *name)
</span></P>
77 <P class=
"Body" style=
"margin: 0px"><BR>
78 1) Create and set internal name to the one passed to the constructor
</P>
79 <P class=
"Body" style=
"margin: 0px">2) Create the styles list
</P>
80 <P class=
"Body" style=
"margin: 0px"><BR>
82 <span class=
"OBOS-Function-Def">~FontFamily(void)
</span></P>
83 <P class=
"Body" style=
"margin: 0px"><BR>
84 1) delete the internal name
</P>
85 <P class=
"Body" style=
"margin: 0px">2) empty and delete the internal style list
</P>
86 <P class=
"Body" style=
"margin: 0px"><BR>
88 <span class=
"OBOS-Function-Def">const char *GetName(void)
</span></P>
89 <P class=
"Body" style=
"margin: 0px"><BR>
90 Returns the internal family name
</P>
91 <P class=
"Body" style=
"margin: 0px"><BR>
93 <span class=
"OBOS-Function-Def">void AddStyle(const char *path, FT_Face face)
</span></P>
94 <P class=
"Body" style=
"margin: 0px"><BR>
95 Adds the style to the family.
</P>
96 <P class=
"Body" style=
"margin: 0px"><BR>
97 1) Create the FontStyle object and add it to the style list.
</P>
98 <P class=
"Body" style=
"margin: 0px"><BR>
100 <span class=
"OBOS-Function-Def">void RemoveStyle(const char *style)
</span></P>
101 <P class=
"Body" style=
"margin: 0px"><BR>
102 Removes the style from the FontFamily object.
</P>
103 <P class=
"Body" style=
"margin: 0px"><BR>
104 1) Call GetStyle on the given pointer
</P>
105 <P class=
"Body" style=
"margin: 0px">2) If non-NULL, delete the object
</P>
106 <P class=
"Body" style=
"margin: 0px">3) If the style list is now empty, ask the FontServer to remove it from the family list
</P>
107 <P class=
"Body" style=
"margin: 0px"><BR>
109 <span class=
"OBOS-Function-Def">FontStyle *GetStyle(const char *style)
</span></P>
110 <P class=
"Body" style=
"margin: 0px"><BR>
111 Looks up a FontStyle object based on its style name. Returns NULL if not found.
</P>
112 <P class=
"Body" style=
"margin: 0px"><BR>
113 1) Iterate through the style list
</P>
114 <P class=
"Body" style=
"margin: 0px"> a) compare
<span style=
"font-style: italic">style
</span> to each FontStyle object's GetName method and return the object if they are the same
</P>
115 <P class=
"Body" style=
"margin: 0px">2) If all items have been checked and nothing has been returned, return NULL
</P>
116 <P class=
"Body" style=
"margin: 0px"><BR>
118 <span class=
"OBOS-Function-Def">const char *GetStyle(int32 index)
</span></P>
119 <P class=
"Body" style=
"margin: 0px"><BR>
120 Returns the name of the style at
<span style=
"font-style: italic">index
</span></P>
121 <P class=
"Body" style=
"margin: 0px"><BR>
122 1) Get the FontStyle item at
<span style=
"font-style: italic">index
</span> obtained via the style list's ItemAt call
</P>
123 <P class=
"Body" style=
"margin: 0px"><BR>
125 <span class=
"OBOS-Function-Def">int32 CountStyles(void)
</span></P>
126 <P class=
"Body" style=
"margin: 0px"><BR>
127 Returns the number of items in the style list and, thus, the number of styles in the family
</P>
128 <P class=
"Body" style=
"margin: 0px"><BR>
130 <span class=
"OBOS-Function-Def">bool HasStyle(const char *stylename)
</span></P>
131 <P class=
"Body" style=
"margin: 0px"><BR>
132 Returns true if the family has a style with the name
<span style=
"font-style: italic">stylename
</span></P>
133 <P class=
"Body" style=
"margin: 0px"><BR>
134 1) Call GetStyle on the style name and return false if NULL, true if not.
</P>
135 <P class=
"Body" style=
"margin: 0px"><BR>
137 <DIV class=
"layer" id=
"Layer 1">