📄 ft2-cache_subsystem.html
字号:
<p>Used to return the address of of the corresponding cache node after incrementing its reference count (see note below).</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>FreeType error code. 0 means success.</p>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<p>The small bitmap descriptor and its bit buffer are owned by the cache and should never be freed by the application. They might as well disappear from memory on the next cache lookup, so don't treat them as persistent data.</p>
<p>The descriptor's `buffer' field is set to 0 to indicate a missing glyph bitmap.</p>
<p>If `anode' is <i>not</i> NULL, it receives the address of the cache node containing the bitmap, after increasing its reference count. This ensures that the node (as well as the image) will always be kept in the cache until you call <a href="ft2-cache_subsystem.html#FTC_Node_Unref">FTC_Node_Unref</a> to `release' it.</p>
<p>If `anode' is NULL, the cache node is left unchanged, which means that the bitmap 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>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FTC_CMapCache">FTC_CMapCache</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_CMapCacheRec_* <b>FTC_CMapCache</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>An opaque handle used to manager a charmap cache. This cache is to hold character codes -> glyph indices mappings.</p>
</td></tr></table><br>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FTC_CMapDesc">FTC_CMapDesc</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_CMapDescRec_* <b>FTC_CMapDesc</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A handle to an <a href="ft2-cache_subsystem.html#FTC_CMapDescRec">FTC_CMapDescRec</a> structure used to describe a given charmap in a charmap cache.</p>
<p>Each <a href="ft2-cache_subsystem.html#FTC_CMapDesc">FTC_CMapDesc</a> describes which charmap (of which <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>) we want to use in <a href="ft2-cache_subsystem.html#FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a>.</p>
</td></tr></table><br>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FTC_CMapType">FTC_CMapType</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">enum</span> FTC_CMapType_
{
<a href="ft2-cache_subsystem.html#FTC_CMapType">FTC_CMAP_BY_INDEX</a> = 0,
<a href="ft2-cache_subsystem.html#FTC_CMapType">FTC_CMAP_BY_ENCODING</a> = 1,
<a href="ft2-cache_subsystem.html#FTC_CMapType">FTC_CMAP_BY_ID</a> = 2
} <b>FTC_CMapType</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>The list of valid <a href="ft2-cache_subsystem.html#FTC_CMapDesc">FTC_CMapDesc</a> types. They indicate how we want to address a charmap within an <a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a>.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
<table cellpadding=3>
<tr valign=top><td><b>FTC_CMAP_BY_INDEX</b></td><td>
<p>Address a charmap by its index in the corresponding <a href="ft2-base_interface.html#FT_Face">FT_Face</a>.</p>
</td></tr>
<tr valign=top><td><b>FTC_CMAP_BY_ENCODING</b></td><td>
<p>Use a <a href="ft2-base_interface.html#FT_Face">FT_Face</a> charmap that corresponds to a given encoding.</p>
</td></tr>
<tr valign=top><td><b>FTC_CMAP_BY_ID</b></td><td>
<p>Use an <a href="ft2-base_interface.html#FT_Face">FT_Face</a> charmap that corresponds to a given (platform,encoding) ID. See <a href="ft2-cache_subsystem.html#FTC_CMapIdRec">FTC_CMapIdRec</a>.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FTC_CMapIdRec">FTC_CMapIdRec</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_CMapIdRec_
{
<a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> platform;
<a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> encoding;
} <b>FTC_CMapIdRec</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A short structure to identify a charmap by a (platform,encoding) pair of values.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
<table cellpadding=3>
<tr valign=top><td><b>platform</b></td><td>
<p>The platform ID.</p>
</td></tr>
<tr valign=top><td><b>encoding</b></td><td>
<p>The encoding ID.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FTC_CMapDescRec">FTC_CMapDescRec</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">struct</span> FTC_CMapDescRec_
{
<a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> face_id;
<a href="ft2-cache_subsystem.html#FTC_CMapType">FTC_CMapType</a> type;
<span class="keyword">union</span>
{
<a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> index;
<a href="ft2-base_interface.html#FT_Encoding">FT_Encoding</a> encoding;
<a href="ft2-cache_subsystem.html#FTC_CMapIdRec">FTC_CMapIdRec</a> id;
} u;
} <b>FTC_CMapDescRec</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>A structure to describe a given charmap to <a href="ft2-cache_subsystem.html#FTC_CMapCache">FTC_CMapCache</a>.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
<table cellpadding=3>
<tr valign=top><td><b>face_id</b></td><td>
<p><a href="ft2-cache_subsystem.html#FTC_FaceID">FTC_FaceID</a> of the face this charmap belongs to.</p>
</td></tr>
<tr valign=top><td><b>type</b></td><td>
<p>The type of charmap, see <a href="ft2-cache_subsystem.html#FTC_CMapType">FTC_CMapType</a>.</p>
<p>u.index :: For <a href="ft2-cache_subsystem.html#FTC_CMapType">FTC_CMAP_BY_INDEX</a> types, this is the charmap index (within a <a href="ft2-base_interface.html#FT_Face">FT_Face</a>) we want to use.</p>
<p>u.encoding :: For <a href="ft2-cache_subsystem.html#FTC_CMapType">FTC_CMAP_BY_ENCODING</a> types, this is the charmap encoding we want to use. see <a href="ft2-base_interface.html#FT_Encoding">FT_Encoding</a>.</p>
<p>u.id :: For <a href="ft2-cache_subsystem.html#FTC_CMapType">FTC_CMAP_BY_ID</a> types, this is the (platform,encoding) pair we want to use. see <a href="ft2-cache_subsystem.html#FTC_CMapIdRec">FTC_CMapIdRec</a> and <a href="ft2-base_interface.html#FT_CharMapRec">FT_CharMapRec</a>.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FTC_CMapCache_New">FTC_CMapCache_New</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
<b>FTC_CMapCache_New</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager,
<a href="ft2-cache_subsystem.html#FTC_CMapCache">FTC_CMapCache</a> *acache );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Creates a new charmap cache.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<table cellpadding=3>
<tr valign=top><td><b>manager</b></td><td>
<p>A handle to the cache manager.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
<table cellpadding=3>
<tr valign=top><td><b>acache</b></td><td>
<p>A new cache handle. NULL in case of error.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>FreeType error code. 0 means success.</p>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<p>Like all other caches, this one will be destroyed with the cache manager.</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FTC_CMapCache_Lookup">FTC_CMapCache_Lookup</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> )
<b>FTC_CMapCache_Lookup</b>( <a href="ft2-cache_subsystem.html#FTC_CMapCache">FTC_CMapCache</a> cache,
<a href="ft2-cache_subsystem.html#FTC_CMapDesc">FTC_CMapDesc</a> cmap_desc,
FT_UInt32 <span class="keyword">char_code</span> );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Translates a character code into a glyph index, using the charmap cache.</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
<table cellpadding=3>
<tr valign=top><td><b>cache</b></td><td>
<p>A charmap cache handle.</p>
</td></tr>
<tr valign=top><td><b>cmap_desc</b></td><td>
<p>A charmap descriptor handle.</p>
</td></tr>
<tr valign=top><td><b>char_code</b></td><td>
<p>The character code (in the corresponding charmap).</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
<p>Glyph index. 0 means "no glyph".</p>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<p>This function doesn't return <a href="ft2-cache_subsystem.html#FTC_Node">FTC_Node</a> handles, since there is no real use for them with typical uses of charmaps.</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FTC_Manager_Compress">FTC_Manager_Compress</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <span class="keyword">void</span> )
<b>FTC_Manager_Compress</b>( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager );
/* try to flush `count' old nodes from the cache; return the number
* of really flushed nodes
*/
FT_EXPORT( <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> )
FTC_Manager_FlushN( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager,
<a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> count );
/* this must be used <span class="keyword">internally</span> for the moment */
FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
FTC_Manager_RegisterCache( <a href="ft2-cache_subsystem.html#FTC_Manager">FTC_Manager</a> manager,
FTC_CacheClass clazz,
FTC_Cache *acache );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>This function is used to check the state of the cache manager if its `num_bytes' field is greater than its `max_bytes' field. It will flush as many old cache nodes as possible (ignoring cache nodes with a non-zero reference count).</p>
</td></tr></table><br>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
<table cellpadding=3>
<tr valign=top><td><b>manager</b></td><td>
<p>A handle to the cache manager.</p>
</td></tr>
</table>
</td></tr></table>
<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
<p>Client applications should not call this function directly. It is normally invoked by specific cache implementations.</p>
<p>The reason this function is exported is to allow client-specific cache classes.</p>
</td></tr></table>
</td></tr></table><hr width="75%">
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -