📄 ft2-base_interface.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>Base Interface</h1></center><h2>Synopsis</h2><table align=center cellspacing=5 cellpadding=0 border=0><tr><td></td><td><a href="#FT_Library">FT_Library</a></td><td></td><td><a href="#FT_HAS_FIXED_SIZES">FT_HAS_FIXED_SIZES</a></td><td></td><td><a href="#FT_Set_Char_Size">FT_Set_Char_Size</a></td></tr><tr><td></td><td><a href="#FT_Face">FT_Face</a></td><td></td><td><a href="#FT_HAS_FAST_GLYPHS">FT_HAS_FAST_GLYPHS</a></td><td></td><td><a href="#FT_Set_Pixel_Sizes">FT_Set_Pixel_Sizes</a></td></tr><tr><td></td><td><a href="#FT_Size">FT_Size</a></td><td></td><td><a href="#FT_HAS_GLYPH_NAMES">FT_HAS_GLYPH_NAMES</a></td><td></td><td><a href="#FT_Load_Glyph">FT_Load_Glyph</a></td></tr><tr><td></td><td><a href="#FT_GlyphSlot">FT_GlyphSlot</a></td><td></td><td><a href="#FT_HAS_MULTIPLE_MASTERS">FT_HAS_MULTIPLE_MASTERS</a></td><td></td><td><a href="#FT_Load_Char">FT_Load_Char</a></td></tr><tr><td></td><td><a href="#FT_CharMap">FT_CharMap</a></td><td></td><td><a href="#FT_STYLE_FLAG_XXX">FT_STYLE_FLAG_XXX</a></td><td></td><td><a href="#FT_LOAD_XXX">FT_LOAD_XXX</a></td></tr><tr><td></td><td><a href="#FT_Encoding">FT_Encoding</a></td><td></td><td><a href="#FT_Size_Internal">FT_Size_Internal</a></td><td></td><td><a href="#FT_Set_Transform">FT_Set_Transform</a></td></tr><tr><td></td><td><a href="#FT_Glyph_Metrics">FT_Glyph_Metrics</a></td><td></td><td><a href="#FT_Size_Metrics">FT_Size_Metrics</a></td><td></td><td><a href="#FT_Render_Mode">FT_Render_Mode</a></td></tr><tr><td></td><td><a href="#FT_Bitmap_Size">FT_Bitmap_Size</a></td><td></td><td><a href="#FT_SizeRec">FT_SizeRec</a></td><td></td><td><a href="#ft_render_mode_xxx">ft_render_mode_xxx</a></td></tr><tr><td></td><td><a href="#FT_Module">FT_Module</a></td><td></td><td><a href="#FT_SubGlyph">FT_SubGlyph</a></td><td></td><td><a href="#FT_Render_Glyph">FT_Render_Glyph</a></td></tr><tr><td></td><td><a href="#FT_Driver">FT_Driver</a></td><td></td><td><a href="#FT_Slot_Internal">FT_Slot_Internal</a></td><td></td><td><a href="#FT_Kerning_Mode">FT_Kerning_Mode</a></td></tr><tr><td></td><td><a href="#FT_Renderer">FT_Renderer</a></td><td></td><td><a href="#FT_GlyphSlotRec">FT_GlyphSlotRec</a></td><td></td><td><a href="#ft_kerning_default">ft_kerning_default</a></td></tr><tr><td></td><td><a href="#FT_ENC_TAG">FT_ENC_TAG</a></td><td></td><td><a href="#FT_Init_FreeType">FT_Init_FreeType</a></td><td></td><td><a href="#ft_kerning_unfitted">ft_kerning_unfitted</a></td></tr><tr><td></td><td><a href="#ft_encoding_xxx">ft_encoding_xxx</a></td><td></td><td><a href="#FT_Library_Version">FT_Library_Version</a></td><td></td><td><a href="#ft_kerning_unscaled">ft_kerning_unscaled</a></td></tr><tr><td></td><td><a href="#FT_CharMapRec">FT_CharMapRec</a></td><td></td><td><a href="#FT_Done_FreeType">FT_Done_FreeType</a></td><td></td><td><a href="#FT_Get_Kerning">FT_Get_Kerning</a></td></tr><tr><td></td><td><a href="#FT_Face_Internal">FT_Face_Internal</a></td><td></td><td><a href="#FT_OPEN_XXX">FT_OPEN_XXX</a></td><td></td><td><a href="#FT_Get_Glyph_Name">FT_Get_Glyph_Name</a></td></tr><tr><td></td><td><a href="#FT_FaceRec">FT_FaceRec</a></td><td></td><td><a href="#FT_Parameter">FT_Parameter</a></td><td></td><td><a href="#FT_Get_Postscript_Name">FT_Get_Postscript_Name</a></td></tr><tr><td></td><td><a href="#FT_FACE_FLAG_XXX">FT_FACE_FLAG_XXX</a></td><td></td><td><a href="#FT_Open_Args">FT_Open_Args</a></td><td></td><td><a href="#FT_Select_Charmap">FT_Select_Charmap</a></td></tr><tr><td></td><td><a href="#FT_HAS_HORIZONTAL">FT_HAS_HORIZONTAL</a></td><td></td><td><a href="#FT_New_Face">FT_New_Face</a></td><td></td><td><a href="#FT_Set_Charmap">FT_Set_Charmap</a></td></tr><tr><td></td><td><a href="#FT_HAS_VERTICAL">FT_HAS_VERTICAL</a></td><td></td><td><a href="#FT_New_Memory_Face">FT_New_Memory_Face</a></td><td></td><td><a href="#FT_Get_Charmap_Index">FT_Get_Charmap_Index</a></td></tr><tr><td></td><td><a href="#FT_HAS_KERNING">FT_HAS_KERNING</a></td><td></td><td><a href="#FT_Open_Face">FT_Open_Face</a></td><td></td><td><a href="#FT_Get_Char_Index">FT_Get_Char_Index</a></td></tr><tr><td></td><td><a href="#FT_IS_SCALABLE">FT_IS_SCALABLE</a></td><td></td><td><a href="#FT_Attach_File">FT_Attach_File</a></td><td></td><td><a href="#FT_Get_First_Char">FT_Get_First_Char</a></td></tr><tr><td></td><td><a href="#FT_IS_SFNT">FT_IS_SFNT</a></td><td></td><td><a href="#FT_Attach_Stream">FT_Attach_Stream</a></td><td></td><td><a href="#FT_Get_Next_Char">FT_Get_Next_Char</a></td></tr><tr><td></td><td><a href="#FT_IS_FIXED_WIDTH">FT_IS_FIXED_WIDTH</a></td><td></td><td><a href="#FT_Done_Face">FT_Done_Face</a></td><td></td><td><a href="#FT_Get_Name_Index">FT_Get_Name_Index</a></td></tr></table><br><br><table align=center width="87%"><tr><td><p>This section describes the public high-level API of FreeType 2.</p></td></tr></table><br><table align=center width="75%"><tr><td><h4><a name="FT_Library">FT_Library</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_LibraryRec_ *<b>FT_Library</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to a FreeType library instance. Each `library' is completely independent from the others; it is the `root' of a set of objects like fonts, faces, sizes, etc.</p><p>It also embeds a memory manager (see <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>), as well as a scan-line converter object (see <a href="ft2-raster.html#FT_Raster">FT_Raster</a>).</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td><p>Library objects are normally created by <a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a>, and destroyed with <a href="ft2-base_interface.html#FT_Done_FreeType">FT_Done_FreeType</a>.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_Face">FT_Face</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_FaceRec_* <b>FT_Face</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to a given typographic face object. A face object models a given typeface, in a given style.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td><p>Each face object also owns a single <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a> object, as well as one or more <a href="ft2-base_interface.html#FT_Size">FT_Size</a> objects.</p><p>Use <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> or <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a> to create a new face object from a given filepathname or a custom input stream.</p><p>Use <a href="ft2-base_interface.html#FT_Done_Face">FT_Done_Face</a> to destroy it (along with its slot and sizes).</p></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td><p>The <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a> details the publicly accessible fields of a given face object.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_Size">FT_Size</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_SizeRec_* <b>FT_Size</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to a given size object. Such an object models the data that depends on the current <i>resolution</i> and _character size_ in a given <a href="ft2-base_interface.html#FT_Face">FT_Face</a>.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td><p>Each face object owns one or more sizes. There is however a single <i>active</i> size for the face at any time that will be used by functions like <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>, <a href="ft2-base_interface.html#FT_Get_Kerning">FT_Get_Kerning</a>, etc.</p><p>You can use the <a href="ft2-sizes_management.html#FT_Activate_Size">FT_Activate_Size</a> API to change the current active size of any given face.</p></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td><p>The <a href="ft2-base_interface.html#FT_SizeRec">FT_SizeRec</a> structure details the publicly accessible fields of a given face object.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_GlyphSlot">FT_GlyphSlot</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_GlyphSlotRec_* <b>FT_GlyphSlot</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to a given `glyph slot'. A slot is a container where it is possible to load any one of the glyphs contained in its parent face.</p><p>In other words, each time you call <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a> or <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>, the slot's content is erased by the new glyph data, i.e. the glyph's metrics, its image (bitmap or outline), and other control information.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td><p><a href="ft2-base_interface.html#FT_GlyphSlotRec">FT_GlyphSlotRec</a> details the publicly accessible glyph fields.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_CharMap">FT_CharMap</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_CharMapRec_* <b>FT_CharMap</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to a given character map. A charmap is used to translate character codes in a given encoding into glyph indexes for its parent's face. Some font formats may provide several charmaps per font.</p><p>Each face object owns zero or more charmaps, but only one of them can be "active" and used by <a href="ft2-base_interface.html#FT_Get_Char_Index">FT_Get_Char_Index</a> or <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>.</p><p>The list of available charmaps in a face is available through the "face->num_charmaps" and "face->charmaps" fields of <a href="ft2-base_interface.html#FT_FaceRec">FT_FaceRec</a>.</p><p>The currently active charmap is available as "face->charmap". You should call <a href="ft2-base_interface.html#FT_Set_Charmap">FT_Set_Charmap</a> to change it.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td><p>When a new face is created (either through <a href="ft2-base_interface.html#FT_New_Face">FT_New_Face</a> or <a href="ft2-base_interface.html#FT_Open_Face">FT_Open_Face</a>), the library looks for a Unicode charmap within the list and automatically activates it.</p></td></tr></table><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>also</b></em></td></tr><tr><td><p>The <a href="ft2-base_interface.html#FT_CharMapRec">FT_CharMapRec</a> details the publicly accessible fields of a given character map.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_Encoding">FT_Encoding</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre> <span class="keyword">typedef</span> <span class="keyword">enum</span> FT_Encoding_ { <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_NONE</a>, 0, 0, 0, 0 ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_SYMBOL</a>, 's', 'y', 'm', 'b' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_UNICODE</a>, 'u', 'n', 'i', 'c' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_SJIS</a>, 's', 'j', 'i', 's' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_GB2312</a>, 'g', 'b', ' ', ' ' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_BIG5</a>, 'b', 'i', 'g', '5' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_WANSUNG</a>, 'w', 'a', 'n', 's' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_JOHAB</a>, 'j', 'o', 'h', 'a' ), /* for backwards compatibility */ <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_SJIS</a> = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_SJIS</a>, <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_GB2312</a> = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_GB2312</a>, <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_BIG5</a> = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_BIG5</a>, <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_WANSUNG</a> = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_WANSUNG</a>, <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_MS_JOHAB</a> = <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_JOHAB</a>, <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_STANDARD</a>, 'A', 'D', 'O', 'B' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_EXPERT</a>, 'A', 'D', 'B', 'E' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_CUSTOM</a>, 'A', 'D', 'B', 'C' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_ADOBE_LATIN_1</a>, 'l', 'a', 't', '1' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_OLD_LATIN_2</a>, 'l', 'a', 't', '2' ), <a href="ft2-base_interface.html#FT_ENC_TAG">FT_ENC_TAG</a>( <a href="ft2-base_interface.html#FT_Encoding">FT_ENCODING_APPLE_ROMAN</a>, 'a', 'r', 'm', 'n' ) } <b>FT_Encoding</b>;</pre></table><br><table align=center width="87%"><tr><td><p>An enumeration used to specify encodings supported by charmaps. Used in the <a href="ft2-base_interface.html#FT_Select_Charmap">FT_Select_Charmap</a> API function.</p></td></tr></table><br><table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td><p>Because of 32-bit charcodes defined in Unicode (i.e., surrogates), all character codes must be expressed as FT_Longs.</p><p>The values of this type correspond to specific character repertories (i.e. charsets), and not to text encoding methods (like UTF-8, UTF-16, GB2312_EUC, etc.).</p><p>Other encodings might be defined in the future.</p></td></tr></table><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>FT_ENCODING_NONE</b></td><td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -