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

142 lines
5.6 KiB
HTML
Raw Normal View History

<HTML>
<HEAD>
<TITLE>FontFamily.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">FontFamily class</span><span style="color: rgb(0,0,0); font-size: 24pt"></span></P>
<P class="Body" style="margin: 0px"><BR>
FontFamily objects are used to tie together all related font styles.</P>
<P class="Body" style="margin: 0px"><BR>
<HR>
</P>
<P class="Body" style="margin: 0px">Member Functions</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<TABLE WIDTH=463 HEIGHT=90 BORDER=1 CELLPADDING=1 CELLSPACING=2>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">FontFamily(const char *name)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">~FontFamily(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=22>
<P class="Body" style="margin: 0px">const char *GetName(void)</P>
</TD>
<TD WIDTH=260 HEIGHT=22>
<P class="Body" style="margin: 0px">void AddStyle(const char *path, FT_Face face)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">void RemoveStyle(const char *style)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">FontStyle *GetStyle(const char *stylename)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">const char *GetStyle(int32 index)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
<P class="Body" style="margin: 0px">int32 CountStyles(void)</P>
</TD>
</TR>
<TR>
<TD WIDTH=203 HEIGHT=17>
<P class="Body" style="margin: 0px">bool HasStyle(const char *style)</P>
</TD>
<TD WIDTH=260 HEIGHT=17>
&nbsp;
</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">FontFamily(const char *name)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Create and set internal name to the one passed to the constructor</P>
<P class="Body" style="margin: 0px">2) Create the styles list</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">~FontFamily(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
1) delete the internal name</P>
<P class="Body" style="margin: 0px">2) empty and delete the internal style list</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">const char *GetName(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the internal family name</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void AddStyle(const char *path, FT_Face face)</span></P>
<P class="Body" style="margin: 0px"><BR>
Adds the style to the family.</P>
<P class="Body" style="margin: 0px"><BR>
1) Create the FontStyle object and add it to the style list.</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">void RemoveStyle(const char *style)</span></P>
<P class="Body" style="margin: 0px"><BR>
Removes the style from the FontFamily object.</P>
<P class="Body" style="margin: 0px"><BR>
1) Call GetStyle on the given pointer</P>
<P class="Body" style="margin: 0px">2) If non-NULL, delete the object</P>
<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>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">FontStyle *GetStyle(const char *style)</span></P>
<P class="Body" style="margin: 0px"><BR>
Looks up a FontStyle object based on its style name. Returns NULL if not found.</P>
<P class="Body" style="margin: 0px"><BR>
1) Iterate through the style list</P>
<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>
<P class="Body" style="margin: 0px">2) If all items have been checked and nothing has been returned, return NULL</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">const char *GetStyle(int32 index)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the name of the style at <span style="font-style: italic">index</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Get the FontStyle item at <span style="font-style: italic">index</span> obtained via the style list's ItemAt call</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">int32 CountStyles(void)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns the number of items in the style list and, thus, the number of styles in the family</P>
<P class="Body" style="margin: 0px"><BR>
<BR>
<span class="OBOS-Function-Def">bool HasStyle(const char *stylename)</span></P>
<P class="Body" style="margin: 0px"><BR>
Returns true if the family has a style with the name <span style="font-style: italic">stylename</span></P>
<P class="Body" style="margin: 0px"><BR>
1) Call GetStyle on the style name and return false if NULL, true if not.</P>
<P class="Body" style="margin: 0px"><BR>
</P>
<DIV class="layer" id="Layer 1">
</DIV>
</DIV>
</BODY>
</HTML>