📄 ft2faq.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="Author" content="David Turner"> <link rel="stylesheet" href="../../freetype.css"> <title>FreeType 2 FAQ</title></head><body text="#000000" bgcolor="#FFFFFF" link="#0000EF" vlink="#51188E" alink="#FF0000"><font size=1>http://www.freetype.org</font><p><h1 align=center> <a href="../../index2.html"> <img src="../../image/freetype.jpg" width=550 height=105 alt="The FreeType Project" border=0></a> <h1>The FreeType 2 FAQ</h1></h1><table width="80%" align="center"><tr><td> <hr> <ul> <li><a href="#general">General</a> <ul><p> <li> <a href="#general-what">What is FreeType 2?</a> </li> <li> <a href="#general-uses">What can I do with FreeType 2?</a> </li> <li> <a href="#general-donts">What can I not do with FreeType 2?</a> </li> <li> <a href="#general-portability">How portable is FreeType 2?</a> </li> <li> <a href="#general-freetype1">What are the differences between FreeType 1.x and FreeType 2?</a> </li> <li> <a href="#general-ft1">Is FreeType 2 backwards compatible to FreeType 1.x?</a> </li> <li> <a href="#general-edit">Can I use FreeType 2 to edit fonts or create new ones?</a> </li> </p></ul> </li> <li><a href="#builds">Compilation & Configuration</a> <ul><p> <li> <a href="#builds-compile">How do I compile the FreeType 2 library?</a> </li> <li> <a href="#builds-problems">I've tried to compile FreeType 2, but I'm having problems. What can I do?</a> </li> <li> <a href="#builds-config">How do I configure my library build?</a> </li> </p></ul> </li> <li> <a href="#autohint">The FreeType 2 auto-hinter</a> <ul><p> <li> <a href="#autohint-work">How does the auto-hinter work? </li> <li> <a href="#autohint-other-scripts">Why doesn't the auto-hinter work well with my script?</a> </li> </p></ul> </li> <li> <a href="#other">Other questions</a> <ul><p> <li> <a href="#other-depth">Can I use FreeType to draw text on a pixmap with arbitrary depth?</a> </li> <li> <a href="#other-color">How can I set the colour of text rendered by FreeType?</a> </li> <li> <a href="#other-size">I set the pixel size to 8×8, but the resulting glyphs are larger (or smaller) than that. Why?</a> </li> <li> <a href="#other-bbox">How can I compute the bounding box of a text string without loading its glyphs before?</a> </li> <li> <a href="#other-antialias">Which anti-aliasing algorithm is used by FreeType 2?</a> </li> <li> <a href="#other-opentype">When will FreeType 2 support OpenType?</a> </li> </p></ul> </li> </ul> <p></p> <table width="100%"> <tr bgcolor="#CCCCEE"> <td> <a name="general"></a> <h2 align=center>General questions & answers</h2> </td> </tr> <tr> <td> <a name="general-what"></a> <h3> What is FreeType 2? </h3> <p>It is a software library that can be used by all kinds of applications to access the contents of font files. Most notably, it supports the following ‘features’:</p> <ul> <li><p> It provides a uniform interface to access font files. It supports both bitmap and scalable formats, including TrueType, OpenType, Type1, CID, CFF, Windows FON/FNT, X11 PCF, and others. </p></li> <li><p> It supports high-speed anti-aliased glyph bitmap generation with 256 gray levels. </p></li> <li><p> It is extremely modular, each font format being supported by a specific module. A build of the library can be tailored to support only the formats you need, thus reducing code size (a minimal anti-aliasing build of FreeType can be less than 30KB) </p></li> </ul> <hr><a name="general-uses"></a> <h3> What can I do with FreeType 2? </h3> <p>FreeType 2 is already used in many products. For example, it serves as a font rendering engine</p> <ul> <li> in graphics subsystem and libraries to display text </li> <li> in text layout and pagination services to measure and eventually render text </li> <li> in font inspection and conversion tools </li> </ul> <p>Generally speaking, the library allows you to access and manage the contents of font files in a very easy way.</p> <hr><a name="general-donts"></a> <h3> What can I not do with FreeType 2? </h3> <p>FreeType 2 doesn't try to perform a number of sophisticated things, because it focuses on being an excellent <em>font service</em>.</p> <p>This means that the following features are not supported directly by the library, even though they can be more or less implemented on top of it, or by using it:</p> <ul> <li> <p><b>rendering glyphs to arbitrary surfaces</b><br> FreeType 2 doesn't try to be a graphics library and thus only supports two pixel formats when rendering glyphs: monochrome 1-bit bitmaps, or 8-bit gray-level pixmaps.</p> <p>If you need to draw glyphs to other kinds of surfaces (for example, a 24-bit RGB pixmap), you need to use your favorite graphics library to do just that.</p> <p><em>Note however that in the case of rendering scalable glyph outlines to anti-aliased pixmaps, an application can also provide its own rendering callback in order to draw or compose directly the anti-aliased glyph on any target surface.</em></p> </li> <li> <p><b>glyph caching</b><br> Each time you request a glyph image from a font, FreeType 2 does it by parsing the relevant portion of the font file or font stream and interpreting it according to its font format. This can be very slow for certain formats, including scalable ones like TrueType or Type 1.</p> <p>Any decent text-rendering sub-system must thus be capable of caching glyph data in order to reach appropriate rendering speed.</p> <p><em>Note that we provide a caching sub-system with FreeType 2 since version 2.0.1 which has become quite stable at the time of this writing (version 2.2.1). However, it might not suit your needs.</em></p> </li> <li> <p><b>text layout</b><br> The library doesn't support text layout operations. Sophisticated features like glyph substitution, positioning (kerning), justification, bi-directional ordering, etc.m are not part of a <em>font service</em> in itself. They must be handled one level higher.</p> </li> </ul> <hr><a name="general-portability"></a> <h3> How portable is FreeType 2? </h3> <p>The FreeType 2 source code is <em>extremely</em> portable for the following reasons:</p> <ul> <li> Everything is written in standard ANSI C. </li> <li> We are very pedantic to avoid any kinds of compiler warnings. The current source code has been compiled with many compilers without producing a single warning. </li> <li> The library doesn't use any static writable data at all, making it an ideal choice on various embedded systems (e.g., it can be run from ROM directly). It is completely thread-safe too. </li> </ul> <p>We have made great efforts to ensure that the library is efficient, compact, and customizable.</p> <hr><a name="general-freetype1"></a> <h3> What are the differences between FreeType 1.x and FreeType 2? </h3> <p>The biggest differences are as follows.</p> <ul> <li> <p>FreeType 1 only supports the TrueType format, while FreeType 2 supports a lot more.</p> </li> <li> <p>The FreeType 2 API is simpler as well as more powerful than the FreeType 1 API.</p> </li> <li> <p>FreeType 1 includes an extension to support OpenType text layout processing. This support hasn't become part of FreeType 2; a much improved version is now part of the <a href="http:///www.pango.org">Pango<a/> library.</p> </li> </ul>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -