ft2-glyph_management.html

来自「嵌入式freetype库的应用文档包含freetype的简要说明和应用examp」· HTML 代码 · 共 496 行 · 第 1/2 页

HTML
496
字号
<!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>Glyph Management</h1></center><h2>Synopsis</h2><table align=center cellspacing=5 cellpadding=0 border=0><tr><td></td><td><a href="#FT_Glyph">FT_Glyph</a></td><td></td><td><a href="#FT_OutlineGlyphRec">FT_OutlineGlyphRec</a></td><td></td><td><a href="#ft_glyph_bbox_xxx">ft_glyph_bbox_xxx</a></td></tr><tr><td></td><td><a href="#FT_GlyphRec">FT_GlyphRec</a></td><td></td><td><a href="#FT_Get_Glyph">FT_Get_Glyph</a></td><td></td><td><a href="#FT_Glyph_Get_CBox">FT_Glyph_Get_CBox</a></td></tr><tr><td></td><td><a href="#FT_BitmapGlyph">FT_BitmapGlyph</a></td><td></td><td><a href="#FT_Glyph_Copy">FT_Glyph_Copy</a></td><td></td><td><a href="#FT_Glyph_To_Bitmap">FT_Glyph_To_Bitmap</a></td></tr><tr><td></td><td><a href="#FT_BitmapGlyphRec">FT_BitmapGlyphRec</a></td><td></td><td><a href="#FT_Glyph_Transform">FT_Glyph_Transform</a></td><td></td><td><a href="#FT_Done_Glyph">FT_Done_Glyph</a></td></tr><tr><td></td><td><a href="#FT_OutlineGlyph">FT_OutlineGlyph</a></td><td></td><td><a href="#FT_Glyph_BBox_Mode">FT_Glyph_BBox_Mode</a></td><td></td><td></td></tr></table><br><br><table align=center width="87%"><tr><td><p>This section contains definitions used to manage glyph data through generic FT_Glyph objects. Each of them can contain a bitmap, a vector outline, or even images in other formats.</p></td></tr></table><br><table align=center width="75%"><tr><td><h4><a name="FT_Glyph">FT_Glyph</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_GlyphRec_*  <b>FT_Glyph</b>;</pre></table><br><table align=center width="87%"><tr><td><p>Handle to an object used to model generic glyph images. It is a pointer to the <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a> structure and can contain a glyph bitmap or pointer.</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>Glyph objects are not owned by the library. You must thus release them manually (through <a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a>) <i>before</i> calling <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_GlyphRec">FT_GlyphRec</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_GlyphRec_  {    <a href="ft2-base_interface.html#FT_Library">FT_Library</a>             library;    <span class="keyword">const</span> FT_Glyph_Class*  clazz;    <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>        format;    <a href="ft2-basic_types.html#FT_Vector">FT_Vector</a>              advance;  } <b>FT_GlyphRec</b>;</pre></table><br><table align=center width="87%"><tr><td><p>The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed float format.</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>library</b></td><td><p>A handle to the FreeType library object.</p></td></tr><tr valign=top><td><b>clazz</b></td><td><p>A pointer to the glyph's class. Private.</p></td></tr><tr valign=top><td><b>format</b></td><td><p>The format of the glyph's image.</p></td></tr><tr valign=top><td><b>advance</b></td><td><p>A 16.16 vector that gives the glyph's advance width.</p></td></tr></table></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_BitmapGlyph">FT_BitmapGlyph</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_BitmapGlyphRec_*  <b>FT_BitmapGlyph</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to an object used to model a bitmap glyph image. This is a sub-class of <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>, and a pointer to <a href="ft2-glyph_management.html#FT_BitmapGlyphRec">FT_BitmapGlyphRec</a>.</p></td></tr></table><br></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_BitmapGlyphRec">FT_BitmapGlyphRec</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_BitmapGlyphRec_  {    <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>  root;    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       left;    <a href="ft2-basic_types.html#FT_Int">FT_Int</a>       top;    <a href="ft2-basic_types.html#FT_Bitmap">FT_Bitmap</a>    bitmap;  } <b>FT_BitmapGlyphRec</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A structure used for bitmap glyph images. This really is a `sub-class' of `FT_GlyphRec'.</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>root</b></td><td><p>The root FT_Glyph fields.</p></td></tr><tr valign=top><td><b>left</b></td><td><p>The left-side bearing, i.e., the horizontal distance from the current pen position to the left border of the glyph bitmap.</p></td></tr><tr valign=top><td><b>top</b></td><td><p>The top-side bearing, i.e., the vertical distance from the current pen position to the top border of the glyph bitmap. This distance is positive for upwards-y!</p></td></tr><tr valign=top><td><b>bitmap</b></td><td><p>A descriptor for the bitmap.</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>You can typecast FT_Glyph to FT_BitmapGlyph if you have glyph-&gt;format == FT_GLYPH_FORMAT_BITMAP. This lets you access the bitmap's contents easily.</p><p>The corresponding pixel buffer is always owned by the BitmapGlyph and is thus created and destroyed with it.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_OutlineGlyph">FT_OutlineGlyph</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>  <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_OutlineGlyphRec_*  <b>FT_OutlineGlyph</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A handle to an object used to model an outline glyph image. This is a sub-class of <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>, and a pointer to <a href="ft2-glyph_management.html#FT_OutlineGlyphRec">FT_OutlineGlyphRec</a>.</p></td></tr></table><br></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_OutlineGlyphRec">FT_OutlineGlyphRec</a></h4><table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>  <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_OutlineGlyphRec_  {    <a href="ft2-glyph_management.html#FT_GlyphRec">FT_GlyphRec</a>  root;    <a href="ft2-outline_processing.html#FT_Outline">FT_Outline</a>   outline;  } <b>FT_OutlineGlyphRec</b>;</pre></table><br><table align=center width="87%"><tr><td><p>A structure used for outline (vectorial) glyph images. This really is a `sub-class' of `FT_GlyphRec'.</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>root</b></td><td><p>The root FT_Glyph fields.</p></td></tr><tr valign=top><td><b>outline</b></td><td><p>A descriptor for the outline.</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>You can typecast FT_Glyph to FT_OutlineGlyph if you have glyph-&gt;format == FT_GLYPH_FORMAT_OUTLINE. This lets you access the outline's content easily.</p><p>As the outline is extracted from a glyph slot, its coordinates are expressed normally in 26.6 pixels, unless the flag FT_LOAD_NO_SCALE was used in FT_Load_Glyph() or FT_Load_Char().</p><p>The outline's tables are always owned by the object and are destroyed with it.</p></td></tr></table></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_Get_Glyph">FT_Get_Glyph</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_Get_Glyph</b>( <a href="ft2-base_interface.html#FT_GlyphSlot">FT_GlyphSlot</a>  slot,                <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>     *aglyph );</pre></table><br><table align=center width="87%"><tr><td><p>A function used to extract a glyph image from a slot.</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>slot</b></td><td><p>A handle to the source glyph slot.</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>aglyph</b></td><td><p>A handle to the glyph 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></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_Glyph_Copy">FT_Glyph_Copy</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_Glyph_Copy</b>( <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>   source,                 <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a>  *target );</pre></table><br><table align=center width="87%"><tr><td><p>A function used to copy a glyph image. Note that the created <a href="ft2-glyph_management.html#FT_Glyph">FT_Glyph</a> object must be released with <a href="ft2-glyph_management.html#FT_Done_Glyph">FT_Done_Glyph</a>.</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>source</b></td><td><p>A handle to the source glyph object.</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>target</b></td><td><p>A handle to the target glyph object. 0 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></td></tr></table><hr width="75%"><table align=center width="75%"><tr><td><h4><a name="FT_Glyph_Transform">FT_Glyph_Transform</a></h4>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?