<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Guichan: gcn::Font Class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.4.7 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li id="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul></div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul></div> <div class="nav"> <a class="el" href="namespacegcn.html">gcn</a>::<a class="el" href="classgcn_1_1Font.html">Font</a></div> <h1>gcn::Font Class Reference</h1><!-- doxytag: class="gcn::Font" --><code>#include <<a class="el" href="font_8hpp-source.html">font.hpp</a>></code> <p> <p>Inheritance diagram for gcn::Font: <p><center><img src="classgcn_1_1Font.png" usemap="#gcn::Font_map" border="0" alt=""></center> <map name="gcn::Font_map"> <area href="classgcn_1_1DefaultFont.html" alt="gcn::DefaultFont" shape="rect" coords="0,56,104,80"> <area href="classgcn_1_1ImageFont.html" alt="gcn::ImageFont" shape="rect" coords="114,56,218,80"> </map> <a href="classgcn_1_1Font-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2> Holder of a font. <p> Fonts should inherit from this class and implements it's functions.<p> <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classgcn_1_1ImageFont.html">ImageFont</a> </dd></dl> <p> <p> Definition at line <a class="el" href="font_8hpp-source.html#l00073">73</a> of file <a class="el" href="font_8hpp-source.html">font.hpp</a>.<table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b3bd1c57c092fe0ad1d027c4076e463d"></a><!-- doxytag: member="gcn::Font::~Font" ref="b3bd1c57c092fe0ad1d027c4076e463d" args="()" --> virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcn_1_1Font.html#b3bd1c57c092fe0ad1d027c4076e463d">~Font</a> ()</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcn_1_1Font.html#bb88894b1ebeda28edcac75c537f8e0f">getWidth</a> (const std::string &text) const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the width of a string. <a href="#bb88894b1ebeda28edcac75c537f8e0f"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcn_1_1Font.html#a270d8934a16d4065143e3617b1fa926">getHeight</a> () const =0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets the height of the glyphs in the font. <a href="#a270d8934a16d4065143e3617b1fa926"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual int </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcn_1_1Font.html#3210f4c53424ade4b188b8dfb1f686a4">getStringIndexAt</a> (const std::string &text, int x)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Gets a string index in a string providing an x coordinate. <a href="#3210f4c53424ade4b188b8dfb1f686a4"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgcn_1_1Font.html#055c403050f483cc2c67477443d98eee">drawString</a> (<a class="el" href="classgcn_1_1Graphics.html">Graphics</a> *graphics, const std::string &text, int x, int y)=0</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Draws a string. <a href="#055c403050f483cc2c67477443d98eee"></a><br></td></tr> </table> <hr><h2>Member Function Documentation</h2> <a class="anchor" name="055c403050f483cc2c67477443d98eee"></a><!-- doxytag: member="gcn::Font::drawString" ref="055c403050f483cc2c67477443d98eee" args="(Graphics *graphics, const std::string &text, int x, int y)=0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual void gcn::Font::drawString </td> <td>(</td> <td class="paramtype"><a class="el" href="classgcn_1_1Graphics.html">Graphics</a> * </td> <td class="paramname"> <em>graphics</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>x</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>y</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Draws a string. <p> NOTE: You normally won't use this function to draw text since <a class="el" href="classgcn_1_1Graphics.html">Graphics</a> contains better functions for drawing text.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>graphics</em> </td><td>a <a class="el" href="classgcn_1_1Graphics.html">Graphics</a> object to use for drawing. </td></tr> <tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>the string to draw. </td></tr> <tr><td valign="top"></td><td valign="top"><em>x</em> </td><td>the x coordinate where to draw the string. </td></tr> <tr><td valign="top"></td><td valign="top"><em>y</em> </td><td>the y coordinate where to draw the string. </td></tr> </table> </dl> <p> Implemented in <a class="el" href="classgcn_1_1DefaultFont.html#3cdd4f449bd2114312df6970c6ae2571">gcn::DefaultFont</a>, and <a class="el" href="classgcn_1_1ImageFont.html#8717f4ef08e2ba1a1379a4b8fe4b5002">gcn::ImageFont</a>. <p> Referenced by <a class="el" href="graphics_8cpp-source.html#l00134">gcn::Graphics::drawText()</a>. </div> </div><p> <a class="anchor" name="a270d8934a16d4065143e3617b1fa926"></a><!-- doxytag: member="gcn::Font::getHeight" ref="a270d8934a16d4065143e3617b1fa926" args="() const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual int gcn::Font::getHeight </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Gets the height of the glyphs in the font. <p> <dl compact><dt><b>Returns:</b></dt><dd>the height of the glyphs int the font. </dd></dl> <p> Implemented in <a class="el" href="classgcn_1_1DefaultFont.html#64f2f7bcce5d3780106634e36ac0a52a">gcn::DefaultFont</a>, and <a class="el" href="classgcn_1_1ImageFont.html#e18f2d854e42ce5aafd44e8b8c6ff048">gcn::ImageFont</a>. <p> Referenced by <a class="el" href="dropdown_8cpp-source.html#l00348">gcn::DropDown::adjustHeight()</a>, <a class="el" href="radiobutton_8cpp-source.html#l00298">gcn::RadioButton::adjustSize()</a>, <a class="el" href="checkbox_8cpp-source.html#l00205">gcn::CheckBox::adjustSize()</a>, <a class="el" href="window_8cpp-source.html#l00139">gcn::Window::draw()</a>, <a class="el" href="listbox_8cpp-source.html#l00096">gcn::ListBox::draw()</a>, <a class="el" href="label_8cpp-source.html#l00103">gcn::Label::draw()</a>, <a class="el" href="button_8cpp-source.html#l00120">gcn::Button::draw()</a>, <a class="el" href="textbox_8cpp-source.html#l00197">gcn::TextBox::keyPress()</a>, <a class="el" href="textbox_8cpp-source.html#l00182">gcn::TextBox::mousePress()</a>, <a class="el" href="textbox_8cpp-source.html#l00503">gcn::TextBox::scrollToCaret()</a>, and <a class="el" href="listbox_8cpp-source.html#l00164">gcn::ListBox::setSelected()</a>. </div> </div><p> <a class="anchor" name="3210f4c53424ade4b188b8dfb1f686a4"></a><!-- doxytag: member="gcn::Font::getStringIndexAt" ref="3210f4c53424ade4b188b8dfb1f686a4" args="(const std::string &text, int x)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int gcn::Font::getStringIndexAt </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>text</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"> <em>x</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Gets a string index in a string providing an x coordinate. <p> Used to retrive a string index (for a character in a string) at a certain x position. It is especially useful when a mouse clicks in a <a class="el" href="classgcn_1_1TextField.html">TextField</a> and you want to know which character was clicked.<p> <dl compact><dt><b>Returns:</b></dt><dd>a string index in a string providing an x coordinate. </dd></dl> <p> Reimplemented in <a class="el" href="classgcn_1_1DefaultFont.html#10b802c51de668171c2255f2e11fc063">gcn::DefaultFont</a>, and <a class="el" href="classgcn_1_1ImageFont.html#5b0e7a7a7acdcb9fadb232f63608b354">gcn::ImageFont</a>. <p> Definition at line <a class="el" href="font_8cpp-source.html#l00067">67</a> of file <a class="el" href="font_8cpp-source.html">font.cpp</a>. <p> References <a class="el" href="classgcn_1_1Font.html#bb88894b1ebeda28edcac75c537f8e0f">getWidth()</a>. <p> Referenced by <a class="el" href="textfield_8cpp-source.html#l00154">gcn::TextField::mousePress()</a>, and <a class="el" href="textbox_8cpp-source.html#l00182">gcn::TextBox::mousePress()</a>. </div> </div><p> <a class="anchor" name="bb88894b1ebeda28edcac75c537f8e0f"></a><!-- doxytag: member="gcn::Font::getWidth" ref="bb88894b1ebeda28edcac75c537f8e0f" args="(const std::string &text) const =0" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">virtual int gcn::Font::getWidth </td> <td>(</td> <td class="paramtype">const std::string & </td> <td class="paramname"> <em>text</em> </td> <td> ) </td> <td width="100%"> const<code> [pure virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p> Gets the width of a string. <p> The width of a string is not necesserily the sum of all the widths of it's glyphs.<p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>text</em> </td><td>the string to return the width of. </td></tr> </table> </dl> <dl compact><dt><b>Returns:</b></dt><dd>the width of a string. </dd></dl> <p> Implemented in <a class="el" href="classgcn_1_1DefaultFont.html#62d609afe7f0d0dec90a0ae1cb4731ea">gcn::DefaultFont</a>, and <a class="el" href="classgcn_1_1ImageFont.html#6432c448c9df16a3ca057b2bd9822663">gcn::ImageFont</a>. <p> Referenced by <a class="el" href="textbox_8cpp-source.html#l00356">gcn::TextBox::adjustSize()</a>, <a class="el" href="graphics_8cpp-source.html#l00134">gcn::Graphics::drawText()</a>, <a class="el" href="textfield_8cpp-source.html#l00223">gcn::TextField::fixScroll()</a>, <a class="el" href="font_8cpp-source.html#l00067">getStringIndexAt()</a>, and <a class="el" href="textbox_8cpp-source.html#l00503">gcn::TextBox::scrollToCaret()</a>. </div> </div><p> <hr>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="font_8hpp-source.html">font.hpp</a><li><a class="el" href="font_8cpp-source.html">font.cpp</a></ul> <hr size="1"><address style="align: right;"><small>Generated on Sat Jul 29 19:38:48 2006 for Guichan by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address> </body> </html>