vfs: check userland buffers before reading them.
[haiku.git] / docs / develop / servers / app_server / FontFamily.htm
blobf353ea93a27b44633bf9cc1bc8328b80c4b74dcf
1 <HTML>
2 <HEAD>
3 <TITLE>FontFamily.htm</TITLE>
4 <style type="text/css">
5 <!--
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)}
10 .GR-Default {}
11 .Body {margin: 0px}
12 .Footer {margin: 0px}
13 .Header {margin: 0px}
14 .WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
15 -->
16 </style>
17 </HEAD>
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>
24 <HR>
25 </P>
26 <P class="Body" style="margin: 0px">Member Functions</P>
27 <P class="Body" style="margin: 0px"><BR>
28 </P>
29 <TABLE WIDTH=463 HEIGHT=90 BORDER=1 CELLPADDING=1 CELLSPACING=2>
30 <TR>
31 <TD WIDTH=203 HEIGHT=17>
32 <P class="Body" style="margin: 0px">FontFamily(const char *name)</P>
33 </TD>
34 <TD WIDTH=260 HEIGHT=17>
35 <P class="Body" style="margin: 0px">~FontFamily(void)</P>
36 </TD>
37 </TR>
38 <TR>
39 <TD WIDTH=203 HEIGHT=22>
40 <P class="Body" style="margin: 0px">const char *GetName(void)</P>
41 </TD>
42 <TD WIDTH=260 HEIGHT=22>
43 <P class="Body" style="margin: 0px">void AddStyle(const char *path, FT_Face face)</P>
44 </TD>
45 </TR>
46 <TR>
47 <TD WIDTH=203 HEIGHT=17>
48 <P class="Body" style="margin: 0px">void RemoveStyle(const char *style)</P>
49 </TD>
50 <TD WIDTH=260 HEIGHT=17>
51 <P class="Body" style="margin: 0px">FontStyle *GetStyle(const char *stylename)</P>
52 </TD>
53 </TR>
54 <TR>
55 <TD WIDTH=203 HEIGHT=17>
56 <P class="Body" style="margin: 0px">const char *GetStyle(int32 index)</P>
57 </TD>
58 <TD WIDTH=260 HEIGHT=17>
59 <P class="Body" style="margin: 0px">int32 CountStyles(void)</P>
60 </TD>
61 </TR>
62 <TR>
63 <TD WIDTH=203 HEIGHT=17>
64 <P class="Body" style="margin: 0px">bool HasStyle(const char *style)</P>
65 </TD>
66 <TD WIDTH=260 HEIGHT=17>
67 &nbsp;
68 </TD>
69 </TR>
70 </TABLE>
71 <P class="Body" style="margin: 0px"><BR>
72 <BR>
73 <BR>
74 <HR>
75 </P>
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>
81 <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>
87 <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>
92 <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>
99 <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>
108 <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>
117 <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>
124 <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>
129 <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>
136 </P>
137 <DIV class="layer" id="Layer 1">
138 </DIV>
139 </DIV>
140 </BODY>
141 </HTML>