<!-- This comment will put IE 6, 7 and 8 in quirks mode --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>ICU 4.4.1: LEFontInstance.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javaScript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body onload='searchBox.OnSelectItem(0);'> <!-- Generated by Doxygen 1.6.2-20100208 --> <script type="text/javascript"><!-- var searchBox = new SearchBox("searchBox", "search",false,'Search'); --></script> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <img id="MSearchSelect" src="search/search.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </div> </li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <h1>LEFontInstance.h</h1><a href="LEFontInstance_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00002"></a>00002 <span class="comment">/*</span> <a name="l00003"></a>00003 <span class="comment"> *</span> <a name="l00004"></a>00004 <span class="comment"> * (C) Copyright IBM Corp. 1998-2007 - All Rights Reserved</span> <a name="l00005"></a>00005 <span class="comment"> *</span> <a name="l00006"></a>00006 <span class="comment"> */</span> <a name="l00007"></a>00007 <a name="l00008"></a>00008 <span class="preprocessor">#ifndef __LEFONTINSTANCE_H</span> <a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define __LEFONTINSTANCE_H</span> <a name="l00010"></a>00010 <span class="preprocessor"></span> <a name="l00011"></a>00011 <span class="preprocessor">#include "<a class="code" href="LETypes_8h.html" title="C API: Basic definitions for the ICU LayoutEngine.">LETypes.h</a>"</span> <a name="l00017"></a>00017 <a class="code" href="uversion_8h.html#a7d9374e037299886d4192b763b4c5e8b" title="This is used to begin a declaration of a public ICU C++ API.">U_NAMESPACE_BEGIN</a> <a name="l00018"></a>00018 <a name="l00028"></a><a class="code" href="classLECharMapper.html">00028</a> <span class="keyword">class </span><a class="code" href="classLECharMapper.html" title="Instances of this class are used by LEFontInstance::mapCharsToGlyphs and LEFontInstance::mapCharToGl...">LECharMapper</a> <span class="comment">/* not : public UObject because this is an interface/mixin class */</span> <a name="l00029"></a>00029 { <a name="l00030"></a>00030 <span class="keyword">public</span>: <a name="l00035"></a>00035 <span class="keyword">virtual</span> <a class="code" href="classLECharMapper.html#aa33a80a6f3612726e7c4a0441975565a" title="Destructor.">~LECharMapper</a>(); <a name="l00036"></a>00036 <a name="l00046"></a>00046 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#a25ed173b2a50d1ab11df41caf054fdb7" title="Used to represent 32-bit Unicode code points.">LEUnicode32</a> <a class="code" href="classLECharMapper.html#a9bced2d7d41aacba12124228c58b5210" title="This method does the adjustments.">mapChar</a>(<a class="code" href="LETypes_8h.html#a25ed173b2a50d1ab11df41caf054fdb7" title="Used to represent 32-bit Unicode code points.">LEUnicode32</a> ch) <span class="keyword">const</span> = 0; <a name="l00047"></a>00047 }; <a name="l00048"></a>00048 <a name="l00055"></a>00055 <span class="keyword">class </span><a class="code" href="classLEGlyphStorage.html" title="This class encapsulates the per-glyph storage used by the ICU LayoutEngine.">LEGlyphStorage</a>; <a name="l00056"></a>00056 <a name="l00081"></a><a class="code" href="classLEFontInstance.html">00081</a> <span class="keyword">class </span><a class="code" href="utypes_8h.html#a623f81640d6092d9141a1d4d24ccaffc" title="Set to export library symbols from inside the layout engine library, and to import...">U_LAYOUT_API</a> <a class="code" href="classLEFontInstance.html" title="This is a virtual base class that serves as the interface between a LayoutEngine...">LEFontInstance</a> : <span class="keyword">public</span> <a class="code" href="classUObject.html" title="UObject is the common ICU &quot;boilerplate&quot; class.">UObject</a> <a name="l00082"></a>00082 { <a name="l00083"></a>00083 <span class="keyword">public</span>: <a name="l00084"></a>00084 <a name="l00091"></a>00091 <span class="keyword">virtual</span> ~<a class="code" href="classLEFontInstance.html" title="This is a virtual base class that serves as the interface between a LayoutEngine...">LEFontInstance</a>(); <a name="l00092"></a>00092 <a name="l00144"></a>00144 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classLEFontInstance.html" title="This is a virtual base class that serves as the interface between a LayoutEngine...">LEFontInstance</a> *getSubFont(<span class="keyword">const</span> <a class="code" href="LETypes_8h.html#a903cb689308cdef41500411d096a2c2d" title="Used to represent 16-bit Unicode code points.">LEUnicode</a> chars[], <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> *offset, <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> limit, <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> script, <a class="code" href="LETypes_8h.html#a2f75d3bb5abf7f0a71adbf00826e1934" title="Error codes returned by the LayoutEngine.">LEErrorCode</a> &success) <span class="keyword">const</span>; <a name="l00145"></a>00145 <a name="l00146"></a>00146 <span class="comment">//</span> <a name="l00147"></a>00147 <span class="comment">// Font file access</span> <a name="l00148"></a>00148 <span class="comment">//</span> <a name="l00149"></a>00149 <a name="l00166"></a>00166 <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">void</span> *getFontTable(<a class="code" href="LETypes_8h.html#a9e22a06bf2336b583b317287cb94fcfa" title="Used for four character tags.">LETag</a> tableTag) <span class="keyword">const</span> = 0; <a name="l00167"></a>00167 <a name="l00184"></a>00184 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#a4b77bc254d0e88fdabffde9c03e6728f" title="A type used for boolean values.">le_bool</a> canDisplay(<a class="code" href="LETypes_8h.html#a25ed173b2a50d1ab11df41caf054fdb7" title="Used to represent 32-bit Unicode code points.">LEUnicode32</a> ch) <span class="keyword">const</span>; <a name="l00185"></a>00185 <a name="l00194"></a>00194 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> getUnitsPerEM() <span class="keyword">const</span> = 0; <a name="l00195"></a>00195 <a name="l00219"></a>00219 <span class="keyword">virtual</span> <span class="keywordtype">void</span> mapCharsToGlyphs(<span class="keyword">const</span> <a class="code" href="LETypes_8h.html#a903cb689308cdef41500411d096a2c2d" title="Used to represent 16-bit Unicode code points.">LEUnicode</a> chars[], <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> offset, <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> count, <a class="code" href="LETypes_8h.html#a4b77bc254d0e88fdabffde9c03e6728f" title="A type used for boolean values.">le_bool</a> reverse, <span class="keyword">const</span> <a class="code" href="classLECharMapper.html" title="Instances of this class are used by LEFontInstance::mapCharsToGlyphs and LEFontInstance::mapCharToGl...">LECharMapper</a> *mapper, <a class="code" href="LETypes_8h.html#a4b77bc254d0e88fdabffde9c03e6728f" title="A type used for boolean values.">le_bool</a> filterZeroWidth, <a class="code" href="classLEGlyphStorage.html" title="This class encapsulates the per-glyph storage used by the ICU LayoutEngine.">LEGlyphStorage</a> &glyphStorage) <span class="keyword">const</span>; <a name="l00220"></a>00220 <a name="l00236"></a>00236 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#ae440e077586bced1a0d1c534643ffc23" title="Used for glyph indices.">LEGlyphID</a> mapCharToGlyph(<a class="code" href="LETypes_8h.html#a25ed173b2a50d1ab11df41caf054fdb7" title="Used to represent 32-bit Unicode code points.">LEUnicode32</a> ch, <span class="keyword">const</span> <a class="code" href="classLECharMapper.html" title="Instances of this class are used by LEFontInstance::mapCharsToGlyphs and LEFontInstance::mapCharToGl...">LECharMapper</a> *mapper, <a class="code" href="LETypes_8h.html#a4b77bc254d0e88fdabffde9c03e6728f" title="A type used for boolean values.">le_bool</a> filterZeroWidth) <span class="keyword">const</span>; <a name="l00237"></a>00237 <a name="l00252"></a>00252 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#ae440e077586bced1a0d1c534643ffc23" title="Used for glyph indices.">LEGlyphID</a> mapCharToGlyph(<a class="code" href="LETypes_8h.html#a25ed173b2a50d1ab11df41caf054fdb7" title="Used to represent 32-bit Unicode code points.">LEUnicode32</a> ch, <span class="keyword">const</span> <a class="code" href="classLECharMapper.html" title="Instances of this class are used by LEFontInstance::mapCharsToGlyphs and LEFontInstance::mapCharToGl...">LECharMapper</a> *mapper) <span class="keyword">const</span>; <a name="l00253"></a>00253 <a name="l00266"></a>00266 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#ae440e077586bced1a0d1c534643ffc23" title="Used for glyph indices.">LEGlyphID</a> mapCharToGlyph(<a class="code" href="LETypes_8h.html#a25ed173b2a50d1ab11df41caf054fdb7" title="Used to represent 32-bit Unicode code points.">LEUnicode32</a> ch) <span class="keyword">const</span> = 0; <a name="l00267"></a>00267 <a name="l00268"></a>00268 <span class="comment">//</span> <a name="l00269"></a>00269 <span class="comment">// Metrics</span> <a name="l00270"></a>00270 <span class="comment">//</span> <a name="l00271"></a>00271 <a name="l00280"></a>00280 <span class="keyword">virtual</span> <span class="keywordtype">void</span> getGlyphAdvance(<a class="code" href="LETypes_8h.html#ae440e077586bced1a0d1c534643ffc23" title="Used for glyph indices.">LEGlyphID</a> glyph, <a class="code" href="structLEPoint.html" title="Used to hold a pair of (x, y) values which represent a point.">LEPoint</a> &advance) <span class="keyword">const</span> = 0; <a name="l00281"></a>00281 <a name="l00294"></a>00294 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#a4b77bc254d0e88fdabffde9c03e6728f" title="A type used for boolean values.">le_bool</a> getGlyphPoint(<a class="code" href="LETypes_8h.html#ae440e077586bced1a0d1c534643ffc23" title="Used for glyph indices.">LEGlyphID</a> glyph, <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> pointNumber, <a class="code" href="structLEPoint.html" title="Used to hold a pair of (x, y) values which represent a point.">LEPoint</a> &point) <span class="keyword">const</span> = 0; <a name="l00295"></a>00295 <a name="l00304"></a>00304 <span class="keyword">virtual</span> <span class="keywordtype">float</span> getXPixelsPerEm() <span class="keyword">const</span> = 0; <a name="l00305"></a>00305 <a name="l00314"></a>00314 <span class="keyword">virtual</span> <span class="keywordtype">float</span> getYPixelsPerEm() <span class="keyword">const</span> = 0; <a name="l00315"></a>00315 <a name="l00326"></a>00326 <span class="keyword">virtual</span> <span class="keywordtype">float</span> xUnitsToPoints(<span class="keywordtype">float</span> xUnits) <span class="keyword">const</span>; <a name="l00327"></a>00327 <a name="l00338"></a>00338 <span class="keyword">virtual</span> <span class="keywordtype">float</span> yUnitsToPoints(<span class="keywordtype">float</span> yUnits) <span class="keyword">const</span>; <a name="l00339"></a>00339 <a name="l00348"></a>00348 <span class="keyword">virtual</span> <span class="keywordtype">void</span> unitsToPoints(<a class="code" href="structLEPoint.html" title="Used to hold a pair of (x, y) values which represent a point.">LEPoint</a> &units, <a class="code" href="structLEPoint.html" title="Used to hold a pair of (x, y) values which represent a point.">LEPoint</a> &points) <span class="keyword">const</span>; <a name="l00349"></a>00349 <a name="l00360"></a>00360 <span class="keyword">virtual</span> <span class="keywordtype">float</span> xPixelsToUnits(<span class="keywordtype">float</span> xPixels) <span class="keyword">const</span>; <a name="l00361"></a>00361 <a name="l00372"></a>00372 <span class="keyword">virtual</span> <span class="keywordtype">float</span> yPixelsToUnits(<span class="keywordtype">float</span> yPixels) <span class="keyword">const</span>; <a name="l00373"></a>00373 <a name="l00382"></a>00382 <span class="keyword">virtual</span> <span class="keywordtype">void</span> pixelsToUnits(<a class="code" href="structLEPoint.html" title="Used to hold a pair of (x, y) values which represent a point.">LEPoint</a> &pixels, <a class="code" href="structLEPoint.html" title="Used to hold a pair of (x, y) values which represent a point.">LEPoint</a> &units) <span class="keyword">const</span>; <a name="l00383"></a>00383 <a name="l00395"></a>00395 <span class="keyword">virtual</span> <span class="keywordtype">float</span> getScaleFactorX() <span class="keyword">const</span> = 0; <a name="l00396"></a>00396 <a name="l00407"></a>00407 <span class="keyword">virtual</span> <span class="keywordtype">float</span> getScaleFactorY() <span class="keyword">const</span> = 0; <a name="l00408"></a>00408 <a name="l00424"></a>00424 <span class="keyword">virtual</span> <span class="keywordtype">void</span> transformFunits(<span class="keywordtype">float</span> xFunits, <span class="keywordtype">float</span> yFunits, <a class="code" href="structLEPoint.html" title="Used to hold a pair of (x, y) values which represent a point.">LEPoint</a> &pixels) <span class="keyword">const</span>; <a name="l00425"></a>00425 <a name="l00436"></a>00436 <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> fixedToFloat(<a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> fixed); <a name="l00437"></a>00437 <a name="l00448"></a>00448 <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> floatToFixed(<span class="keywordtype">float</span> theFloat); <a name="l00449"></a>00449 <a name="l00450"></a>00450 <span class="comment">//</span> <a name="l00451"></a>00451 <span class="comment">// These methods won't ever be called by the LayoutEngine,</span> <a name="l00452"></a>00452 <span class="comment">// but are useful for clients of <code>LEFontInstance</code> who</span> <a name="l00453"></a>00453 <span class="comment">// need to render text.</span> <a name="l00454"></a>00454 <span class="comment">//</span> <a name="l00455"></a>00455 <a name="l00464"></a>00464 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> getAscent() <span class="keyword">const</span> = 0; <a name="l00465"></a>00465 <a name="l00474"></a>00474 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> getDescent() <span class="keyword">const</span> = 0; <a name="l00475"></a>00475 <a name="l00484"></a>00484 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> getLeading() <span class="keyword">const</span> = 0; <a name="l00485"></a>00485 <a name="l00496"></a>00496 <span class="keyword">virtual</span> <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> getLineHeight() <span class="keyword">const</span>; <a name="l00497"></a>00497 <a name="l00503"></a>00503 <span class="keyword">virtual</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> <a class="code" href="classUObject.html#a9b1acc95efd89cb86ec31f2dc947a262" title="ICU4C &quot;poor man&#39;s RTTI&quot;, returns a UClassID for the actual ICU class...">getDynamicClassID</a>() <span class="keyword">const</span>; <a name="l00504"></a>00504 <a name="l00510"></a>00510 <span class="keyword">static</span> <a class="code" href="utypes_8h.html#a22af10545208a455a6e884008df48e9f" title="UClassID is used to identify classes without using RTTI, since RTTI is not yet supported...">UClassID</a> getStaticClassID(); <a name="l00511"></a>00511 <a name="l00512"></a>00512 }; <a name="l00513"></a>00513 <a name="l00514"></a><a class="code" href="classLEFontInstance.html#ae6c01ddc73d5f9dec656bc2845fdfd4b">00514</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classLEFontInstance.html#ae6c01ddc73d5f9dec656bc2845fdfd4b" title="This is a convenience method used to convert values in a 16.16 fixed point format...">LEFontInstance::fixedToFloat</a>(<a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> fixed) <a name="l00515"></a>00515 { <a name="l00516"></a>00516 <span class="keywordflow">return</span> (<span class="keywordtype">float</span>) (fixed / 65536.0); <a name="l00517"></a>00517 } <a name="l00518"></a>00518 <a name="l00519"></a><a class="code" href="classLEFontInstance.html#a9102c10c6835d4007820f3e72ebf38cd">00519</a> <span class="keyword">inline</span> <a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a> <a class="code" href="classLEFontInstance.html#a9102c10c6835d4007820f3e72ebf38cd" title="This is a convenience method used to convert floating point values to 16.16 fixed...">LEFontInstance::floatToFixed</a>(<span class="keywordtype">float</span> theFloat) <a name="l00520"></a>00520 { <a name="l00521"></a>00521 <span class="keywordflow">return</span> (<a class="code" href="LETypes_8h.html#a3ae79f31399d76e3055d2a2745bd0d9a" title="A type used for signed, 32-bit integers.">le_int32</a>) (theFloat * 65536.0); <a name="l00522"></a>00522 } <a name="l00523"></a>00523 <a name="l00524"></a>00524 <a class="code" href="uversion_8h.html#a3da1f00f3b02976ac53c014a3e4c0933" title="This is used to end a declaration of a public ICU C++ API.">U_NAMESPACE_END</a> <a name="l00525"></a>00525 <span class="preprocessor">#endif</span> <a name="l00526"></a>00526 <span class="preprocessor"></span> <a name="l00527"></a>00527 </pre></div></div> <!--- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Defines</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>