/modules/freetype2/docs/reference/ft2-cache_subsystem.html

http://github.com/zpao/v8monkey · HTML · 1170 lines · 1073 code · 97 blank · 0 comment · 0 complexity · f746f3d00405e3fdcf37ccb395e7c377 MD5 · raw file

Large files are truncated click here to view the full file

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>FreeType-2.4.3 API Reference</title>
  7. <style type="text/css">
  8. body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
  9. color: #000000;
  10. background: #FFFFFF; }
  11. p { text-align: justify; }
  12. h1 { text-align: center; }
  13. li { text-align: justify; }
  14. td { padding: 0 0.5em 0 0.5em; }
  15. td.left { padding: 0 0.5em 0 0.5em;
  16. text-align: left; }
  17. a:link { color: #0000EF; }
  18. a:visited { color: #51188E; }
  19. a:hover { color: #FF0000; }
  20. span.keyword { font-family: monospace;
  21. text-align: left;
  22. white-space: pre;
  23. color: darkblue; }
  24. pre.colored { color: blue; }
  25. ul.empty { list-style-type: none; }
  26. </style>
  27. </head>
  28. <body>
  29. <table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
  30. <td width="100%"></td>
  31. <td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  32. <center><h1>FreeType-2.4.3 API Reference</h1></center>
  33. <center><h1>
  34. Cache Sub-System
  35. </h1></center>
  36. <h2>Synopsis</h2>
  37. <table align=center cellspacing=5 cellpadding=0 border=0>
  38. <tr><td></td><td><a href="#FTC_Manager">FTC_Manager</a></td><td></td><td><a href="#FTC_CMapCache_New">FTC_CMapCache_New</a></td></tr>
  39. <tr><td></td><td><a href="#FTC_FaceID">FTC_FaceID</a></td><td></td><td><a href="#FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a></td></tr>
  40. <tr><td></td><td><a href="#FTC_Face_Requester">FTC_Face_Requester</a></td><td></td><td><a href="#FTC_ImageTypeRec">FTC_ImageTypeRec</a></td></tr>
  41. <tr><td></td><td><a href="#FTC_Node">FTC_Node</a></td><td></td><td><a href="#FTC_ImageType">FTC_ImageType</a></td></tr>
  42. <tr><td></td><td><a href="#FTC_Manager_New">FTC_Manager_New</a></td><td></td><td><a href="#FTC_ImageCache">FTC_ImageCache</a></td></tr>
  43. <tr><td></td><td><a href="#FTC_Manager_Reset">FTC_Manager_Reset</a></td><td></td><td><a href="#FTC_ImageCache_New">FTC_ImageCache_New</a></td></tr>
  44. <tr><td></td><td><a href="#FTC_Manager_Done">FTC_Manager_Done</a></td><td></td><td><a href="#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a></td></tr>
  45. <tr><td></td><td><a href="#FTC_Manager_LookupFace">FTC_Manager_LookupFace</a></td><td></td><td><a href="#FTC_ImageCache_LookupScaler">FTC_ImageCache_LookupScaler</a></td></tr>
  46. <tr><td></td><td><a href="#FTC_ScalerRec">FTC_ScalerRec</a></td><td></td><td><a href="#FTC_SBit">FTC_SBit</a></td></tr>
  47. <tr><td></td><td><a href="#FTC_Scaler">FTC_Scaler</a></td><td></td><td><a href="#FTC_SBitRec">FTC_SBitRec</a></td></tr>
  48. <tr><td></td><td><a href="#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a></td><td></td><td><a href="#FTC_SBitCache">FTC_SBitCache</a></td></tr>
  49. <tr><td></td><td><a href="#FTC_Node_Unref">FTC_Node_Unref</a></td><td></td><td><a href="#FTC_SBitCache_New">FTC_SBitCache_New</a></td></tr>
  50. <tr><td></td><td><a href="#FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a></td><td></td><td><a href="#FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a></td></tr>
  51. <tr><td></td><td><a href="#FTC_CMapCache">FTC_CMapCache</a></td><td></td><td><a href="#FTC_SBitCache_LookupScaler">FTC_SBitCache_LookupScaler</a></td></tr>
  52. </table><br><br>
  53. <table align=center width="87%"><tr><td>
  54. <p>This section describes the FreeType&nbsp;2 cache sub-system, which is used to limit the number of concurrently opened <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects, as well as caching information like character maps and glyph images while limiting their maximum memory usage.</p>
  55. <p>Note that all types and functions begin with the &lsquo;FTC_&rsquo; prefix.</p>
  56. <p>The cache is highly portable and thus doesn't know anything about the fonts installed on your system, or how to access them. This implies the following scheme:</p>
  57. <p>First, available or installed font faces are uniquely identified by <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> values, provided to the cache by the client. Note that the cache only stores and compares these values, and doesn't try to interpret them in any way.</p>
  58. <p>Second, the cache calls, only when needed, a client-provided function to convert an <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> into a new <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object. The latter is then completely managed by the cache, including its termination through <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a>. To monitor termination of face objects, the finalizer callback in the &lsquo;generic&rsquo; field of the <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object can be used, which might also be used to store the <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> of the face.</p>
  59. <p>Clients are free to map face IDs to anything else. The most simple usage is to associate them to a (pathname,face_index) pair that is used to call <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a>. However, more complex schemes are also possible.</p>
  60. <p>Note that for the cache to work correctly, the face ID values must be <b>persistent</b>, which means that the contents they point to should not change at runtime, or that their value should not become invalid.</p>
  61. <p>If this is unavoidable (e.g., when a font is uninstalled at runtime), you should call <a href="ft2-cache_subsystem.html#FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a> as soon as possible, to let the cache get rid of any references to the old <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> it may keep internally. Failure to do so will lead to incorrect behaviour or even crashes.</p>
  62. <p>To use the cache, start with calling <a href="ft2-cache_subsystem.html#FTC_Manager_New">FTC_Manager_New</a> to create a new <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> object, which models a single cache instance. You can then look up <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects with <a href="ft2-cache_subsystem.html#FTC_Manager_LookupFace">FTC_Manager_LookupFace</a> and <a href="ft2-cache_subsystem.html#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a>, respectively.</p>
  63. <p>If you want to use the charmap caching, call <a href="ft2-cache_subsystem.html#FTC_CMapCache_New">FTC_CMapCache_New</a>, then later use <a href="ft2-cache_subsystem.html#FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a> to perform the equivalent of <a href="ft2-base_interface.html#FT_Get_Char_Index">FT_Get_Char_Index</a>, only much faster.</p>
  64. <p>If you want to use the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> caching, call <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a>, then later use <a href="ft2-cache_subsystem.html#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a> to retrieve the corresponding <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> objects from the cache.</p>
  65. <p>If you need lots of small bitmaps, it is much more memory efficient to call <a href="ft2-cache_subsystem.html#FTC_SBitCache_New">FTC_SBitCache_New</a> followed by <a href="ft2-cache_subsystem.html#FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a>. This returns <a href="ft2-cache_subsystem.html#FTC_SBitRec">FTC_SBitRec</a> structures, which are used to store small bitmaps directly. (A small bitmap is one whose metrics and dimensions all fit into 8-bit integers).</p>
  66. <p>We hope to also provide a kerning cache in the near future.</p>
  67. </td></tr></table><br>
  68. <table align=center width="75%"><tr><td>
  69. <h4><a name="FTC_Manager">FTC_Manager</a></h4>
  70. <table align=center width="87%"><tr><td>
  71. Defined in FT_CACHE_H (freetype/ftcache.h).
  72. </td></tr></table><br>
  73. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  74. <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ManagerRec_* <b>FTC_Manager</b>;
  75. </pre></table><br>
  76. <table align=center width="87%"><tr><td>
  77. <p>This object corresponds to one instance of the cache-subsystem. It is used to cache one or more <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects, along with corresponding <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects.</p>
  78. <p>The manager intentionally limits the total number of opened <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects to control memory usage. See the &lsquo;max_faces&rsquo; and &lsquo;max_sizes&rsquo; parameters of <a href="ft2-cache_subsystem.html#FTC_Manager_New">FTC_Manager_New</a>.</p>
  79. <p>The manager is also used to cache &lsquo;nodes&rsquo; of various types while limiting their total memory usage.</p>
  80. <p>All limitations are enforced by keeping lists of managed objects in most-recently-used order, and flushing old nodes to make room for new ones.</p>
  81. </td></tr></table><br>
  82. </td></tr></table>
  83. <hr width="75%">
  84. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  85. <td width="100%"></td>
  86. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  87. <table align=center width="75%"><tr><td>
  88. <h4><a name="FTC_FaceID">FTC_FaceID</a></h4>
  89. <table align=center width="87%"><tr><td>
  90. Defined in FT_CACHE_H (freetype/ftcache.h).
  91. </td></tr></table><br>
  92. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  93. <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a> <b>FTC_FaceID</b>;
  94. </pre></table><br>
  95. <table align=center width="87%"><tr><td>
  96. <p>An opaque pointer type that is used to identity face objects. The contents of such objects is application-dependent.</p>
  97. <p>These pointers are typically used to point to a user-defined structure containing a font file path, and face index.</p>
  98. </td></tr></table><br>
  99. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  100. <p>Never use NULL as a valid <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>.</p>
  101. <p>Face IDs are passed by the client to the cache manager, which calls, when needed, the <a href="ft2-cache_subsystem.html#FTC_Face_Requester">FTC_Face_Requester</a> to translate them into new <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects.</p>
  102. <p>If the content of a given face ID changes at runtime, or if the value becomes invalid (e.g., when uninstalling a font), you should immediately call <a href="ft2-cache_subsystem.html#FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a> before any other cache function.</p>
  103. <p>Failure to do so will result in incorrect behaviour or even memory leaks and crashes.</p>
  104. </td></tr></table>
  105. </td></tr></table>
  106. <hr width="75%">
  107. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  108. <td width="100%"></td>
  109. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  110. <table align=center width="75%"><tr><td>
  111. <h4><a name="FTC_Face_Requester">FTC_Face_Requester</a></h4>
  112. <table align=center width="87%"><tr><td>
  113. Defined in FT_CACHE_H (freetype/ftcache.h).
  114. </td></tr></table><br>
  115. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  116. <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Error">FT_Error</a>
  117. (*<b>FTC_Face_Requester</b>)( <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> face_id,
  118. <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
  119. <a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a> request_data,
  120. <a href="ft2-base_interface.html#FT_Face">FT_Face</a>* aface );
  121. </pre></table><br>
  122. <table align=center width="87%"><tr><td>
  123. <p>A callback function provided by client applications. It is used by the cache manager to translate a given <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> into a new valid <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object, on demand.</p>
  124. </td></tr></table><br>
  125. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  126. <p></p>
  127. <table cellpadding=3 border=0>
  128. <tr valign=top><td><b>face_id</b></td><td>
  129. <p>The face ID to resolve.</p>
  130. </td></tr>
  131. <tr valign=top><td><b>library</b></td><td>
  132. <p>A handle to a FreeType library object.</p>
  133. </td></tr>
  134. <tr valign=top><td><b>req_data</b></td><td>
  135. <p>Application-provided request data (see note below).</p>
  136. </td></tr>
  137. </table>
  138. </td></tr></table>
  139. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
  140. <p></p>
  141. <table cellpadding=3 border=0>
  142. <tr valign=top><td><b>aface</b></td><td>
  143. <p>A new <a href="ft2-base_interface.html#FT_Face">FT_Face</a> handle.</p>
  144. </td></tr>
  145. </table>
  146. </td></tr></table>
  147. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  148. <p>FreeType error code. 0&nbsp;means success.</p>
  149. </td></tr></table>
  150. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  151. <p>The third parameter &lsquo;req_data&rsquo; is the same as the one passed by the client when <a href="ft2-cache_subsystem.html#FTC_Manager_New">FTC_Manager_New</a> is called.</p>
  152. <p>The face requester should not perform funny things on the returned face object, like creating a new <a href="ft2-base_interface.html#FT_Size">FT_Size</a> for it, or setting a transformation through <a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a>!</p>
  153. </td></tr></table>
  154. </td></tr></table>
  155. <hr width="75%">
  156. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  157. <td width="100%"></td>
  158. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  159. <table align=center width="75%"><tr><td>
  160. <h4><a name="FTC_Node">FTC_Node</a></h4>
  161. <table align=center width="87%"><tr><td>
  162. Defined in FT_CACHE_H (freetype/ftcache.h).
  163. </td></tr></table><br>
  164. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  165. <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_NodeRec_* <b>FTC_Node</b>;
  166. </pre></table><br>
  167. <table align=center width="87%"><tr><td>
  168. <p>An opaque handle to a cache node object. Each cache node is reference-counted. A node with a count of&nbsp;0 might be flushed out of a full cache whenever a lookup request is performed.</p>
  169. <p>If you look up nodes, you have the ability to &lsquo;acquire&rsquo; them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly &lsquo;release&rsquo; it (see <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a>).</p>
  170. <p>See also <a href="ft2-cache_subsystem.html#FTC_SBitCache_Lookup">FTC_SBitCache_Lookup</a> and <a href="ft2-cache_subsystem.html#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a>.</p>
  171. </td></tr></table><br>
  172. </td></tr></table>
  173. <hr width="75%">
  174. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  175. <td width="100%"></td>
  176. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  177. <table align=center width="75%"><tr><td>
  178. <h4><a name="FTC_Manager_New">FTC_Manager_New</a></h4>
  179. <table align=center width="87%"><tr><td>
  180. Defined in FT_CACHE_H (freetype/ftcache.h).
  181. </td></tr></table><br>
  182. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  183. FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
  184. <b>FTC_Manager_New</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
  185. <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> max_faces,
  186. <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> max_sizes,
  187. <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a> max_bytes,
  188. <a href="ft2-cache_subsystem.html#FTC_Face_Requester">FTC_Face_Requester</a> requester,
  189. <a href="ft2-basic_types.html#FT_Pointer">FT_Pointer</a> req_data,
  190. <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> *amanager );
  191. </pre></table><br>
  192. <table align=center width="87%"><tr><td>
  193. <p>Create a new cache manager.</p>
  194. </td></tr></table><br>
  195. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  196. <p></p>
  197. <table cellpadding=3 border=0>
  198. <tr valign=top><td><b>library</b></td><td>
  199. <p>The parent FreeType library handle to use.</p>
  200. </td></tr>
  201. <tr valign=top><td><b>max_faces</b></td><td>
  202. <p>Maximum number of opened <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects managed by this cache instance. Use&nbsp;0 for defaults.</p>
  203. </td></tr>
  204. <tr valign=top><td><b>max_sizes</b></td><td>
  205. <p>Maximum number of opened <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects managed by this cache instance. Use&nbsp;0 for defaults.</p>
  206. </td></tr>
  207. <tr valign=top><td><b>max_bytes</b></td><td>
  208. <p>Maximum number of bytes to use for cached data nodes. Use&nbsp;0 for defaults. Note that this value does not account for managed <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects.</p>
  209. </td></tr>
  210. <tr valign=top><td><b>requester</b></td><td>
  211. <p>An application-provided callback used to translate face IDs into real <a href="ft2-base_interface.html#FT_Face">FT_Face</a> objects.</p>
  212. </td></tr>
  213. <tr valign=top><td><b>req_data</b></td><td>
  214. <p>A generic pointer that is passed to the requester each time it is called (see <a href="ft2-cache_subsystem.html#FTC_Face_Requester">FTC_Face_Requester</a>).</p>
  215. </td></tr>
  216. </table>
  217. </td></tr></table>
  218. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
  219. <p></p>
  220. <table cellpadding=3 border=0>
  221. <tr valign=top><td><b>amanager</b></td><td>
  222. <p>A handle to a new manager object. 0&nbsp;in case of failure.</p>
  223. </td></tr>
  224. </table>
  225. </td></tr></table>
  226. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  227. <p>FreeType error code. 0&nbsp;means success.</p>
  228. </td></tr></table>
  229. </td></tr></table>
  230. <hr width="75%">
  231. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  232. <td width="100%"></td>
  233. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  234. <table align=center width="75%"><tr><td>
  235. <h4><a name="FTC_Manager_Reset">FTC_Manager_Reset</a></h4>
  236. <table align=center width="87%"><tr><td>
  237. Defined in FT_CACHE_H (freetype/ftcache.h).
  238. </td></tr></table><br>
  239. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  240. FT_EXPORT( <span class="keyword">void</span> )
  241. <b>FTC_Manager_Reset</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager );
  242. </pre></table><br>
  243. <table align=center width="87%"><tr><td>
  244. <p>Empty a given cache manager. This simply gets rid of all the currently cached <a href="ft2-base_interface.html#FT_Face">FT_Face</a> and <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects within the manager.</p>
  245. </td></tr></table><br>
  246. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
  247. <p></p>
  248. <table cellpadding=3 border=0>
  249. <tr valign=top><td><b>manager</b></td><td>
  250. <p>A handle to the manager.</p>
  251. </td></tr>
  252. </table>
  253. </td></tr></table>
  254. </td></tr></table>
  255. <hr width="75%">
  256. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  257. <td width="100%"></td>
  258. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  259. <table align=center width="75%"><tr><td>
  260. <h4><a name="FTC_Manager_Done">FTC_Manager_Done</a></h4>
  261. <table align=center width="87%"><tr><td>
  262. Defined in FT_CACHE_H (freetype/ftcache.h).
  263. </td></tr></table><br>
  264. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  265. FT_EXPORT( <span class="keyword">void</span> )
  266. <b>FTC_Manager_Done</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager );
  267. </pre></table><br>
  268. <table align=center width="87%"><tr><td>
  269. <p>Destroy a given manager after emptying it.</p>
  270. </td></tr></table><br>
  271. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  272. <p></p>
  273. <table cellpadding=3 border=0>
  274. <tr valign=top><td><b>manager</b></td><td>
  275. <p>A handle to the target cache manager object.</p>
  276. </td></tr>
  277. </table>
  278. </td></tr></table>
  279. </td></tr></table>
  280. <hr width="75%">
  281. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  282. <td width="100%"></td>
  283. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  284. <table align=center width="75%"><tr><td>
  285. <h4><a name="FTC_Manager_LookupFace">FTC_Manager_LookupFace</a></h4>
  286. <table align=center width="87%"><tr><td>
  287. Defined in FT_CACHE_H (freetype/ftcache.h).
  288. </td></tr></table><br>
  289. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  290. FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
  291. <b>FTC_Manager_LookupFace</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager,
  292. <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> face_id,
  293. <a href="ft2-base_interface.html#FT_Face">FT_Face</a> *aface );
  294. </pre></table><br>
  295. <table align=center width="87%"><tr><td>
  296. <p>Retrieve the <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object that corresponds to a given face ID through a cache manager.</p>
  297. </td></tr></table><br>
  298. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  299. <p></p>
  300. <table cellpadding=3 border=0>
  301. <tr valign=top><td><b>manager</b></td><td>
  302. <p>A handle to the cache manager.</p>
  303. </td></tr>
  304. <tr valign=top><td><b>face_id</b></td><td>
  305. <p>The ID of the face object.</p>
  306. </td></tr>
  307. </table>
  308. </td></tr></table>
  309. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
  310. <p></p>
  311. <table cellpadding=3 border=0>
  312. <tr valign=top><td><b>aface</b></td><td>
  313. <p>A handle to the face object.</p>
  314. </td></tr>
  315. </table>
  316. </td></tr></table>
  317. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  318. <p>FreeType error code. 0&nbsp;means success.</p>
  319. </td></tr></table>
  320. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  321. <p>The returned <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object is always owned by the manager. You should never try to discard it yourself.</p>
  322. <p>The <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object doesn't necessarily have a current size object (i.e., face-&gt;size can be 0). If you need a specific &lsquo;font size&rsquo;, use <a href="ft2-cache_subsystem.html#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a> instead.</p>
  323. <p>Never change the face's transformation matrix (i.e., never call the <a href="ft2-base_interface.html#FT_Set_Transform">FT_Set_Transform</a> function) on a returned face! If you need to transform glyphs, do it yourself after glyph loading.</p>
  324. <p>When you perform a lookup, out-of-memory errors are detected <i>within</i> the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed.</p>
  325. <p>If a lookup fails with &lsquo;FT_Err_Out_Of_Memory&rsquo; the cache has already been completely flushed, and still no memory was available for the operation.</p>
  326. </td></tr></table>
  327. </td></tr></table>
  328. <hr width="75%">
  329. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  330. <td width="100%"></td>
  331. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  332. <table align=center width="75%"><tr><td>
  333. <h4><a name="FTC_ScalerRec">FTC_ScalerRec</a></h4>
  334. <table align=center width="87%"><tr><td>
  335. Defined in FT_CACHE_H (freetype/ftcache.h).
  336. </td></tr></table><br>
  337. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  338. <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ScalerRec_
  339. {
  340. <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> face_id;
  341. <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> width;
  342. <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> height;
  343. <a href="ft2-basic_types.html#FT_Int">FT_Int</a> pixel;
  344. <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> x_res;
  345. <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> y_res;
  346. } <b>FTC_ScalerRec</b>;
  347. </pre></table><br>
  348. <table align=center width="87%"><tr><td>
  349. <p>A structure used to describe a given character size in either pixels or points to the cache manager. See <a href="ft2-cache_subsystem.html#FTC_Manager_LookupSize">FTC_Manager_LookupSize</a>.</p>
  350. </td></tr></table><br>
  351. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
  352. <p></p>
  353. <table cellpadding=3 border=0>
  354. <tr valign=top><td><b>face_id</b></td><td>
  355. <p>The source face ID.</p>
  356. </td></tr>
  357. <tr valign=top><td><b>width</b></td><td>
  358. <p>The character width.</p>
  359. </td></tr>
  360. <tr valign=top><td><b>height</b></td><td>
  361. <p>The character height.</p>
  362. </td></tr>
  363. <tr valign=top><td><b>pixel</b></td><td>
  364. <p>A Boolean. If 1, the &lsquo;width&rsquo; and &lsquo;height&rsquo; fields are interpreted as integer pixel character sizes. Otherwise, they are expressed as 1/64th of points.</p>
  365. </td></tr>
  366. <tr valign=top><td><b>x_res</b></td><td>
  367. <p>Only used when &lsquo;pixel&rsquo; is value&nbsp;0 to indicate the horizontal resolution in dpi.</p>
  368. </td></tr>
  369. <tr valign=top><td><b>y_res</b></td><td>
  370. <p>Only used when &lsquo;pixel&rsquo; is value&nbsp;0 to indicate the vertical resolution in dpi.</p>
  371. </td></tr>
  372. </table>
  373. </td></tr></table>
  374. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  375. <p>This type is mainly used to retrieve <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects through the cache manager.</p>
  376. </td></tr></table>
  377. </td></tr></table>
  378. <hr width="75%">
  379. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  380. <td width="100%"></td>
  381. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  382. <table align=center width="75%"><tr><td>
  383. <h4><a name="FTC_Scaler">FTC_Scaler</a></h4>
  384. <table align=center width="87%"><tr><td>
  385. Defined in FT_CACHE_H (freetype/ftcache.h).
  386. </td></tr></table><br>
  387. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  388. <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ScalerRec_* <b>FTC_Scaler</b>;
  389. </pre></table><br>
  390. <table align=center width="87%"><tr><td>
  391. <p>A handle to an <a href="ft2-cache_subsystem.html#FTC_ScalerRec">FTC_ScalerRec</a> structure.</p>
  392. </td></tr></table><br>
  393. </td></tr></table>
  394. <hr width="75%">
  395. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  396. <td width="100%"></td>
  397. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  398. <table align=center width="75%"><tr><td>
  399. <h4><a name="FTC_Manager_LookupSize">FTC_Manager_LookupSize</a></h4>
  400. <table align=center width="87%"><tr><td>
  401. Defined in FT_CACHE_H (freetype/ftcache.h).
  402. </td></tr></table><br>
  403. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  404. FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
  405. <b>FTC_Manager_LookupSize</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager,
  406. <a href="ft2-cache_subsystem.html#FTC_Scaler">FTC_Scaler</a> scaler,
  407. <a href="ft2-base_interface.html#FT_Size">FT_Size</a> *asize );
  408. </pre></table><br>
  409. <table align=center width="87%"><tr><td>
  410. <p>Retrieve the <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object that corresponds to a given <a href="ft2-cache_subsystem.html#FTC_ScalerRec">FTC_ScalerRec</a> pointer through a cache manager.</p>
  411. </td></tr></table><br>
  412. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  413. <p></p>
  414. <table cellpadding=3 border=0>
  415. <tr valign=top><td><b>manager</b></td><td>
  416. <p>A handle to the cache manager.</p>
  417. </td></tr>
  418. <tr valign=top><td><b>scaler</b></td><td>
  419. <p>A scaler handle.</p>
  420. </td></tr>
  421. </table>
  422. </td></tr></table>
  423. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
  424. <p></p>
  425. <table cellpadding=3 border=0>
  426. <tr valign=top><td><b>asize</b></td><td>
  427. <p>A handle to the size object.</p>
  428. </td></tr>
  429. </table>
  430. </td></tr></table>
  431. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  432. <p>FreeType error code. 0&nbsp;means success.</p>
  433. </td></tr></table>
  434. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  435. <p>The returned <a href="ft2-base_interface.html#FT_Size">FT_Size</a> object is always owned by the manager. You should never try to discard it by yourself.</p>
  436. <p>You can access the parent <a href="ft2-base_interface.html#FT_Face">FT_Face</a> object simply as &lsquo;size-&gt;face&rsquo; if you need it. Note that this object is also owned by the manager.</p>
  437. </td></tr></table>
  438. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  439. <p>When you perform a lookup, out-of-memory errors are detected <i>within</i> the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed.</p>
  440. <p>If a lookup fails with &lsquo;FT_Err_Out_Of_Memory&rsquo; the cache has already been completely flushed, and still no memory is available for the operation.</p>
  441. </td></tr></table>
  442. </td></tr></table>
  443. <hr width="75%">
  444. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  445. <td width="100%"></td>
  446. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  447. <table align=center width="75%"><tr><td>
  448. <h4><a name="FTC_Node_Unref">FTC_Node_Unref</a></h4>
  449. <table align=center width="87%"><tr><td>
  450. Defined in FT_CACHE_H (freetype/ftcache.h).
  451. </td></tr></table><br>
  452. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  453. FT_EXPORT( <span class="keyword">void</span> )
  454. <b>FTC_Node_Unref</b>( <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a> node,
  455. <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager );
  456. </pre></table><br>
  457. <table align=center width="87%"><tr><td>
  458. <p>Decrement a cache node's internal reference count. When the count reaches 0, it is not destroyed but becomes eligible for subsequent cache flushes.</p>
  459. </td></tr></table><br>
  460. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  461. <p></p>
  462. <table cellpadding=3 border=0>
  463. <tr valign=top><td><b>node</b></td><td>
  464. <p>The cache node handle.</p>
  465. </td></tr>
  466. <tr valign=top><td><b>manager</b></td><td>
  467. <p>The cache manager handle.</p>
  468. </td></tr>
  469. </table>
  470. </td></tr></table>
  471. </td></tr></table>
  472. <hr width="75%">
  473. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  474. <td width="100%"></td>
  475. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  476. <table align=center width="75%"><tr><td>
  477. <h4><a name="FTC_Manager_RemoveFaceID">FTC_Manager_RemoveFaceID</a></h4>
  478. <table align=center width="87%"><tr><td>
  479. Defined in FT_CACHE_H (freetype/ftcache.h).
  480. </td></tr></table><br>
  481. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  482. FT_EXPORT( <span class="keyword">void</span> )
  483. <b>FTC_Manager_RemoveFaceID</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager,
  484. <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> face_id );
  485. </pre></table><br>
  486. <table align=center width="87%"><tr><td>
  487. <p>A special function used to indicate to the cache manager that a given <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> is no longer valid, either because its content changed, or because it was deallocated or uninstalled.</p>
  488. </td></tr></table><br>
  489. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  490. <p></p>
  491. <table cellpadding=3 border=0>
  492. <tr valign=top><td><b>manager</b></td><td>
  493. <p>The cache manager handle.</p>
  494. </td></tr>
  495. <tr valign=top><td><b>face_id</b></td><td>
  496. <p>The <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> to be removed.</p>
  497. </td></tr>
  498. </table>
  499. </td></tr></table>
  500. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  501. <p>This function flushes all nodes from the cache corresponding to this &lsquo;face_id&rsquo;, with the exception of nodes with a non-null reference count.</p>
  502. <p>Such nodes are however modified internally so as to never appear in later lookups with the same &lsquo;face_id&rsquo; value, and to be immediately destroyed when released by all their users.</p>
  503. </td></tr></table>
  504. </td></tr></table>
  505. <hr width="75%">
  506. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  507. <td width="100%"></td>
  508. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  509. <table align=center width="75%"><tr><td>
  510. <h4><a name="FTC_CMapCache">FTC_CMapCache</a></h4>
  511. <table align=center width="87%"><tr><td>
  512. Defined in FT_CACHE_H (freetype/ftcache.h).
  513. </td></tr></table><br>
  514. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  515. <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_CMapCacheRec_* <b>FTC_CMapCache</b>;
  516. </pre></table><br>
  517. <table align=center width="87%"><tr><td>
  518. <p>An opaque handle used to model a charmap cache. This cache is to hold character codes -&gt; glyph indices mappings.</p>
  519. </td></tr></table><br>
  520. </td></tr></table>
  521. <hr width="75%">
  522. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  523. <td width="100%"></td>
  524. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  525. <table align=center width="75%"><tr><td>
  526. <h4><a name="FTC_CMapCache_New">FTC_CMapCache_New</a></h4>
  527. <table align=center width="87%"><tr><td>
  528. Defined in FT_CACHE_H (freetype/ftcache.h).
  529. </td></tr></table><br>
  530. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  531. FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
  532. <b>FTC_CMapCache_New</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager,
  533. <a href="ft2-cache_subsystem.html#FTC_CMapCache">FTC_CMapCache</a> *acache );
  534. </pre></table><br>
  535. <table align=center width="87%"><tr><td>
  536. <p>Create a new charmap cache.</p>
  537. </td></tr></table><br>
  538. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  539. <p></p>
  540. <table cellpadding=3 border=0>
  541. <tr valign=top><td><b>manager</b></td><td>
  542. <p>A handle to the cache manager.</p>
  543. </td></tr>
  544. </table>
  545. </td></tr></table>
  546. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
  547. <p></p>
  548. <table cellpadding=3 border=0>
  549. <tr valign=top><td><b>acache</b></td><td>
  550. <p>A new cache handle. NULL in case of error.</p>
  551. </td></tr>
  552. </table>
  553. </td></tr></table>
  554. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  555. <p>FreeType error code. 0&nbsp;means success.</p>
  556. </td></tr></table>
  557. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  558. <p>Like all other caches, this one will be destroyed with the cache manager.</p>
  559. </td></tr></table>
  560. </td></tr></table>
  561. <hr width="75%">
  562. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  563. <td width="100%"></td>
  564. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  565. <table align=center width="75%"><tr><td>
  566. <h4><a name="FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a></h4>
  567. <table align=center width="87%"><tr><td>
  568. Defined in FT_CACHE_H (freetype/ftcache.h).
  569. </td></tr></table><br>
  570. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  571. FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> )
  572. <b>FTC_CMapCache_Lookup</b>( <a href="ft2-cache_subsystem.html#FTC_CMapCache">FTC_CMapCache</a> cache,
  573. <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> face_id,
  574. <a href="ft2-basic_types.html#FT_Int">FT_Int</a> cmap_index,
  575. <a href="ft2-basic_types.html#FT_UInt32">FT_UInt32</a> char_code );
  576. </pre></table><br>
  577. <table align=center width="87%"><tr><td>
  578. <p>Translate a character code into a glyph index, using the charmap cache.</p>
  579. </td></tr></table><br>
  580. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  581. <p></p>
  582. <table cellpadding=3 border=0>
  583. <tr valign=top><td><b>cache</b></td><td>
  584. <p>A charmap cache handle.</p>
  585. </td></tr>
  586. <tr valign=top><td><b>face_id</b></td><td>
  587. <p>The source face ID.</p>
  588. </td></tr>
  589. <tr valign=top><td><b>cmap_index</b></td><td>
  590. <p>The index of the charmap in the source face. Any negative value means to use the cache <a href="ft2-base_interface.html#FT_Face">FT_Face</a>'s default charmap.</p>
  591. </td></tr>
  592. <tr valign=top><td><b>char_code</b></td><td>
  593. <p>The character code (in the corresponding charmap).</p>
  594. </td></tr>
  595. </table>
  596. </td></tr></table>
  597. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  598. <p>Glyph index. 0&nbsp;means &lsquo;no glyph&rsquo;.</p>
  599. </td></tr></table>
  600. </td></tr></table>
  601. <hr width="75%">
  602. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  603. <td width="100%"></td>
  604. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  605. <table align=center width="75%"><tr><td>
  606. <h4><a name="FTC_ImageTypeRec">FTC_ImageTypeRec</a></h4>
  607. <table align=center width="87%"><tr><td>
  608. Defined in FT_CACHE_H (freetype/ftcache.h).
  609. </td></tr></table><br>
  610. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  611. <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageTypeRec_
  612. {
  613. <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> face_id;
  614. <a href="ft2-basic_types.html#FT_Int">FT_Int</a> width;
  615. <a href="ft2-basic_types.html#FT_Int">FT_Int</a> height;
  616. <a href="ft2-basic_types.html#FT_Int32">FT_Int32</a> flags;
  617. } <b>FTC_ImageTypeRec</b>;
  618. </pre></table><br>
  619. <table align=center width="87%"><tr><td>
  620. <p>A structure used to model the type of images in a glyph cache.</p>
  621. </td></tr></table><br>
  622. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
  623. <p></p>
  624. <table cellpadding=3 border=0>
  625. <tr valign=top><td><b>face_id</b></td><td>
  626. <p>The face ID.</p>
  627. </td></tr>
  628. <tr valign=top><td><b>width</b></td><td>
  629. <p>The width in pixels.</p>
  630. </td></tr>
  631. <tr valign=top><td><b>height</b></td><td>
  632. <p>The height in pixels.</p>
  633. </td></tr>
  634. <tr valign=top><td><b>flags</b></td><td>
  635. <p>The load flags, as in <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>.</p>
  636. </td></tr>
  637. </table>
  638. </td></tr></table>
  639. </td></tr></table>
  640. <hr width="75%">
  641. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  642. <td width="100%"></td>
  643. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  644. <table align=center width="75%"><tr><td>
  645. <h4><a name="FTC_ImageType">FTC_ImageType</a></h4>
  646. <table align=center width="87%"><tr><td>
  647. Defined in FT_CACHE_H (freetype/ftcache.h).
  648. </td></tr></table><br>
  649. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  650. <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageTypeRec_* <b>FTC_ImageType</b>;
  651. </pre></table><br>
  652. <table align=center width="87%"><tr><td>
  653. <p>A handle to an <a href="ft2-cache_subsystem.html#FTC_ImageTypeRec">FTC_ImageTypeRec</a> structure.</p>
  654. </td></tr></table><br>
  655. </td></tr></table>
  656. <hr width="75%">
  657. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  658. <td width="100%"></td>
  659. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  660. <table align=center width="75%"><tr><td>
  661. <h4><a name="FTC_ImageCache">FTC_ImageCache</a></h4>
  662. <table align=center width="87%"><tr><td>
  663. Defined in FT_CACHE_H (freetype/ftcache.h).
  664. </td></tr></table><br>
  665. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  666. <span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_ImageCacheRec_* <b>FTC_ImageCache</b>;
  667. </pre></table><br>
  668. <table align=center width="87%"><tr><td>
  669. <p>A handle to an glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold.</p>
  670. </td></tr></table><br>
  671. </td></tr></table>
  672. <hr width="75%">
  673. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  674. <td width="100%"></td>
  675. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  676. <table align=center width="75%"><tr><td>
  677. <h4><a name="FTC_ImageCache_New">FTC_ImageCache_New</a></h4>
  678. <table align=center width="87%"><tr><td>
  679. Defined in FT_CACHE_H (freetype/ftcache.h).
  680. </td></tr></table><br>
  681. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  682. FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
  683. <b>FTC_ImageCache_New</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager,
  684. <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a> *acache );
  685. </pre></table><br>
  686. <table align=center width="87%"><tr><td>
  687. <p>Create a new glyph image cache.</p>
  688. </td></tr></table><br>
  689. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  690. <p></p>
  691. <table cellpadding=3 border=0>
  692. <tr valign=top><td><b>manager</b></td><td>
  693. <p>The parent manager for the image cache.</p>
  694. </td></tr>
  695. </table>
  696. </td></tr></table>
  697. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
  698. <p></p>
  699. <table cellpadding=3 border=0>
  700. <tr valign=top><td><b>acache</b></td><td>
  701. <p>A handle to the new glyph image cache object.</p>
  702. </td></tr>
  703. </table>
  704. </td></tr></table>
  705. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  706. <p>FreeType error code. 0&nbsp;means success.</p>
  707. </td></tr></table>
  708. </td></tr></table>
  709. <hr width="75%">
  710. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  711. <td width="100%"></td>
  712. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  713. <table align=center width="75%"><tr><td>
  714. <h4><a name="FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a></h4>
  715. <table align=center width="87%"><tr><td>
  716. Defined in FT_CACHE_H (freetype/ftcache.h).
  717. </td></tr></table><br>
  718. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  719. FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
  720. <b>FTC_ImageCache_Lookup</b>( <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a> cache,
  721. <a href="ft2-cache_subsystem.html#FTC_ImageType">FTC_ImageType</a> type,
  722. <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> gindex,
  723. <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> *aglyph,
  724. <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a> *anode );
  725. </pre></table><br>
  726. <table align=center width="87%"><tr><td>
  727. <p>Retrieve a given glyph image from a glyph image cache.</p>
  728. </td></tr></table><br>
  729. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  730. <p></p>
  731. <table cellpadding=3 border=0>
  732. <tr valign=top><td><b>cache</b></td><td>
  733. <p>A handle to the source glyph image cache.</p>
  734. </td></tr>
  735. <tr valign=top><td><b>type</b></td><td>
  736. <p>A pointer to a glyph image type descriptor.</p>
  737. </td></tr>
  738. <tr valign=top><td><b>gindex</b></td><td>
  739. <p>The glyph index to retrieve.</p>
  740. </td></tr>
  741. </table>
  742. </td></tr></table>
  743. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
  744. <p></p>
  745. <table cellpadding=3 border=0>
  746. <tr valign=top><td><b>aglyph</b></td><td>
  747. <p>The corresponding <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object. 0&nbsp;in case of failure.</p>
  748. </td></tr>
  749. <tr valign=top><td><b>anode</b></td><td>
  750. <p>Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).</p>
  751. </td></tr>
  752. </table>
  753. </td></tr></table>
  754. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  755. <p>FreeType error code. 0&nbsp;means success.</p>
  756. </td></tr></table>
  757. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  758. <p>The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with <a href="ft2-glyph_management.html#FT_Glyph_Copy">FT_Glyph_Copy</a> and modify the new one.</p>
  759. <p>If &lsquo;anode&rsquo; is <i>not</i> NULL, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>) will always be kept in the cache until you call <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a> to &lsquo;release&rsquo; it.</p>
  760. <p>If &lsquo;anode&rsquo; is NULL, the cache node is left unchanged, which means that the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> could be flushed out of the cache on the next call to one of the caching sub-system APIs. Don't assume that it is persistent!</p>
  761. </td></tr></table>
  762. </td></tr></table>
  763. <hr width="75%">
  764. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  765. <td width="100%"></td>
  766. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  767. <table align=center width="75%"><tr><td>
  768. <h4><a name="FTC_ImageCache_LookupScaler">FTC_ImageCache_LookupScaler</a></h4>
  769. <table align=center width="87%"><tr><td>
  770. Defined in FT_CACHE_H (freetype/ftcache.h).
  771. </td></tr></table><br>
  772. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  773. FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
  774. <b>FTC_ImageCache_LookupScaler</b>( <a href="ft2-cache_subsystem.html#FTC_ImageCache">FTC_ImageCache</a> cache,
  775. <a href="ft2-cache_subsystem.html#FTC_Scaler">FTC_Scaler</a> scaler,
  776. <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a> load_flags,
  777. <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> gindex,
  778. <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> *aglyph,
  779. <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a> *anode );
  780. </pre></table><br>
  781. <table align=center width="87%"><tr><td>
  782. <p>A variant of <a href="ft2-cache_subsystem.html#FTC_ImageCache_Lookup">FTC_ImageCache_Lookup</a> that uses an <a href="ft2-cache_subsystem.html#FTC_ScalerRec">FTC_ScalerRec</a> to specify the face ID and its size.</p>
  783. </td></tr></table><br>
  784. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
  785. <p></p>
  786. <table cellpadding=3 border=0>
  787. <tr valign=top><td><b>cache</b></td><td>
  788. <p>A handle to the source glyph image cache.</p>
  789. </td></tr>
  790. <tr valign=top><td><b>scaler</b></td><td>
  791. <p>A pointer to a scaler descriptor.</p>
  792. </td></tr>
  793. <tr valign=top><td><b>load_flags</b></td><td>
  794. <p>The corresponding load flags.</p>
  795. </td></tr>
  796. <tr valign=top><td><b>gindex</b></td><td>
  797. <p>The glyph index to retrieve.</p>
  798. </td></tr>
  799. </table>
  800. </td></tr></table>
  801. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
  802. <p></p>
  803. <table cellpadding=3 border=0>
  804. <tr valign=top><td><b>aglyph</b></td><td>
  805. <p>The corresponding <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object. 0&nbsp;in case of failure.</p>
  806. </td></tr>
  807. <tr valign=top><td><b>anode</b></td><td>
  808. <p>Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).</p>
  809. </td></tr>
  810. </table>
  811. </td></tr></table>
  812. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
  813. <p>FreeType error code. 0&nbsp;means success.</p>
  814. </td></tr></table>
  815. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  816. <p>The returned glyph is owned and managed by the glyph image cache. Never try to transform or discard it manually! You can however create a copy with <a href="ft2-glyph_management.html#FT_Glyph_Copy">FT_Glyph_Copy</a> and modify the new one.</p>
  817. <p>If &lsquo;anode&rsquo; is <i>not</i> NULL, it receives the address of the cache node containing the glyph image, after increasing its reference count. This ensures that the node (as well as the <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>) will always be kept in the cache until you call <a href="ft2…