aboutsummaryrefslogtreecommitdiff
path: root/freetype/docs/reference/ft2-lcd_filtering.html
diff options
context:
space:
mode:
Diffstat (limited to 'freetype/docs/reference/ft2-lcd_filtering.html')
-rw-r--r--freetype/docs/reference/ft2-lcd_filtering.html255
1 files changed, 147 insertions, 108 deletions
diff --git a/freetype/docs/reference/ft2-lcd_filtering.html b/freetype/docs/reference/ft2-lcd_filtering.html
index ca3df8d85..768fbf02c 100644
--- a/freetype/docs/reference/ft2-lcd_filtering.html
+++ b/freetype/docs/reference/ft2-lcd_filtering.html
@@ -3,53 +3,116 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.5.3 API Reference</title>
+<title>FreeType-2.5.5 API Reference</title>
<style type="text/css">
+ a:link { color: #0000EF; }
+ a:visited { color: #51188E; }
+ a:hover { color: #FF0000; }
+
body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
color: #000000;
- background: #FFFFFF; }
+ background: #FFFFFF;
+ width: 87%;
+ margin: auto; }
+
+ div.section { width: 75%;
+ margin: auto; }
+ div.section hr { margin: 4ex 0 1ex 0; }
+ div.section h4 { background-color: #EEEEFF;
+ font-size: medium;
+ font-style: oblique;
+ font-weight: bold;
+ margin: 3ex 0 1.5ex 9%;
+ padding: 0.3ex 0 0.3ex 1%; }
+ div.section p { margin: 1.5ex 0 1.5ex 10%; }
+ div.section pre { margin: 3ex 0 3ex 9%;
+ background-color: #D6E8FF;
+ padding: 2ex 0 2ex 1%; }
+ div.section table.fields { width: 90%;
+ margin: 1.5ex 0 1.5ex 10%; }
+ div.section table.toc { width: 95%;
+ margin: 1.5ex 0 1.5ex 5%; }
+ div.timestamp { text-align: center;
+ font-size: 69%;
+ margin: 1.5ex 0 1.5ex 0; }
- p { text-align: justify; }
h1 { text-align: center; }
- li { text-align: justify; }
- td { padding: 0 0.5em 0 0.5em; }
- td.left { padding: 0 0.5em 0 0.5em;
- text-align: left; }
+ h3 { font-size: medium;
+ margin: 4ex 0 1.5ex 0; }
- a:link { color: #0000EF; }
- a:visited { color: #51188E; }
- a:hover { color: #FF0000; }
+ p { text-align: justify; }
+
+ pre.colored { color: blue; }
span.keyword { font-family: monospace;
text-align: left;
white-space: pre;
color: darkblue; }
- pre.colored { color: blue; }
+ table.fields td.val { font-weight: bold;
+ text-align: right;
+ width: 30%;
+ vertical-align: baseline;
+ padding: 1ex 1em 1ex 0; }
+ table.fields td.desc { vertical-align: baseline;
+ padding: 1ex 0 1ex 1em; }
+ table.fields td.desc p:first-child { margin: 0; }
+ table.fields td.desc p { margin: 1.5ex 0 0 0; }
+ table.index { margin: 6ex auto 6ex auto;
+ border: 0;
+ border-collapse: separate;
+ border-spacing: 1em 0.3ex; }
+ table.index tr { padding: 0; }
+ table.index td { padding: 0; }
+ table.index-toc-link { width: 100%;
+ border: 0;
+ border-spacing: 0;
+ margin: 1ex 0 1ex 0; }
+ table.index-toc-link td.left { padding: 0 0.5em 0 0.5em;
+ font-size: 83%;
+ text-align: left; }
+ table.index-toc-link td.middle { padding: 0 0.5em 0 0.5em;
+ font-size: 83%;
+ text-align: center; }
+ table.index-toc-link td.right { padding: 0 0.5em 0 0.5em;
+ font-size: 83%;
+ text-align: right; }
+ table.synopsis { margin: 6ex auto 6ex auto;
+ border: 0;
+ border-collapse: separate;
+ border-spacing: 2em 0.6ex; }
+ table.synopsis tr { padding: 0; }
+ table.synopsis td { padding: 0; }
+ table.toc td.link { width: 30%;
+ text-align: right;
+ vertical-align: baseline;
+ padding: 1ex 1em 1ex 0; }
+ table.toc td.desc { vertical-align: baseline;
+ padding: 1ex 0 1ex 1em;
+ text-align: left; }
+ table.toc td.desc p:first-child { margin: 0;
+ text-align: left; }
+ table.toc td.desc p { margin: 1.5ex 0 0 0;
+ text-align: left; }
- ul.empty { list-style-type: none; }
</style>
</head>
<body>
-<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.5.3 API Reference</h1></center>
+<table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table>
+<h1>FreeType-2.5.5 API Reference</h1>
-<center><h1>
-LCD Filtering
-</h1></center>
+<h1>LCD Filtering</h1>
<h2>Synopsis</h2>
-<table align=center cellspacing=5 cellpadding=0 border=0>
-<tr><td></td><td><a href="#FT_LcdFilter">FT_LcdFilter</a></td><td></td><td><a href="#FT_Library_SetLcdFilterWeights">FT_Library_SetLcdFilterWeights</a></td></tr>
-<tr><td></td><td><a href="#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a></td><td></td><td></td></tr>
-</table><br><br>
+<table class="synopsis">
+<tr><td><a href="#FT_LcdFilter">FT_LcdFilter</a></td><td><a href="#FT_Library_SetLcdFilterWeights">FT_Library_SetLcdFilterWeights</a></td></tr>
+<tr><td><a href="#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a></td><td></td></tr>
+</table>
+
-<table align=center width="87%"><tr><td>
<p>The <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> API can be used to specify a low-pass filter, which is then applied to LCD-optimized bitmaps generated through <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>. This is useful to reduce color fringes that would occur with unfiltered rendering.</p>
<p>Note that no filter is active by default, and that this function is <b>not</b> implemented in default builds of the library. You need to #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your &lsquo;ftoption.h&rsquo; file in order to activate it.</p>
-<p>FreeType generates alpha coverage maps, which are linear by nature. For instance, the value 0x80 in bitmap representation means that (within numerical precision) 0x80/0xff fraction of that pixel is covered by the glyph's outline. The blending function for placing text over a background is</p>
+<p>FreeType generates alpha coverage maps, which are linear by nature. For instance, the value 0x80 in bitmap representation means that (within numerical precision) 0x80/0xFF fraction of that pixel is covered by the glyph's outline. The blending function for placing text over a background is</p>
<pre class="colored">
dst = alpha * src + (1 - alpha) * dst ,
</pre>
@@ -63,144 +126,120 @@ LCD Filtering
[0x10, 0x50, 0x60, 0x50, 0x10] ,
</pre>
<p>where &lsquo;a&rsquo; has value 0x30 and &lsquo;b&rsquo; value 0x20. The weights in filter may have a sum larger than 0x100, which increases coloration slightly but also improves contrast.</p>
-</td></tr></table><br>
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_LcdFilter">FT_LcdFilter</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LCD_FILTER_H (ftlcdfil.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
+<div class="section">
+<h3 id="FT_LcdFilter">FT_LcdFilter</h3>
+<p>Defined in FT_LCD_FILTER_H (ftlcdfil.h).</p>
+<pre>
<span class="keyword">typedef</span> <span class="keyword">enum</span> FT_LcdFilter_
{
- <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_NONE</a> = 0,
- <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_DEFAULT</a> = 1,
- <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_LIGHT</a> = 2,
- <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_LEGACY</a> = 16,
+ <a href="ft2-lcd_filtering.html#FT_LCD_FILTER_NONE">FT_LCD_FILTER_NONE</a> = 0,
+ <a href="ft2-lcd_filtering.html#FT_LCD_FILTER_DEFAULT">FT_LCD_FILTER_DEFAULT</a> = 1,
+ <a href="ft2-lcd_filtering.html#FT_LCD_FILTER_LIGHT">FT_LCD_FILTER_LIGHT</a> = 2,
+ <a href="ft2-lcd_filtering.html#FT_LCD_FILTER_LEGACY">FT_LCD_FILTER_LEGACY</a> = 16,
FT_LCD_FILTER_MAX /* do not remove */
} <b>FT_LcdFilter</b>;
+</pre>
-</pre></table><br>
-<table align=center width="87%"><tr><td>
<p>A list of values to identify various types of LCD filters.</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>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>FT_LCD_FILTER_NONE</b></td><td>
+
+<h4>values</h4>
+<table class="fields">
+<tr><td class="val" id="FT_LCD_FILTER_NONE">FT_LCD_FILTER_NONE</td><td class="desc">
<p>Do not perform filtering. When used with subpixel rendering, this results in sometimes severe color fringes.</p>
</td></tr>
-<tr valign=top><td><b>FT_LCD_FILTER_DEFAULT</b></td><td>
+<tr><td class="val" id="FT_LCD_FILTER_DEFAULT">FT_LCD_FILTER_DEFAULT</td><td class="desc">
<p>The default filter reduces color fringes considerably, at the cost of a slight blurriness in the output.</p>
</td></tr>
-<tr valign=top><td><b>FT_LCD_FILTER_LIGHT</b></td><td>
+<tr><td class="val" id="FT_LCD_FILTER_LIGHT">FT_LCD_FILTER_LIGHT</td><td class="desc">
<p>The light filter is a variant that produces less blurriness at the cost of slightly more color fringes than the default one. It might be better, depending on taste, your monitor, or your personal vision.</p>
</td></tr>
-<tr valign=top><td><b>FT_LCD_FILTER_LEGACY</b></td><td>
+<tr><td class="val" id="FT_LCD_FILTER_LEGACY">FT_LCD_FILTER_LEGACY</td><td class="desc">
<p>This filter corresponds to the original libXft color filter. It provides high contrast output but can exhibit really bad color fringes if glyphs are not extremely well hinted to the pixel grid. In other words, it only works well if the TrueType bytecode interpreter is enabled <b>and</b> high-quality hinted fonts are used.</p>
<p>This filter is only provided for comparison purposes, and might be disabled or stay unsupported in the future.</p>
</td></tr>
</table>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
+
+<h4>since</h4>
<p>2.3.0</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LCD_FILTER_H (ftlcdfil.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
+<hr>
+<table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
+
+<div class="section">
+<h3 id="FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</h3>
+<p>Defined in FT_LCD_FILTER_H (ftlcdfil.h).</p>
+<pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
<b>FT_Library_SetLcdFilter</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
<a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LcdFilter</a> filter );
+</pre>
-</pre></table><br>
-<table align=center width="87%"><tr><td>
<p>This function is used to apply color filtering to LCD decimated bitmaps, like the ones used when calling <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a> with <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD</a> or <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD_V</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>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
+
+<h4>input</h4>
+<table class="fields">
+<tr><td class="val" id="library">library</td><td class="desc">
<p>A handle to the target library instance.</p>
</td></tr>
-<tr valign=top><td><b>filter</b></td><td>
+<tr><td class="val" id="filter">filter</td><td class="desc">
<p>The filter type.</p>
<p>You can use <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_NONE</a> here to disable this feature, or <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_DEFAULT</a> to use a default filter that should work well on most LCD screens.</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>
+
+<h4>return</h4>
<p>FreeType error code. 0&nbsp;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>
+
+<h4>note</h4>
<p>This feature is always disabled by default. Clients must make an explicit call to this function with a &lsquo;filter&rsquo; value other than <a href="ft2-lcd_filtering.html#FT_LcdFilter">FT_LCD_FILTER_NONE</a> in order to enable it.</p>
<p>Due to <b>PATENTS</b> covering subpixel rendering, this function doesn't do anything except returning &lsquo;FT_Err_Unimplemented_Feature&rsquo; if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library, which should correspond to all default builds of FreeType.</p>
<p>The filter affects glyph bitmaps rendered through <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>, <a href="ft2-outline_processing.html#FT_Outline_Get_Bitmap">FT_Outline_Get_Bitmap</a>, <a href="ft2-base_interface.html#FT_Load_Glyph">FT_Load_Glyph</a>, and <a href="ft2-base_interface.html#FT_Load_Char">FT_Load_Char</a>.</p>
<p>It does <i>not</i> affect the output of <a href="ft2-outline_processing.html#FT_Outline_Render">FT_Outline_Render</a> and <a href="ft2-outline_processing.html#FT_Outline_Get_Bitmap">FT_Outline_Get_Bitmap</a>.</p>
<p>If this feature is activated, the dimensions of LCD glyph bitmaps are either larger or taller than the dimensions of the corresponding outline with regards to the pixel grid. For example, for <a href="ft2-base_interface.html#FT_Render_Mode">FT_RENDER_MODE_LCD</a>, the filter adds up to 3&nbsp;pixels to the left, and up to 3&nbsp;pixels to the right.</p>
<p>The bitmap offset values are adjusted correctly, so clients shouldn't need to modify their layout and glyph positioning code when enabling the filter.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
+
+<h4>since</h4>
<p>2.3.0</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-
-<table align=center width="75%"><tr><td>
-<h4><a name="FT_Library_SetLcdFilterWeights">FT_Library_SetLcdFilterWeights</a></h4>
-<table align=center width="87%"><tr><td>
-Defined in FT_LCD_FILTER_H (ftlcdfil.h).
-</td></tr></table><br>
-<table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
+<hr>
+<table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
+
+<div class="section">
+<h3 id="FT_Library_SetLcdFilterWeights">FT_Library_SetLcdFilterWeights</h3>
+<p>Defined in FT_LCD_FILTER_H (ftlcdfil.h).</p>
+<pre>
FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
<b>FT_Library_SetLcdFilterWeights</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
<span class="keyword">unsigned</span> <span class="keyword">char</span> *weights );
+</pre>
-</pre></table><br>
-<table align=center width="87%"><tr><td>
<p>Use this function to override the filter weights selected by <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a>. By default, FreeType uses the quintuple (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10, 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and FT_LCD_FILTER_LEGACY.</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>
-<p></p>
-<table cellpadding=3 border=0>
-<tr valign=top><td><b>library</b></td><td>
+
+<h4>input</h4>
+<table class="fields">
+<tr><td class="val" id="library">library</td><td class="desc">
<p>A handle to the target library instance.</p>
</td></tr>
-<tr valign=top><td><b>weights</b></td><td>
+<tr><td class="val" id="weights">weights</td><td class="desc">
<p>A pointer to an array; the function copies the first five bytes and uses them to specify the filter weights.</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>
+
+<h4>return</h4>
<p>FreeType error code. 0&nbsp;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>
+
+<h4>note</h4>
<p>Due to <b>PATENTS</b> covering subpixel rendering, this function doesn't do anything except returning &lsquo;FT_Err_Unimplemented_Feature&rsquo; if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library, which should correspond to all default builds of FreeType.</p>
<p>This function must be called after <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> to have any effect.</p>
-</td></tr></table>
-<table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
+
+<h4>since</h4>
<p>2.4.0</p>
-</td></tr></table>
-</td></tr></table>
-<hr width="75%">
-<table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
-<td width="100%"></td>
-<td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
+
+<hr>
+<table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
</body>
</html>