Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  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.5.0 API Reference</title>
  7. <style type="text/css">
  8.   body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
  9.          color: #000000;
  10.          background: #FFFFFF; }
  11.  
  12.   p { text-align: justify; }
  13.   h1 { text-align: center; }
  14.   li { text-align: justify; }
  15.   td { padding: 0 0.5em 0 0.5em; }
  16.   td.left { padding: 0 0.5em 0 0.5em;
  17.             text-align: left; }
  18.  
  19.   a:link { color: #0000EF; }
  20.   a:visited { color: #51188E; }
  21.   a:hover { color: #FF0000; }
  22.  
  23.   span.keyword { font-family: monospace;
  24.                  text-align: left;
  25.                  white-space: pre;
  26.                  color: darkblue; }
  27.  
  28.   pre.colored { color: blue; }
  29.  
  30.   ul.empty { list-style-type: none; }
  31. </style>
  32. </head>
  33. <body>
  34.  
  35. <table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
  36. <td width="100%"></td>
  37. <td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  38. <center><h1>FreeType-2.5.0 API Reference</h1></center>
  39.  
  40. <center><h1>
  41. The auto-hinter
  42. </h1></center>
  43. <h2>Synopsis</h2>
  44. <table align=center cellspacing=5 cellpadding=0 border=0>
  45. <tr><td></td><td><a href="#glyph-to-script-map">glyph-to-script-map</a></td><td></td><td><a href="#fallback-script">fallback-script</a></td></tr>
  46. <tr><td></td><td><a href="#FT_AUTOHINTER_SCRIPT_XXX">FT_AUTOHINTER_SCRIPT_XXX</a></td><td></td><td><a href="#increase-x-height">increase-x-height</a></td></tr>
  47. <tr><td></td><td><a href="#FT_Prop_GlyphToScriptMap">FT_Prop_GlyphToScriptMap</a></td><td></td><td><a href="#FT_Prop_IncreaseXHeight">FT_Prop_IncreaseXHeight</a></td></tr>
  48. </table><br><br>
  49.  
  50. <table align=center width="87%"><tr><td>
  51. <p>While FreeType's auto-hinter doesn't expose API functions by itself, it is possible to control its behaviour with <a href="ft2-module_management.html#FT_Property_Set">FT_Property_Set</a> and <a href="ft2-module_management.html#FT_Property_Get">FT_Property_Get</a>. The following lists the available properties together with the necessary macros and structures.</p>
  52. <p>Note that the auto-hinter's module name is &lsquo;autofitter&rsquo; for historical reasons.</p>
  53. </td></tr></table><br>
  54. <table align=center width="75%"><tr><td>
  55. <h4><a name="glyph-to-script-map">glyph-to-script-map</a></h4>
  56. <table align=center width="87%"><tr><td>
  57. <p><b>Experimental</b> <b>only</b></p>
  58. <p>The auto-hinter provides various script modules to hint glyphs. Examples of supported scripts are Latin or CJK. Before a glyph is auto-hinted, the Unicode character map of the font gets examined, and the script is then determined based on Unicode character ranges, see below.</p>
  59. <p>OpenType fonts, however, often provide much more glyphs than character codes (small caps, superscripts, ligatures, swashes, etc.), to be controlled by so-called &lsquo;features&rsquo;. Handling OpenType features can be quite complicated and thus needs a separate library on top of FreeType.</p>
  60. <p>The mapping between glyph indices and scripts (in the auto-hinter sense, see the <a href="ft2-auto_hinter.html#FT_AUTOHINTER_SCRIPT_XXX">FT_AUTOHINTER_SCRIPT_XXX</a> values) is stored as an array with &lsquo;num_glyphs&rsquo; elements, as found in the font's <a href="ft2-base_interface.html#FT_Face">FT_Face</a> structure. The &lsquo;glyph-to-script-map&rsquo; property returns a pointer to this array which can be modified as needed. Note that the modification should happen before the first glyph gets processed by the auto-hinter so that the global analysis of the font shapes actually uses the modified mapping.</p>
  61. <p>The following example code demonstrates how to access it (omitting the error handling).</p>
  62. <pre class="colored">
  63.   FT_Library                library;
  64.   FT_Face                   face;
  65.   FT_Prop_GlyphToScriptMap  prop;
  66.  
  67.  
  68.   FT_Init_FreeType( &amp;library );
  69.   FT_New_Face( library, "foo.ttf", 0, &amp;face );
  70.  
  71.   prop.face = face;
  72.  
  73.   FT_Property_Get( library, "autofitter",
  74.                             "glyph-to-script-map", &amp;prop );
  75.  
  76.   // adjust `prop.map' as needed right here
  77.  
  78.  FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT );
  79. </pre>
  80. </td></tr></table><br>
  81. </td></tr></table>
  82. <hr width="75%">
  83. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  84. <td width="100%"></td>
  85. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  86.  
  87. <table align=center width="75%"><tr><td>
  88. <h4><a name="FT_AUTOHINTER_SCRIPT_XXX">FT_AUTOHINTER_SCRIPT_XXX</a></h4>
  89. <table align=center width="87%"><tr><td>
  90. Defined in FT_AUTOHINTER_H (freetype/ftautoh.h).
  91. </td></tr></table><br>
  92. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  93.  
  94. #define <a href="ft2-auto_hinter.html#FT_AUTOHINTER_SCRIPT_XXX">FT_AUTOHINTER_SCRIPT_NONE</a>   0
  95. #define <a href="ft2-auto_hinter.html#FT_AUTOHINTER_SCRIPT_XXX">FT_AUTOHINTER_SCRIPT_LATIN</a>  1
  96. #define <a href="ft2-auto_hinter.html#FT_AUTOHINTER_SCRIPT_XXX">FT_AUTOHINTER_SCRIPT_CJK</a>    2
  97. #define <a href="ft2-auto_hinter.html#FT_AUTOHINTER_SCRIPT_XXX">FT_AUTOHINTER_SCRIPT_INDIC</a>  3
  98.  
  99. </pre></table><br>
  100. <table align=center width="87%"><tr><td>
  101. <p><b>Experimental</b> <b>only</b></p>
  102. <p>A list of constants used for the <a href="ft2-auto_hinter.html#glyph-to-script-map">glyph-to-script-map</a> property to specify the script submodule the auto-hinter should use for hinting a particular glyph.</p>
  103. </td></tr></table><br>
  104. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>values</b></em></td></tr><tr><td>
  105. <p></p>
  106. <table cellpadding=3 border=0>
  107. <tr valign=top><td colspan=0><b>FT_AUTOHINTER_SCRIPT_NONE</b></td></tr>
  108. <tr valign=top><td></td><td>
  109. <p>Don't auto-hint this glyph.</p>
  110. </td></tr>
  111. <tr valign=top><td colspan=0><b>FT_AUTOHINTER_SCRIPT_LATIN</b></td></tr>
  112. <tr valign=top><td></td><td>
  113. <p>Apply the latin auto-hinter. For the auto-hinter, &lsquo;latin&rsquo; is a very broad term, including Cyrillic and Greek also since characters from those scripts share the same design constraints.</p>
  114. <p>By default, characters from the following Unicode ranges are assigned to this submodule.</p>
  115. <pre class="colored">
  116.   U+0020 - U+007F  // Basic Latin (no control characters)
  117.   U+00A0 - U+00FF  // Latin-1 Supplement (no control characters)
  118.   U+0100 - U+017F  // Latin Extended-A
  119.   U+0180 - U+024F  // Latin Extended-B
  120.   U+0250 - U+02AF  // IPA Extensions
  121.   U+02B0 - U+02FF  // Spacing Modifier Letters
  122.   U+0300 - U+036F  // Combining Diacritical Marks
  123.   U+0370 - U+03FF  // Greek and Coptic
  124.   U+0400 - U+04FF  // Cyrillic
  125.   U+0500 - U+052F  // Cyrillic Supplement
  126.   U+1D00 - U+1D7F  // Phonetic Extensions
  127.   U+1D80 - U+1DBF  // Phonetic Extensions Supplement
  128.   U+1DC0 - U+1DFF  // Combining Diacritical Marks Supplement
  129.   U+1E00 - U+1EFF  // Latin Extended Additional
  130.   U+1F00 - U+1FFF  // Greek Extended
  131.   U+2000 - U+206F  // General Punctuation
  132.   U+2070 - U+209F  // Superscripts and Subscripts
  133.   U+20A0 - U+20CF  // Currency Symbols
  134.   U+2150 - U+218F  // Number Forms
  135.   U+2460 - U+24FF  // Enclosed Alphanumerics
  136.   U+2C60 - U+2C7F  // Latin Extended-C
  137.   U+2DE0 - U+2DFF  // Cyrillic Extended-A
  138.   U+2E00 - U+2E7F  // Supplemental Punctuation
  139.   U+A640 - U+A69F  // Cyrillic Extended-B
  140.   U+A720 - U+A7FF  // Latin Extended-D
  141.   U+FB00 - U+FB06  // Alphab. Present. Forms (Latin Ligatures)
  142.  U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols
  143.  U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement
  144. </pre>
  145. <p></p>
  146. </td></tr>
  147. <tr valign=top><td colspan=0><b>FT_AUTOHINTER_SCRIPT_CJK</b></td></tr>
  148. <tr valign=top><td></td><td>
  149. <p>Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old Vietnamese, and some other scripts.</p>
  150. <p>By default, characters from the following Unicode ranges are assigned to this submodule.</p>
  151. <pre class="colored">
  152.   U+1100 - U+11FF  // Hangul Jamo
  153.   U+2E80 - U+2EFF  // CJK Radicals Supplement
  154.   U+2F00 - U+2FDF  // Kangxi Radicals
  155.   U+2FF0 - U+2FFF  // Ideographic Description Characters
  156.   U+3000 - U+303F  // CJK Symbols and Punctuation
  157.   U+3040 - U+309F  // Hiragana
  158.   U+30A0 - U+30FF  // Katakana
  159.   U+3100 - U+312F  // Bopomofo
  160.   U+3130 - U+318F  // Hangul Compatibility Jamo
  161.   U+3190 - U+319F  // Kanbun
  162.   U+31A0 - U+31BF  // Bopomofo Extended
  163.   U+31C0 - U+31EF  // CJK Strokes
  164.   U+31F0 - U+31FF  // Katakana Phonetic Extensions
  165.   U+3200 - U+32FF  // Enclosed CJK Letters and Months
  166.   U+3300 - U+33FF  // CJK Compatibility
  167.   U+3400 - U+4DBF  // CJK Unified Ideographs Extension A
  168.   U+4DC0 - U+4DFF  // Yijing Hexagram Symbols
  169.   U+4E00 - U+9FFF  // CJK Unified Ideographs
  170.   U+A960 - U+A97F  // Hangul Jamo Extended-A
  171.   U+AC00 - U+D7AF  // Hangul Syllables
  172.   U+D7B0 - U+D7FF  // Hangul Jamo Extended-B
  173.   U+F900 - U+FAFF  // CJK Compatibility Ideographs
  174.   U+FE10 - U+FE1F  // Vertical forms
  175.   U+FE30 - U+FE4F  // CJK Compatibility Forms
  176.   U+FF00 - U+FFEF  // Halfwidth and Fullwidth Forms
  177.  U+1B000 - U+1B0FF // Kana Supplement
  178.  U+1D300 - U+1D35F // Tai Xuan Hing Symbols
  179.  U+1F200 - U+1F2FF // Enclosed Ideographic Supplement
  180.  U+20000 - U+2A6DF // CJK Unified Ideographs Extension B
  181.  U+2A700 - U+2B73F // CJK Unified Ideographs Extension C
  182.  U+2B740 - U+2B81F // CJK Unified Ideographs Extension D
  183.  U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement
  184. </pre>
  185. <p></p>
  186. </td></tr>
  187. <tr valign=top><td colspan=0><b>FT_AUTOHINTER_SCRIPT_INDIC</b></td></tr>
  188. <tr valign=top><td></td><td>
  189. <p>Apply the indic auto-hinter, covering all major scripts from the Indian sub-continent and some other related scripts like Thai, Lao, or Tibetan.</p>
  190. <p>By default, characters from the following Unicode ranges are assigned to this submodule.</p>
  191. <pre class="colored">
  192.   U+0900 - U+0DFF  // Indic Range
  193.   U+0F00 - U+0FFF  // Tibetan
  194.   U+1900 - U+194F  // Limbu
  195.   U+1B80 - U+1BBF  // Sundanese
  196.   U+1C80 - U+1CDF  // Meetei Mayak
  197.   U+A800 - U+A82F  // Syloti Nagri
  198.  U+11800 - U+118DF // Sharada
  199. </pre>
  200. <p>Note that currently Indic support is rudimentary only, missing blue zone support.</p>
  201. </td></tr>
  202. </table>
  203. </td></tr></table>
  204. </td></tr></table>
  205. <hr width="75%">
  206. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  207. <td width="100%"></td>
  208. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  209.  
  210. <table align=center width="75%"><tr><td>
  211. <h4><a name="FT_Prop_GlyphToScriptMap">FT_Prop_GlyphToScriptMap</a></h4>
  212. <table align=center width="87%"><tr><td>
  213. Defined in FT_AUTOHINTER_H (freetype/ftautoh.h).
  214. </td></tr></table><br>
  215. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  216.  
  217.    <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Prop_GlyphToScriptMap_
  218.    {
  219.      <a href="ft2-base_interface.html#FT_Face">FT_Face</a>   face;
  220.      <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a>*  map;
  221.  
  222.    } <b>FT_Prop_GlyphToScriptMap</b>;
  223.  
  224. </pre></table><br>
  225. <table align=center width="87%"><tr><td>
  226. <p><b>Experimental</b> <b>only</b></p>
  227. <p>The data exchange structure for the <a href="ft2-auto_hinter.html#glyph-to-script-map">glyph-to-script-map</a> property.</p>
  228. </td></tr></table><br>
  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.  
  235. <table align=center width="75%"><tr><td>
  236. <h4><a name="fallback-script">fallback-script</a></h4>
  237. <table align=center width="87%"><tr><td>
  238. <p><b>Experimental</b> <b>only</b></p>
  239. <p>If no auto-hinter script module can be assigned to a glyph, a fallback script gets assigned to it (see also the <a href="ft2-auto_hinter.html#glyph-to-script-map">glyph-to-script-map</a> property). By default, this is <a href="ft2-auto_hinter.html#FT_AUTOHINTER_SCRIPT_XXX">FT_AUTOHINTER_SCRIPT_CJK</a>. Using the &lsquo;fallback-script&rsquo; property, this fallback value can be changed.</p>
  240. <pre class="colored">
  241.   FT_Library  library;
  242.   FT_UInt     fallback_script = FT_AUTOHINTER_SCRIPT_NONE;
  243.  
  244.  
  245.   FT_Init_FreeType( &amp;library );
  246.  
  247.   FT_Property_Set( library, "autofitter",
  248.                             "fallback-script", &amp;fallback_script );
  249. </pre>
  250. </td></tr></table><br>
  251. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  252. <p>This property can be used with <a href="ft2-module_management.html#FT_Property_Get">FT_Property_Get</a> also.</p>
  253. <p>It's important to use the right timing for changing this value: The creation of the glyph-to-script map which eventually uses the fallback script value gets triggered either by setting or reading a face-specific property like <a href="ft2-auto_hinter.html#glyph-to-script-map">glyph-to-script-map</a>, or by auto-hinting any glyph from that face. In particular, if you have already created an <a href="ft2-base_interface.html#FT_Face">FT_Face</a> structure but not loaded any glyph (using the auto-hinter), a change of the fallback glyph will affect this face.</p>
  254. </td></tr></table>
  255. </td></tr></table>
  256. <hr width="75%">
  257. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  258. <td width="100%"></td>
  259. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  260.  
  261. <table align=center width="75%"><tr><td>
  262. <h4><a name="increase-x-height">increase-x-height</a></h4>
  263. <table align=center width="87%"><tr><td>
  264. <p>For ppem values in the range 6&nbsp;&lt;= ppem &lt;= &lsquo;increase-x-height&rsquo;, round up the font's x&nbsp;height much more often than normally. If the value is set to&nbsp;0, which is the default, this feature is switched off. Use this property to improve the legibility of small font sizes if necessary.</p>
  265. <pre class="colored">
  266.   FT_Library               library;
  267.   FT_Face                  face;
  268.   FT_Prop_IncreaseXHeight  prop;
  269.  
  270.  
  271.   FT_Init_FreeType( &amp;library );
  272.   FT_New_Face( library, "foo.ttf", 0, &amp;face );
  273.   FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 );
  274.  
  275.   prop.face  = face;
  276.   prop.limit = 14;
  277.  
  278.   FT_Property_Set( library, "autofitter",
  279.                             "increase-x-height", &amp;prop );
  280. </pre>
  281. </td></tr></table><br>
  282. <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
  283. <p>This property can be used with <a href="ft2-module_management.html#FT_Property_Get">FT_Property_Get</a> also.</p>
  284. <p>Set this value right after calling <a href="ft2-base_interface.html#FT_Set_Char_Size">FT_Set_Char_Size</a>, but before loading any glyph (using the auto-hinter).</p>
  285. </td></tr></table>
  286. </td></tr></table>
  287. <hr width="75%">
  288. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  289. <td width="100%"></td>
  290. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  291.  
  292. <table align=center width="75%"><tr><td>
  293. <h4><a name="FT_Prop_IncreaseXHeight">FT_Prop_IncreaseXHeight</a></h4>
  294. <table align=center width="87%"><tr><td>
  295. Defined in FT_AUTOHINTER_H (freetype/ftautoh.h).
  296. </td></tr></table><br>
  297. <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
  298.  
  299.    <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Prop_IncreaseXHeight_
  300.    {
  301.      <a href="ft2-base_interface.html#FT_Face">FT_Face</a>  face;
  302.      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>  limit;
  303.  
  304.    } <b>FT_Prop_IncreaseXHeight</b>;
  305.  
  306. </pre></table><br>
  307. <table align=center width="87%"><tr><td>
  308. <p>The data exchange structure for the <a href="ft2-auto_hinter.html#increase-x-height">increase-x-height</a> property.</p>
  309. </td></tr></table><br>
  310. </td></tr></table>
  311. <hr width="75%">
  312. <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
  313. <td width="100%"></td>
  314. <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
  315.  
  316. </body>
  317. </html>
  318.