The Linux Foundation

 

Become an Individual Member

Freetype

From The Linux Foundation

Contents

libFreeType2

Description

From http://freetype.sourceforge.net/freetype2/index.html

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.

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.
  • 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.
  • 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
  • Type42 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 synthesizing 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.
  • FreeType2 includes a full-featured and efficient TrueType bytecode interpreter that can produce excellent output at small point sizes.
  • For those who don't need or want to use the bytecode interpreter for TrueType fonts, FreeType has developed an 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.

Requirements

FreeType 2 is written in industry-standard ANSI C and should compile easily with any compliant C compiler with no warnings.

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

Some parts of the TrueType specification are covered by patents owned by Apple Computer. A default build of the FreeType 2 sources will not use any of the patented techniques to render TrueType glyphs.

For more information, see: http://freetype.sourceforge.net/patents.html

Future Tracker

This library is tracked on futures here - http://www.linuxbase.org/futures/candidates/freetype/index.html

List of apps and libraries using this library

According to Keith Packard,

Essentially every current X application uses FreeType; it is the
standard font access mechanism for Gtk+, Qt, Mozilla and OpenOffice
based applications.
It is also used by the X server to rasterize outline fonts, and will
(someday) be used as the exclusive font access mechanism within the X
server as PCF and BDF format fonts are retired in favor of the more
efficient SFNT format.
It's hard to find a more central library within the system than FreeType
for desktop computing.

API documentation

There is a collection of papers documenting FreeType 2 at http://freetype.sourceforge.net/freetype2/documentation.html

API documentation can be found at http://freetype.sourceforge.net/freetype2/docs/reference/ft2-toc.html

Related test suites

There are no known test cases.

Library analysis data

Raw data included here: FreeTypeData.txt

Most commonly used interfaces

Any test suite should include all of the stable interfaces in the specification.

Validation and caching code should be excluded: According to an email from David Turner (freetype developer) the code for otvalid and gxvalid is experimental and the cache subsystem is considered to be "in beta."

Interfaces chosen for LSB

According to http://freetype.sourceforge.net/freetype2/docs/design/design-2.html applications primarily use the base layer API. This is the library that should be added to the specification first. Research also shows the Glyph library is popular and should be considered in the future.

According to an email from David Turner (freetype developer) the API has been stable since v 2.1.5 which was released 9/2/2003. (Note that the API for the beta caching subsystem is not stable.)

Base Layer
FT_Set_Char_Size8FT_Set_Pixel_Sizes8
FT_Load_Glyph16FT_Load_Char0
FT_STYLE_FLAG_XXX0FT_LOAD_XXX0
FT_Set_Transform8FT_Render_Mode0
ft_render_mode_xxx0FT_Render_Glyph11
FT_Kerning_Mode0ft_kerning_default0
FT_Init_FreeType16ft_kerning_unfitted0
FT_Library_Version0ft_kerning_unscaled0
FT_Done_FreeType11FT_Get_Kerning1
FT_OPEN_XXX0FT_Get_Glyph_Name0
FT_Parameter0FT_Get_Postscript_Name5
FT_Open_Args0FT_Select_Charmap6
FT_New_Face17FT_Set_Charmap7
FT_New_Memory_Face0FT_Get_Charmap_Index1
FT_Open_Face2FT_Get_Char_Index9
FT_Attach_File0FT_Get_First_Char0
FT_Attach_Stream0FT_Get_Next_Char0
FT_Done_Face17FT_Get_Name_Index8
Non Base Layer
FT_Activate_Size4
FT_Add_Default_Modules1
FT_Done_Glyph6
FT_Done_Library1
FT_Done_Size4
FT_Get_BDF_Charset_ID4
FT_Get_BDF_Property1
FT_Get_Glyph8
FT_Get_MM_Var1
FT_Get_PS_Font_Info6
FT_Get_Sfnt_Name8
FT_Get_Sfnt_Name_Count7
FT_Get_Sfnt_Table6
FT_Get_X11_Font_Format4
FT_Glyph_Copy1
FT_Glyph_Get_CBox1
FT_Glyph_Stroke1
FT_Glyph_To_Bitmap3
FT_Has_PS_Glyph_Names5
FT_MulDiv1
FT_MulFix4
FT_New_Library1
FT_New_Size6
FT_Outline_Decompose5
FT_Outline_Get_BBox4
FT_Set_Var_Design_Coordin1
FT_Stream_Pos4
FT_Stream_Seek4
FT_Stroker_Done1
FT_Stroker_New1
FT_Stroker_Set1
FT_Vector_Transform7

Other information

Uncategorized information goes here


[Article] [Discussion] [View source] [History]