<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Crystal Space 1.2.1: ivideo/fontserv.h Source File (Crystal Space 1.2.1 Public API Reference)</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <table border="0" cellpadding="0" cellspacing="0" width="100%" class="head"> <tr height="59"> <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td> <td class="head"><h2>Public API Reference</h2></td> </tr> <tr height="11"> <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td> </tr> </table> <div class="content"> <!-- Generated by Doxygen 1.5.3 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <h1>ivideo/fontserv.h</h1><a href="fontserv_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> Copyright (C) 2000 by Norman Kraemer</span> <a name="l00003"></a>00003 <span class="comment"></span> <a name="l00004"></a>00004 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00005"></a>00005 <span class="comment"> modify it under the terms of the GNU Library General Public</span> <a name="l00006"></a>00006 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00007"></a>00007 <span class="comment"> version 2 of the License, or (at your option) any later version.</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00010"></a>00010 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00011"></a>00011 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00012"></a>00012 <span class="comment"> Library General Public License for more details.</span> <a name="l00013"></a>00013 <span class="comment"></span> <a name="l00014"></a>00014 <span class="comment"> You should have received a copy of the GNU Library General Public</span> <a name="l00015"></a>00015 <span class="comment"> License along with this library; if not, write to the Free</span> <a name="l00016"></a>00016 <span class="comment"> Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00017"></a>00017 <span class="comment">*/</span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="preprocessor">#ifndef __CS_IVIDEO_FONTSERV_H__</span> <a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __CS_IVIDEO_FONTSERV_H__</span> <a name="l00021"></a>00021 <span class="preprocessor"></span> <a name="l00022"></a>00022 <span class="preprocessor">#include "<a class="code" href="csunicode_8h.html" title="Unicode types and macros.">csutil/csunicode.h</a>"</span> <a name="l00023"></a>00023 <span class="preprocessor">#include "<a class="code" href="scf__interface_8h.html" title="Crystal Space Shared Class Facility (SCF) - interface creation support.">csutil/scf_interface.h</a>"</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "<a class="code" href="ref_8h.html" title="Smart Pointers.">csutil/ref.h</a>"</span> <a name="l00025"></a>00025 <a name="l00041"></a>00041 <a name="l00042"></a><a class="code" href="group__gfx2d.html#ge5edda1607ceec78c642c8375748de0d">00042</a> <span class="preprocessor">#define CSFONT_LARGE "*large"</span> <a name="l00044"></a><a class="code" href="group__gfx2d.html#gc31822ddbd85c9d1e593b73015175859">00044</a> <span class="preprocessor">#define CSFONT_ITALIC "*italic"</span> <a name="l00046"></a><a class="code" href="group__gfx2d.html#g966869f83f23b88b4273ab548afdbd05">00046</a> <span class="preprocessor">#define CSFONT_COURIER "*courier"</span> <a name="l00048"></a><a class="code" href="group__gfx2d.html#gaf49c33450437dbb368b045b394cbef4">00048</a> <span class="preprocessor">#define CSFONT_SMALL "*small"</span> <a name="l00049"></a>00049 <span class="preprocessor"></span> <a name="l00056"></a><a class="code" href="group__gfx2d.html#g3721ddc874319a718319041805acba34">00056</a> <span class="preprocessor">#define CS_FONT_DEFAULT_GLYPH 0xffff</span> <a name="l00057"></a>00057 <span class="preprocessor"></span> <a name="l00058"></a>00058 <span class="keyword">struct </span><a class="code" href="structiFont.html" title="A font object.">iFont</a>; <a name="l00059"></a>00059 <span class="keyword">struct </span><a class="code" href="structiDataBuffer.html" title="The iDataBuffer interface can be used to exchange buffers with abstract data between...">iDataBuffer</a>; <a name="l00060"></a>00060 <a name="l00061"></a>00061 <a name="l00072"></a><a class="code" href="structiFontDeleteNotify.html">00072</a> <span class="keyword">struct </span><a class="code" href="structiFontDeleteNotify.html" title="Called before a font is deleted.">iFontDeleteNotify</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a> <a name="l00073"></a>00073 { <a name="l00074"></a>00074 SCF_INTERFACE(<a class="code" href="structiFontDeleteNotify.html" title="Called before a font is deleted.">iFontDeleteNotify</a>, 2,0,0); <a name="l00076"></a>00076 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiFontDeleteNotify.html#c050f492547ac6ddadc38789598f8ee3" title="Before delete.">BeforeDelete</a> (<a class="code" href="structiFont.html" title="A font object.">iFont</a>* font) = 0; <a name="l00077"></a>00077 }; <a name="l00078"></a>00078 <a name="l00083"></a><a class="code" href="structcsBitmapMetrics.html">00083</a> <span class="keyword">struct </span><a class="code" href="structcsBitmapMetrics.html" title="Metrics for a glyph that are dependent from whether a simple or antialiased image...">csBitmapMetrics</a> <a name="l00084"></a>00084 { <a name="l00086"></a><a class="code" href="structcsBitmapMetrics.html#0476b883a91814827a3a74b9478e46c1">00086</a> <span class="keywordtype">int</span> <a class="code" href="structcsBitmapMetrics.html#0476b883a91814827a3a74b9478e46c1" title="Width of the glyph image.">width</a>; <a name="l00088"></a><a class="code" href="structcsBitmapMetrics.html#04f8a98cd4bb13e503dc04d2a2a74870">00088</a> <span class="keywordtype">int</span> <a class="code" href="structcsBitmapMetrics.html#04f8a98cd4bb13e503dc04d2a2a74870" title="Height of the glyph image.">height</a>; <a name="l00090"></a><a class="code" href="structcsBitmapMetrics.html#decd5c98d4de92f88d8b37460cb2bacb">00090</a> <span class="keywordtype">int</span> <a class="code" href="structcsBitmapMetrics.html#decd5c98d4de92f88d8b37460cb2bacb" title="X offset of the image to the pen position.">left</a>; <a name="l00092"></a><a class="code" href="structcsBitmapMetrics.html#60c8d7a93ceeb76dd1b7385a681cd227">00092</a> <span class="keywordtype">int</span> <a class="code" href="structcsBitmapMetrics.html#60c8d7a93ceeb76dd1b7385a681cd227" title="Y offset of the image to the pen position.">top</a>; <a name="l00093"></a>00093 }; <a name="l00094"></a>00094 <a name="l00099"></a><a class="code" href="structcsGlyphMetrics.html">00099</a> <span class="keyword">struct </span><a class="code" href="structcsGlyphMetrics.html" title="Metrics for a glyph that are independent from whether a simple or antialiased image...">csGlyphMetrics</a> <a name="l00100"></a>00100 { <a name="l00102"></a><a class="code" href="structcsGlyphMetrics.html#1262dc16a7cfb279477286f15fd1d18c">00102</a> <span class="keywordtype">int</span> <a class="code" href="structcsGlyphMetrics.html#1262dc16a7cfb279477286f15fd1d18c" title="Amount of pixels the pen needs to advance after the glyph.">advance</a>; <a name="l00103"></a>00103 }; <a name="l00104"></a>00104 <a name="l00112"></a><a class="code" href="structiFont.html">00112</a> <span class="keyword">struct </span><a class="code" href="structiFont.html" title="A font object.">iFont</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a> <a name="l00113"></a>00113 { <a name="l00114"></a>00114 SCF_INTERFACE (<a class="code" href="structiFont.html" title="A font object.">iFont</a>, 6, 0, 0); <a name="l00115"></a>00115 <a name="l00122"></a>00122 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiFont.html#f9c910f8ebbce7f38564f95e35ca3f3a" title="Add a font delete notification callback routine.">AddDeleteCallback</a> (<a class="code" href="structiFontDeleteNotify.html" title="Called before a font is deleted.">iFontDeleteNotify</a>* func) = 0; <a name="l00123"></a>00123 <a name="l00127"></a>00127 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiFont.html#bd5661f5d0bc73d1bdc74b4c9203e151" title="Remove a font delete notification callback.">RemoveDeleteCallback</a> (<a class="code" href="structiFontDeleteNotify.html" title="Called before a font is deleted.">iFontDeleteNotify</a>* func) = 0; <a name="l00128"></a>00128 <a name="l00133"></a>00133 <span class="keyword">virtual</span> <span class="keywordtype">float</span> <a class="code" href="structiFont.html#b90049387efb00e209f55b7cb80c9acc" title="Query current font size in Point.">GetSize</a> () = 0; <a name="l00134"></a>00134 <a name="l00139"></a>00139 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiFont.html#56460a940e03eefa9e35f945674be3f1" title="Return the maximum width and height of a single glyph, in pixels.">GetMaxSize</a> (<span class="keywordtype">int</span> &oW, <span class="keywordtype">int</span> &oH) = 0; <a name="l00140"></a>00140 <a name="l00144"></a>00144 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiFont.html#fb2c2497e228d4275e020adec482295d" title="Return the metrics of a glyph.">GetGlyphMetrics</a> (<a class="code" href="group__util.html#g47e911f87ff568b2779f26cf226f5070" title="A single char in a UTF32 encoded string.">utf32_char</a> c, <a class="code" href="structcsGlyphMetrics.html" title="Metrics for a glyph that are independent from whether a simple or antialiased image...">csGlyphMetrics</a>& metrics) = 0; <a name="l00145"></a>00145 <a name="l00150"></a>00150 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iDataBuffer></a> <a class="code" href="structiFont.html#dcb081947e8bb9ae67d9d005f5a3010b" title="Return a pointer to a bitmap containing a rendered character.">GetGlyphBitmap</a> (<a class="code" href="group__util.html#g47e911f87ff568b2779f26cf226f5070" title="A single char in a UTF32 encoded string.">utf32_char</a> c, <a name="l00151"></a>00151 <a class="code" href="structcsBitmapMetrics.html" title="Metrics for a glyph that are dependent from whether a simple or antialiased image...">csBitmapMetrics</a>& metrics) = 0; <a name="l00152"></a>00152 <a name="l00158"></a>00158 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iDataBuffer></a> <a class="code" href="structiFont.html#2069806518c2a4147dd69e6762984ebf" title="Return a pointer to a bitmap containing the alpha bitmap for the rendered character...">GetGlyphAlphaBitmap</a> (<a class="code" href="group__util.html#g47e911f87ff568b2779f26cf226f5070" title="A single char in a UTF32 encoded string.">utf32_char</a> c, <a name="l00159"></a>00159 <a class="code" href="structcsBitmapMetrics.html" title="Metrics for a glyph that are dependent from whether a simple or antialiased image...">csBitmapMetrics</a>& metrics) = 0; <a name="l00160"></a>00160 <a name="l00164"></a>00164 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiFont.html#e3e9dc994230ef8cf801812393af9dbe" title="Return the width and height of text written with this font.">GetDimensions</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *text, <span class="keywordtype">int</span> &oW, <span class="keywordtype">int</span> &oH) = 0; <a name="l00165"></a>00165 <a name="l00170"></a>00170 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiFont.html#e3e9dc994230ef8cf801812393af9dbe" title="Return the width and height of text written with this font.">GetDimensions</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *text, <span class="keywordtype">int</span> &oW, <span class="keywordtype">int</span> &oH, <a name="l00171"></a>00171 <span class="keywordtype">int</span> &desc) = 0; <a name="l00172"></a>00172 <a name="l00177"></a>00177 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="structiFont.html#9363065c91027f6d5d290f45e1e050ba" title="Determine how many characters from this string can be written without exceeding given...">GetLength</a> (<span class="keyword">const</span> <span class="keywordtype">char</span> *text, <span class="keywordtype">int</span> maxwidth) = 0; <a name="l00178"></a>00178 <a name="l00185"></a>00185 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="structiFont.html#b00c29d4ed0a66d85ee8d0768b7e24ec" title="Get the font&#39;s descent in pixels.">GetDescent</a> () = 0; <a name="l00186"></a>00186 <a name="l00193"></a>00193 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="structiFont.html#4bbbbf7fac4f9eaa28e1bfaa7c30cdaf" title="Get the font&#39;s ascent in pixels.">GetAscent</a> () = 0; <a name="l00194"></a>00194 <a name="l00198"></a>00198 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiFont.html#9775d91486a124cca446428aa4db4f3a" title="Returns whether a specific glyph is present in this font.">HasGlyph</a> (<a class="code" href="group__util.html#g47e911f87ff568b2779f26cf226f5070" title="A single char in a UTF32 encoded string.">utf32_char</a> c) = 0; <a name="l00199"></a>00199 <a name="l00204"></a>00204 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="structiFont.html#b2b0fce727edc86c57fed4e78e9c88fd" title="Gets the default baseline to baseline distance between two lines of text using this...">GetTextHeight</a> () = 0; <a name="l00205"></a>00205 <a name="l00213"></a>00213 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="structiFont.html#e2a8c21b9c330cb73bd9b9946106cb64" title="When displaying or rendering underlined text, this value corresponds to the vertical...">GetUnderlinePosition</a> () = 0; <a name="l00214"></a>00214 <a name="l00220"></a>00220 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="structiFont.html#b4d0f52ab37e5f43bb71e833b8ebfc0a" title="When displaying or rendering underlined text, this value corresponds to the vertical...">GetUnderlineThickness</a> () = 0; <a name="l00221"></a>00221 }; <a name="l00222"></a>00222 <a name="l00242"></a><a class="code" href="structiFontServer.html">00242</a> <span class="keyword">struct </span><a class="code" href="structiFontServer.html" title="A font server interface.">iFontServer</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a> <a name="l00243"></a>00243 { <a name="l00244"></a>00244 SCF_INTERFACE (<a class="code" href="structiFontServer.html" title="A font server interface.">iFontServer</a>, 4, 0, 0); <a name="l00245"></a>00245 <a name="l00250"></a>00250 <span class="keyword">virtual</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<iFont></a> <a class="code" href="structiFontServer.html#05eee2a2a263d32ac5977eb5890fab6e" title="Load a font by name.">LoadFont</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* filename, <a name="l00251"></a>00251 <span class="keywordtype">float</span> size = 10.0f) = 0; <a name="l00252"></a>00252 <a name="l00258"></a>00258 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="structiFontServer.html#2b21ea889a9945d7014803b694ffab33" title="Enable or disable error reporting.">SetWarnOnError</a> (<span class="keywordtype">bool</span> enable) = 0; <a name="l00260"></a>00260 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiFontServer.html#e41c6bde18c36aa676cd13685129f8a3" title="Get status of warning emission on error.">GetWarnOnError</a> () = 0; <a name="l00261"></a>00261 }; <a name="l00262"></a>00262 <a name="l00265"></a>00265 <span class="preprocessor">#endif // __CS_IVIDEO_FONTSERV_H__</span> </pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by <a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 </small></address> </div></body> </html>