haiku/docs/develop/servers/app_server/FontStyle.htm

165 lines
6.9 KiB
HTML

<HTML>
<HEAD>
<TITLE>FontStyle.htm</TITLE>
<style type="text/css">
<!--
.Default {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 12pt}
.OBOS-Function-Def {background-color: rgb(255,255,255); color: rgb(0,0,0); font-family: 'Dutch801 Rm BT'; font-size: 16pt}
.OBOS-Title {background-color: rgb(255,255,255); color: rgb(0,128,0); font-family: 'Dutch801 Rm BT'; font-size: 24pt}
.Text-Background {background-color: rgb(255,255,255)}
.GR-Default {}
.Body {margin: 0px}
.Footer {margin: 0px}
.Header {margin: 0px}
.WP-Default {text-align: left; text-indent: 0px; margin-left: 0px; margin-right: 0px}
-->
</style>
</HEAD>
<BODY BGCOLOR="#ffffff">
<DIV class="sheet" id="Sheet 1">
<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>
<P class="Body" style="margin: 0px"><BR>
</P>
<P class="Body" style="margin: 0px">FontStyle objects represent a font's look, such as bold, italics, etc.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px">Type Definitions</P>
<P class="Body" style="margin: 0px"><BR>
typedef struct CachedFaceRec_</P>
<P class="Body" style="margin: 0px">{</P>
<P class="Body" style="margin: 0px"> BString file_path; </P>
<P class="Body" style="margin: 0px"> uint32 face_index; </P>
<P class="Body" style="margin: 0px">} CachedFaceRec, *CachedFace;</P>
<P class="Body" style="margin: 0px"><BR>
A record used in FreeType caching.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
Member Functions</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=618 HEIGHT=198 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=213 HEIGHT=32>
<P class="Body" style="margin: 0px">FontStyle(const char *filepath, FT_Face face)</P>
</TD>
<TD WIDTH=250 HEIGHT=32>
<P class="Body" style="margin: 0px">~FontStyle(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=32>
<P class="Body" style="margin: 0px">ServerFont *Instantiate(float size, float rotation=0.0, float shear=90.0)</P>
</TD>
<TD WIDTH=250 HEIGHT=32>
<P class="Body" style="margin: 0px">bool IsFixedWidth(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">bool IsScalable(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">bool HasKerning(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">bool HasTuned(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">uint16 GlyphCount(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">uint16 CharMapCount(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">const char *Style(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">FontFamily *Family(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">FT_Face GetFace(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=213 HEIGHT=17>
<P class="Body" style="margin: 0px">const char *GetPath(void)</P>
</TD>
<TD WIDTH=250 HEIGHT=17>
<P class="Body" style="margin: 0px">int16 ConvertToUni code(uint16 c)</P>
</TD>
</TR>
</TABLE>
<P class="Body" style="margin: 0px"><BR>
<BR>
<BR>
<HR>
</P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">FontStyle(const char *filepath, FT_Face face)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) set name from face</P>
<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>
<P class="Body" style="margin: 0px">3) set the path from the parameter</P>
<P class="Body" style="margin: 0px">4) set family to NULL</P>
<P class="Body" style="margin: 0px">5) create the instance list</P>
<P class="Body" style="margin: 0px">6) check to see if face object has ready-made strikes and set IsTuned flags as appropriate</P>
<P class="Body" style="margin: 0px">7) set fixed-width, kerning, and scalable flags as appropriate, based on face data</P>
<P class="Body" style="margin: 0px">8) get and assign glyph and charmap count</P>
<P class="Body" style="margin: 0px">9) set bounds to an invalid rectangle</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">~FontStyle(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) delete all pointer objects</P>
<P class="Body" style="margin: 0px">2) empty instance list, delete all attached instances, and delete the list</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">ServerFont *Instantiate(float size, float rotation=0.0, float shear=90.0)</span></P>
<P class="Body" style="margin: 0px"><BR>
Retrieves a specific instance of the font style, based on the size, rotation, and shear values</P>
<P class="Body" style="margin: 0px"><BR>
1) create a new ServerFont object</P>
<P class="Body" style="margin: 0px">2) add the new object to the instance list and return it</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">bool IsFixedWidth(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool IsScalable(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool HasKerning(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">bool HasTuned(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">uint16 GlyphCount(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">uint16 CharMapCount(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">const char *GetPath(void)</span></P>
<P class="Body" style="margin: 0px"><span class="OBOS-Function-Def">FT_Face GetFace(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
These merely return the appropriate flags/values which are assigned values in the constructor.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">const char *Style(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the string value for the particular style.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">FontFamily *Family(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the pointer to the FontStyle object's family. Do NOT delete this pointer.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">int16 ConvertToUnicode(uint16 c)</span></P>
<P class="Body" style="margin: 0px"><BR>
Converts a character code to a UTF-8 string</P>
<P class="Body" style="margin: 0px"><BR>
1) Look up the face from the cache manager</P>
<P class="Body" style="margin: 0px">2) Call FT_Get_Char_Index for the particular character code and return the value</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>