📄 ft2-module_management.html
字号:
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>FreeType-2.1.10 API Reference</title>
<style type="text/css">
body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
color: #000000;
background: #FFFFFF; }
p { text-align: justify; }
h1 { text-align: center; }
li { text-align: justify; }
a:link { color: #0000EF; }
a:visited { color: #51188E; }
a:hover { color: #FF0000; }
span.keyword { font-family: monospace;
text-align: left;
white-space: pre;
color: darkblue; }
pre.colored { color: blue; }
ul.empty { list-style-type: none; }
</style>
</head>
<body>
<center><h1>FreeType-2.1.10 API Reference</h1></center>
<center><h1>
Module Management
</h1></center>
<h2>Synopsis</h2>
<table align=center cellspacing=5 cellpadding=0 border=0>
<tr><td></td><td><a href="#FT_Module_Class">FT_Module_Class</a></td><td></td><td><a href="#FT_New_Library">FT_New_Library</a></td><td></td><td><a href="#FT_Renderer_Class">FT_Renderer_Class</a></td></tr>
<tr><td></td><td><a href="#FT_Add_Module">FT_Add_Module</a></td><td></td><td><a href="#FT_Done_Library">FT_Done_Library</a></td><td></td><td><a href="#FT_Get_Renderer">FT_Get_Renderer</a></td></tr>
<tr><td></td><td><a href="#FT_Get_Module">FT_Get_Module</a></td><td></td><td><a href="#FT_Set_Debug_Hook">FT_Set_Debug_Hook</a></td><td></td><td><a href="#FT_Set_Renderer">FT_Set_Renderer</a></td></tr>
<tr><td></td><td><a href="#FT_Remove_Module">FT_Remove_Module</a></td><td></td><td><a href="#FT_Add_Default_Modules">FT_Add_Default_Modules</a></td><td></td><td></td></tr>
</table><br><br>
<table align=center width="87%"><tr><td>
<p>The definitions below are used to manage modules within FreeType. Modules can be added, upgraded, and removed at runtime.</p>
</td></tr></table><br>
<table align=center width="75%"><tr><td>
<h4><a name="FT_Module_Class">FT_Module_Class</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
<span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Module_Class_
{
<a href="ft2-basic_types.html#FT_ULong">FT_ULong</a> module_flags;
<a href="ft2-basic_types.html#FT_Long">FT_Long</a> module_size;
<span class="keyword">const</span> <a href="ft2-basic_types.html#FT_String">FT_String</a>* module_name;
<a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> module_version;
<a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> module_requires;
<span class="keyword">const</span> <span class="keyword">void</span>* module_interface;
FT_Module_Constructor module_init;
FT_Module_Destructor module_done;
FT_Module_Requester get_interface;
} <b>FT_Module_Class</b>;
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>The module class descriptor.</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>module_flags</b></td><td>
<p>Bit flags describing the module.</p>
</td></tr>
<tr valign=top><td><b>module_size</b></td><td>
<p>The size of one module object/instance in bytes.</p>
</td></tr>
<tr valign=top><td><b>module_name</b></td><td>
<p>The name of the module.</p>
</td></tr>
<tr valign=top><td><b>module_version</b></td><td>
<p>The version, as a 16.16 fixed number (major.minor).</p>
</td></tr>
<tr valign=top><td><b>module_requires</b></td><td>
<p>The version of FreeType this module requires (starts at version 2.0, i.e 0x20000)</p>
</td></tr>
<tr valign=top><td><b>module_init</b></td><td>
<p>A function used to initialize (not create) a new module object.</p>
</td></tr>
<tr valign=top><td><b>module_done</b></td><td>
<p>A function used to finalize (not destroy) a given module object</p>
</td></tr>
<tr valign=top><td><b>get_interface</b></td><td>
<p>Queries a given module for a specific interface by name.</p>
</td></tr>
</table>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Add_Module">FT_Add_Module</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>FT_Add_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
<span class="keyword">const</span> <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a>* clazz );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Adds a new module to a given library instance.</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>library</b></td><td>
<p>A handle to the library object.</p>
</td></tr>
</table>
</td></tr></table>
<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>clazz</b></td><td>
<p>A pointer to class descriptor for the module.</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>An error will be returned if a module already exists by that name, or if the module requires a version of FreeType that is too great.</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Get_Module">FT_Get_Module</a></h4>
<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
FT_EXPORT( <a href="ft2-base_interface.html#FT_Module">FT_Module</a> )
<b>FT_Get_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
<span class="keyword">const</span> <span class="keyword">char</span>* module_name );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Finds a module by its name.</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>library</b></td><td>
<p>A handle to the library object.</p>
</td></tr>
<tr valign=top><td><b>module_name</b></td><td>
<p>The module's name (as an ASCII string).</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>A module handle. 0 if none was found.</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>You should better be familiar with FreeType internals to know which module to look for :-)</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_Remove_Module">FT_Remove_Module</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>FT_Remove_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
<a href="ft2-base_interface.html#FT_Module">FT_Module</a> module );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>Removes a given module from a library instance.</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>library</b></td><td>
<p>A handle to a library object.</p>
</td></tr>
</table>
</td></tr></table>
<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>module</b></td><td>
<p>A handle to a module object.</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 module object is destroyed by the function in case of success.</p>
</td></tr></table>
</td></tr></table><hr width="75%">
<table align=center width="75%"><tr><td>
<h4><a name="FT_New_Library">FT_New_Library</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>FT_New_Library</b>( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a> memory,
<a href="ft2-base_interface.html#FT_Library">FT_Library</a> *alibrary );
</pre></table><br>
<table align=center width="87%"><tr><td>
<p>This function is used to create a new FreeType library instance from a given memory object. It is thus possible to use libraries with distinct memory allocators within the same program.</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>memory</b></td><td>
<p>A handle to the original memory object.</p>
</td></tr>
</table>
</td></tr></table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -