FreeType 2

FreeType 2

FreeType 2被設計為一種占用空間小的、高效的、高度可定製的、並且可以產生可移植的高品質輸出(符號圖像)。可以被用在諸如圖像庫、展出伺服器、字型轉換工具、圖像文字產生工具等多種其它產品上。

中文介紹,簡介,特性,英文介紹,簡介,特性,要求,

中文介紹

簡介

FreeType 2
請注意FreeType 2是一種字型服務而沒有提供為實現文字布局或圖形化處理這樣高階的功能使用的API(比如帶色文字渲染之類的)。然而,它提供一個簡單的、易用的並且統一的接口實現對多種字型檔的訪問,從而大大簡化了這些高級的任務。
FreeType 2的發行遵循兩個開源許可:我們自己的BSD樣式的FreeType License和GPL(通用公共許可證)。它可以被用在任何程式中,無論是專有與否。

特性

下面是 FreeType 2 提供的特性的一個不完全列表:
·FreeType 2 為訪問字型檔提供了一套統一的、獨立於字型檔類型的、簡單而易用的API。另外,一些特別類型的API可以用來訪問字型檔里的特殊數據。
·與大多數同類的字型檔不同,FreeType 2 生來就支持類似TrueType 或者 Type 1的可縮放字型類型,並且可以將字型的大綱數據(控制項介紹/提示)返回給各戶應用程式。
·FreeType 2 的設計是基於模組的,這些模組可以在編譯時被靜態連結到庫中或者在運行時根據需要載入。模組可以用來支持特殊的字型格式,或者甚至是新的符號圖像類型!
·FreeType 2 特意使用嵌入式系統編寫,這意味著它不使用靜態可寫數據(也就是說,它可以直接從ROM中運行),這樣客戶程式就可以只為他們自己提供記憶體管理和輸入/輸出流的實現。
客戶程式自己的輸入/輸出流可以使你輕易地使用相同的API讀取基於ROM或被壓縮的或遠程的字型檔。多個流實現可以並行的被一個FreeType 2 實例使用。
你可以只編譯那些你的嵌入式工程或環境需要的模組,從而有效的減小FreeType 2 的代碼大小。
·FreeType 2 默認支持下面的字型類型:
TrueType 字型(集合)
Type 1 字型
CID-keyed Type 1 字型
CFF 字型
OpenType fonts (包括 TrueType 和 變體CFF )
SFNT-based bitmap 字型
X11 PCF 字型
Windows FNT 字型
BDF 字型 (包括反走樣類型的)
PFR 字型
Type 42 字型 (有限支持)
·通過一個給定的字形輪廓,FreeType 2 有能力產生一個高質量的單色點陣圖或一幅使用年256階灰度的不走樣的像素圖。這比Windows 9x/98/NT/2000 或 FreeType 1使用的5階灰度像素圖要好得多。
·FreeType 2 支持 TrueType 和 OpenType 規格定義的全部字元映射。同時,它也完全有能力自動合成Type 1 使用的那種Unicode字元表,這種表要求必須把一個那種令人頭痛的供轉換編碼時使用的結束符放置在標的末尾——這在Type 1 使用的那種格式中是很常見的(當然,如果你需要,那種原始的編碼方式也是可用的)。
·FreeType 2 的核心API提供了對訪問字形名或調整數據中字元間距這樣的高級信息的函式支持。
·一個完整且有效率的TrueType位元組碼解釋器。這個引擎可以用很小的點產生極好的輸出。由於TrueType規格極其令人費解且十分含糊,這個組件想要成功完成輸出是極其困難的。但無論如何,我們現在已經能使Windows的顯示質量達到Mac的水平。
·對於那些不需要或不希望為TrueType字型使用位元組碼解釋器的人,我們開發了我們自己的自動提示模組。這種模組過去也曾被一些可縮放的字型使用過。
·FreeType 2 可以產生一些相似的字型引擎無法產生的信息,例如字距調整的位距、字元名、垂直度量之類的。
由於它模組化的設計,可以很方便地通過可選的API更改FreeType庫來提供另外的針對特定字型類型的信息。(例如,一個可選的API用來檢索TrueType 和 OpenType 字型的SFNT表。
·自從2.0.1版發布開始,FreeType 2 開始提供它自己的超高速快取子系統。可以利用它快取可變實例或字形圖像,使它們擁有更高的效率。

英文介紹

另附原文如下:

簡介

What is FreeType 2?
FreeType 2 is a software font engine that is designed to be small, efficient, highly customizable, and portable while capable of producing high-quality output (glyph images). It can be used in graphics libraries, display servers, font conversion tools, text image generation tools, and many other products as well.
Note that FreeType 2 is a font service and doesn't provide APIs to perform higher-level features like text layout or graphics processing (e.g., colored text rendering, ‘hollowing’, etc.). However, it greatly simplifies these tasks by providing a simple, easy to use, and uniform interface to access the content of font files.
FreeType 2 is released under two open-source licenses: our own BSD-like FreeType License and the GPL. It can thus be used by any kind of projects, be they proprietary or not.
--------------------------------------------------------------------------------

特性

Features
The following is a non-exhaustive list of features provided by FreeType 2.
FreeType 2 provides a simple and easy-to-use API to access font content in a uniform way, independently of the file format. Additionally, some format-specific APIs can be used to access special data in the font file.
Unlike most comparable libraries, FreeType 2 supports scalable font formats like TrueType or Type 1 natively and can return the outline data (and control instructions/hints) to client applications.
The design of FreeType 2 is based on modules that can be either linked statically to the library at compile time, or loaded on demand at runtime. Modules are used to support specific font formats, or even new glyph image formats!
FreeType 2 was written with embedded systems in mind. This means that it doesn't use static writable data (i.e., it can be run from ROM directly), and that client applications can provide their own memory manager and I/O stream implementation.
The latter allows you to easily read from ROM-based, compressed or remote font files with the same API. Several stream implementations can be used concurrently with a single FreeType 2 instance.
You can also reduce the size of the FreeType 2 code by only compiling the modules you need for your embedded project/environment.
By default, FreeType 2 supports the following font formats.
TrueType fonts (and collections)
Type 1 fonts
CID-keyed Type 1 fonts
CFF fonts
OpenType fonts (both TrueType and CFF variants)
SFNT-based bitmap fonts
X11 PCF fonts
Windows FNT fonts
BDF fonts (including anti-aliased ones)
PFR fonts
Type 42 fonts (limited support)
From a given glyph outline, FreeType 2 is capable of producing a high-quality monochrome bitmap, or anti-aliased pixmap, using 256 levels of ‘gray’. This is much better than the 5 levels used by Windows 9x/98/NT/2000 or FreeType 1.
FreeType 2 supports all the character mappings defined by the TrueType and OpenType specification. It is also capable of automatically synthetizing a Unicode charmap from Type 1 fonts, which puts an end to the painful ‘encoding translation’ headache common with this format (of course, original encodings are also available in the case where you need them).
The FreeType 2 core API provides simple functions to access advanced information like glyph names or kerning data.
A full-featured and efficient TrueType bytecode interpreter. The engine is able to produce excellent output at small point sizes. This component has been extremely difficult to get right, due to the ambiguous and misleading TrueType specification. However, we now match Windows and Mac qualities. Please read our patents page to learn more about some issues when using the interpreter.
For those who don't need or want to use the bytecode interpreter for TrueType fonts, we developed our own automatic hinter module. It is also used by other scalable formats.
FreeType 2 provides information that is often not available from other similar font engines, like kerning distances, glyph names, vertical metrics, etc.
Due to its modular design, it is easy to enhance the library to provide additional format-specific information through optional APIs (as an example, an optional API is provided to retrieve SFNT tables from TrueType and OpenType fonts).
FreeType 2 provides its own caching subsystem since release 2.0.1. It can be used to cache either face instances or glyph images efficiently.
--------------------------------------------------------------------------------

要求

Requirements
FreeType 2 is written in industry-standard ANSI C and should compile easily with any compliant C compiler. We have even taken great care to eliminate all warnings when compiling with popular compilers like gcc, Visual C++, and Borland C++.
Apart from a standard ANSI C library, FreeType 2 doesn't have any external dependencies and can be compiled and installed on its own on any kind of system.
--------------------------------------------------------------------------------
Patents Issues
Since some small aspects of the TrueType specification are covered by several patents owned by Apple Computer, Inc., it is generally not possible to render TrueType glyphs exactly as they should without infringing on Apple's IP rights (without a license).
This explains that we have taken some special measures to deal with this problem:
First of all, a default build of the FreeType 2 sources does not use any of the patented techniques to render TrueType glyphs. You are thus safe to use it freely in all kinds of projects.
Unfortunately, this freedom comes at the price of sometimes less than ideal glyph quality, depending on the font design, and most surely different glyph metrics for a given font.
In the case where you want the best TrueType glyph quality (for example, if you are in a country where the patent doesn't apply, or if you have a license from Apple), you simply have to toggle a single configuration macro before compiling and installing the library.
More information regarding this topic is available at our TrueType patents page. In case you would like to obtain a license from Apple, please contact their legal department, as we are unable to give you any information regarding its availability or pricing.

相關詞條

熱門詞條

聯絡我們