vfs: check userland buffers before reading them.
[haiku.git] / docs / develop / servers / app_server / FontStyle.htm
blob8d8a4ab69d526d8d84182c4bbcf2dd1f2dbb77d6
1 <HTML>
2 <HEAD>
3 <TITLE>FontStyle.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">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>
22 </P>
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>
25 <BR>
26 <HR>
27 </P>
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>
38 <BR>
39 Member Functions</P>
40 <P class="Body" style="margin: 0px"><BR>
41 </P>
42 <TABLE WIDTH=618 HEIGHT=198 BORDER=1 CELLPADDING=1 CELLSPACING=2>
43 <TR>
44 <TD WIDTH=213 HEIGHT=32>
45 <P class="Body" style="margin: 0px">FontStyle(const char *filepath, FT_Face face)</P>
46 </TD>
47 <TD WIDTH=250 HEIGHT=32>
48 <P class="Body" style="margin: 0px">~FontStyle(void)</P>
49 </TD>
50 </TR>
51 <TR>
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>
54 </TD>
55 <TD WIDTH=250 HEIGHT=32>
56 <P class="Body" style="margin: 0px">bool IsFixedWidth(void)</P>
57 </TD>
58 </TR>
59 <TR>
60 <TD WIDTH=213 HEIGHT=17>
61 <P class="Body" style="margin: 0px">bool IsScalable(void)</P>
62 </TD>
63 <TD WIDTH=250 HEIGHT=17>
64 <P class="Body" style="margin: 0px">bool HasKerning(void)</P>
65 </TD>
66 </TR>
67 <TR>
68 <TD WIDTH=213 HEIGHT=17>
69 <P class="Body" style="margin: 0px">bool HasTuned(void)</P>
70 </TD>
71 <TD WIDTH=250 HEIGHT=17>
72 <P class="Body" style="margin: 0px">uint16 GlyphCount(void)</P>
73 </TD>
74 </TR>
75 <TR>
76 <TD WIDTH=213 HEIGHT=17>
77 <P class="Body" style="margin: 0px">uint16 CharMapCount(void)</P>
78 </TD>
79 <TD WIDTH=250 HEIGHT=17>
80 <P class="Body" style="margin: 0px">const char *Style(void)</P>
81 </TD>
82 </TR>
83 <TR>
84 <TD WIDTH=213 HEIGHT=17>
85 <P class="Body" style="margin: 0px">FontFamily *Family(void)</P>
86 </TD>
87 <TD WIDTH=250 HEIGHT=17>
88 <P class="Body" style="margin: 0px">FT_Face GetFace(void)</P>
89 </TD>
90 </TR>
91 <TR>
92 <TD WIDTH=213 HEIGHT=17>
93 <P class="Body" style="margin: 0px">const char *GetPath(void)</P>
94 </TD>
95 <TD WIDTH=250 HEIGHT=17>
96 <P class="Body" style="margin: 0px">int16 ConvertToUni code(uint16 c)</P>
97 </TD>
98 </TR>
99 </TABLE>
100 <P class="Body" style="margin: 0px"><BR>
101 <BR>
102 <BR>
103 <HR>
104 </P>
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>
117 <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>
123 <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>
131 <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>
143 <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>
148 <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>
153 <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">
161 </DIV>
162 </DIV>
163 </BODY>
164 </HTML>