<!-- clanlib header begin --> <HTML> <HEAD> <TITLE>CL_Font::CL_Font - ClanLib Game SDK</TITLE> <STYLE TYPE="text/css"><!-- HTML BODY { font-family: verdana, helvetica, sans-serif; font-size: 12px; } H1 { font-size: 22px; } H2 { font-size: 18px; } H3 { font-size: 16px; } H4 { font-size: 14px; } P { font-size: 12px; } LI { font-size: 12px; } --></STYLE> </HEAD> <body bgcolor=white text=black link=blue vlink=#800080> <center> <img src="http://clanlib.org/gfx/clanlib.png"> </center> <!-- clanlib header end --> <center> <p> <a href="http://clanlib.org/docs.html">Home</a> | <a href="classes.html">All Classes</a> | <a href="modules.html">Grouped Classes</a> | <a href="index.html">Index</a> | <a href="search.html">Search</a> </p> </center> <h1>CL_Font::CL_Font</h1> <p> Constructs a font.</p> <pre> CL_Font(); CL_Font( const CL_Font& copy); CL_Font( const std::string& resource_id, CL_ResourceManager* manager); CL_Font( const CL_Sprite& glyphs, const std::string& letters, int spacelen = -1, bool monospace = false); CL_Font( const std::string& font_name, const std::string& letters, int height, int width = 0, bool bold = false, bool italic = false, bool underline = false, bool strikeout = false); CL_Font( const std::string& font_name, int height, int width = 0, bool bold = false, bool italic = false, bool underline = false, bool strikeout = false); </pre> <p><b>Parameters:</b></p> <dl> <dt><i>resource_id</i></dt><dd>Font resource name.</dd> <dt><i>manager</i></dt><dd>Resource manager used to load font.</dd> <dt><i>glyphs</i></dt><dd>CL_Sprite containing the letters of a bitmap font.</dd> <dt><i>letters</i></dt><dd>String mapping each frame of the bitmap font sprite to letters.</dd> <dt><i>spacelen</i></dt><dd>Width in pixels of the space glyph. If -1, uses the average of all glyph widths.</dd> <dt><i>monospace</i></dt><dd>If true, treats all glyphs as being the same width.</dd> <dt><i>font_name</i></dt><dd>System font name (eg. "Arial").</dd> <dt><i>letter_chars</i></dt><dd>The characters to include in the font (if a sprite font, must be in frame order).</dd> <dt><i>height</i></dt><dd>Height of font in pixels.</dd> <dt><i>width</i></dt><dd>Width of font in pixels. If 0, uses best fitting width for the specified height.</dd> <dt><i>bold</i></dt><dd>If true, will use bold font.</dd> <dt><i>italic</i></dt><dd>If true, will use italic font.</dd> <dt><i>underline</i></dt><dd>If true, will use underlined font.</dd> <dt><i>strikeout</i></dt><dd>If true, will use striked out font.</dd> </dl> <p><b>Detailed description:</b></p> <p>If spacelen is unspecified, CL_Font attempts to resolve it itself. First, it looks to see if you have specified a space character in letter_chars: if you have, it uses that glyph's width as the space width (as well as using it to actually draw the space). If it does not find a space glyph, then it will look at every glyph's width and make the space width the average of that.</p> <p><b>See also:</b></p> <p><a href="CL_ResourceManager.html">CL_ResourceManager</a> | <a href="CL_Resource.html">CL_Resource</a> | <a href="CL_Sprite.html">CL_Sprite</a> | <a href="CL_Font.html">CL_Font</a></p> <!-- clanlib footer begin --> <center><br><br><font color="#a0a0a0"> Questions or comments, write to the <a href="http://clanlib.org/contact.html">ClanLib mailing list</a>. </font></center> </body> </html> <!-- clanlib footer end -->