FreeType API Reference

FreeType API Reference

Header File Macros

The following macros are defined to the name of specific FreeType 2 header files. They can be used directly in #include statements as in:

 
      #include FT_FREETYPE_H 
      #include FT_MULTIPLE_MASTERS_H 
      #include FT_GLYPH_H 

There are several reasons why we are now using macros to name public header files. The first one is that such macros are not limited to the infamous 8.3 naming rule required by DOS (and `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h').

The second reason is that is allows for more flexibility in the way FreeType 2 is installed on a given system.


FT_CONFIG_CONFIG_H


#ifndef FT_CONFIG_CONFIG_H
#define FT_CONFIG_CONFIG_H  <freetype/config/ftconfig.h>
#endif

A macro used in #include statements to name the file containing FreeType 2 configuration data.



FT_CONFIG_OPTIONS_H


#ifndef FT_CONFIG_OPTIONS_H
#define FT_CONFIG_OPTIONS_H  <freetype/config/ftoption.h>
#endif

A macro used in #include statements to name the file containing FreeType 2 project-specific configuration options.



FT_CONFIG_MODULES_H


#ifndef FT_CONFIG_MODULES_H
#define FT_CONFIG_MODULES_H  <freetype/config/ftmodule.h>
#endif

A macro used in #include statements to name the file containing the list of FreeType 2 modules that are statically linked to new library instances in FT_Init_FreeType .



FT_FREETYPE_H


#define FT_FREETYPE_H  <freetype/freetype.h>

A macro used in #include statements to name the file containing the base FreeType 2 API.



FT_ERRORS_H


#define FT_ERRORS_H  <freetype/fterrors.h>

A macro used in #include statements to name the file containing the list of FreeType 2 error codes (and messages).

It is included by FT_FREETYPE_H .



FT_MODULE_ERRORS_H


#define FT_MODULE_ERRORS_H  <freetype/ftmoderr.h>

A macro used in #include statements to name the file containing the list of FreeType 2 module error offsets (and messages).



FT_SYSTEM_H


#define FT_SYSTEM_H  <freetype/ftsystem.h>

A macro used in #include statements to name the file containing the FreeType 2 interface to low-level operations (i.e. memory management and stream i/o).

It is included by FT_FREETYPE_H .



FT_IMAGE_H


#define FT_IMAGE_H  <freetype/ftimage.h>

A macro used in #include statements to name the file containing types definitions related to glyph images (i.e. bitmaps, outlines, scan-converter parameters).

It is included by FT_FREETYPE_H .



FT_TYPES_H


#define FT_TYPES_H  <freetype/fttypes.h>

A macro used in #include statements to name the file containing the basic data types defined by FreeType 2.

It is included by FT_FREETYPE_H .



FT_LIST_H


#define FT_LIST_H  <freetype/ftlist.h>

A macro used in #include statements to name the file containing the list management API of FreeType 2.

(Most applications will never need to include this file.)



FT_OUTLINE_H


#define FT_OUTLINE_H  <freetype/ftoutln.h>

A macro used in #include statements to name the file containing the scalable outline management API of FreeType 2.



FT_SIZES_H


#define FT_SIZES_H  <freetype/ftsizes.h>

A macro used in #include statements to name the file containing the API used to manage multiple FT_Size objects per face.



FT_MODULE_H


#define FT_MODULE_H  <freetype/ftmodule.h>

A macro used in #include statements to name the file containing the module management API of FreeType 2.



FT_RENDER_H


#define FT_RENDER_H  <freetype/ftrender.h>

A macro used in #include statements to name the file containing the renderer module management API of FreeType 2.



FT_TYPE1_TABLES_H


#define FT_TYPE1_TABLES_H  <freetype/t1tables.h>

A macro used in #include statements to name the file containing the types and API specific to the Type 1 format.



FT_TRUETYPE_IDS_H


#define FT_TRUETYPE_IDS_H  <freetype/ttnameid.h>

A macro used in #include statements to name the file containing the enumeration values used to identify name strings, languages, encodings, etc. This file really contains a _large_ set of constant macro definitions, taken from the TrueType and OpenType specifications.



FT_TRUETYPE_TABLES_H


#define FT_TRUETYPE_TABLES_H  <freetype/tttables.h>

A macro used in #include statements to name the file containing the types and API specific to the TrueType (as well as OpenType) format.



FT_TRUETYPE_TAGS_H


#define FT_TRUETYPE_TAGS_H  <freetype/tttags.h>

A macro used in #include statements to name the file containing the definitions of TrueType 4-byte `tags' used to identify blocks in SFNT-based font formats (i.e. TrueType and OpenType).



FT_GLYPH_H


#define FT_GLYPH_H  <freetype/ftglyph.h>

A macro used in #include statements to name the file containing the API of the optional glyph management component.



FT_BBOX_H


#define FT_BBOX_H  <freetype/ftbbox.h>

A macro used in #include statements to name the file containing the API of the optional exact bounding box computation routines.



FT_BEZIER_H


#define FT_BEZIER_H  <freetype/ftbezier.h>

A macro used in #include statements to name the file containing a small useful API to handle bezier arcs. Note that you _must_ include FT_FREETYPE_H or FT_IMAGE_H before this header.



FT_CACHE_H


#define FT_CACHE_H  <freetype/ftcache.h>

A macro used in #include statements to name the file containing the API of the optional FreeType 2 cache sub-system.



FT_CACHE_IMAGE_H


#define FT_CACHE_IMAGE_H  <freetype/cache/ftcimage.h>

A macro used in #include statements to name the file containing the `glyph image' API of the FreeType 2 cache sub-system.

It is used to define a cache for FT_Glyph elements. You can also see the API defined in FT_CACHE_SMALL_BITMAPS_H if you only need to store small glyph bitmaps, as it will use less memory.



FT_CACHE_SMALL_BITMAPS_H


#define FT_CACHE_SMALL_BITMAPS_H  <freetype/cache/ftcsbits.h>

A macro used in #include statements to name the file containing the `small bitmaps' API of the FreeType 2 cache sub-system.

It is used to define a cache for small glyph bitmaps in a relatively memory-efficient way. You can also use the API defined in FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images, including scalable outlines.



FT_CACHE_CHARMAP_H


#define FT_CACHE_CHARMAP_H  <freetype/cache/ftccmap.h>

A macro used in #include statements to name the file containing the `charmap' API of the FreeType 2 cache sub-system.



FT_MAC_H


#define FT_MAC_H  <freetype/ftmac.h>

A macro used in #include statements to name the file containing the Macintosh-specific FreeType 2 API. The latter is used to access fonts embedded in resource forks.

This header file must be explicitly included by client applications compiled on the Mac (note that the base API still works though).



FT_MULTIPLE_MASTERS_H


#define FT_MULTIPLE_MASTERS_H  <freetype/ftmm.h>

A macro used in #include statements to name the file containing the optional multiple-masters management API of FreeType 2.



FT_SFNT_NAMES_H


#define FT_SFNT_NAMES_H  <freetype/ftsnames.h>

A macro used in #include statements to name the file containing the optional FreeType 2 API used to access embedded `name' strings in SFNT-based font formats (i.e. TrueType and OpenType).



FTC_CmapCache


  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;

An opaque handle used to manager a charmap cache. This cache is to hold character codes -> glyph indices mappings.



FTC_CMapDesc


  typedef struct FTC_CMapDescRec_*  FTC_CMapDesc;

A handle to an FTC_CMapDescRec structure used to describe a given charmap in a charmap cache.

Each FTC_CMapDesc describes which charmap (of which ?FTC_Face) we want to use in FTC_CMapCache_Lookup .



FTC_CMapType


  typedef enum  FTC_CMapType_
  {
    FTC_CMAP_BY_INDEX    = 0,
    FTC_CMAP_BY_ENCODING = 1,
    FTC_CMAP_BY_ID       = 2

  } FTC_CMapType;

The list of valid ?FTC_CMap types. They indicate how we want to address a charmap within an FTC_FaceID .


values
FTC_CMAP_BY_INDEX

Address a charmap by its index in the corresponding FT_Face .

FTC_CMAP_BY_ENCODING

Use a FT_Face charmap that corresponds to a given encoding.

FTC_CMAP_BY_ID

Use an FT_Face charmap that corresponds to a given (platform,encoding) ID. See FTC_CMapIdRec .


FTC_CMapIdRec


  typedef struct  FTC_CMapIdRec_
  {
    FT_UInt  platform;
    FT_UInt  encoding;

  } FTC_CMapIdRec;

A short structure to identify a charmap by a (platform,encoding) pair of values.


fields
platform

The platform ID.

encoding

The encoding ID.


FTC_CMapDescRec


  typedef struct  FTC_CMapDescRec_
  {
    FTC_FaceID    face_id;
    FTC_CMapType  type;

    union
    {
      FT_UInt        index;
      FT_Encoding    encoding;
      FTC_CMapIdRec  id;

    } u;

  } FTC_CMapDescRec;

A structure to describe a given charmap to ?FTC_CMapCache.


fields
face_id

FTC_FaceID of the face this charmap belongs to.

type

The type of charmap, see FTC_CMapType .

u.index

For ?FTC_CMAP_BY_INDEX types, this is the charmap index (within a FT_Face ) we want to use.

u.encoding

For ?FTC_CMAP_BY_ENCODING types, this is the charmap encoding we want to use. see FT_Encoding .

u.id

For ?FTC_CMAP_BY_ID types, this is the (platform,encoding) pair we want to use. see FTC_CMapIdRec and FT_CharMapRec .


FTC_CMapCache_New


  FT_EXPORT( FT_Error )
  FTC_CMapCache_New( FTC_Manager     manager,
                     FTC_CMapCache  *acache );

Creates a new charmap cache.


input
manager

A handle to the cache manager.

output
acache

A new cache handle. NULL in case of error.

return

FreeType error code. 0 means success.

note

Like all other caches, this one will be destroyed with the cache manager.


FTC_CMapCache_Lookup


  FT_EXPORT( FT_UInt )
  FTC_CMapCache_Lookup( FTC_CMapCache  cache,
                        FTC_CMapDesc   cmap_desc,
                        FT_UInt32      char_code );

Translates a character code into a glyph index, using the charmap cache.


input
cache

A charmap cache handle.

cmap_desc

A charmap descriptor handle.

char_code

The character code (in the corresponding charmap).

return

Glyph index. 0 means "no glyph".

note

This function doesn't return FTC_Node handles, since there is no real use for them with typical uses of charmaps.


generated on Mon Jan 07 13:06:52 2002