updated freetype to 2.4.8 on windows

This commit is contained in:
oy 2011-12-04 20:10:30 +01:00
parent 318d4e24b0
commit 2df6e0d04d
88 changed files with 31056 additions and 30655 deletions

View file

@ -1 +1 @@
2.4.4 2.4.8

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,32 +1,32 @@
/* /*
* This file registers the FreeType modules compiled into the library. * This file registers the FreeType modules compiled into the library.
* *
* If you use GNU make, this file IS NOT USED! Instead, it is created in * If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/') based on information * the objects directory (normally `<topdir>/objs/') based on information
* from `<topdir>/modules.cfg'. * from `<topdir>/modules.cfg'.
* *
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile * Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
* FreeType without GNU make. * FreeType without GNU make.
* *
*/ */
FT_USE_MODULE( FT_Module_Class, autofit_module_class ) FT_USE_MODULE( FT_Module_Class, autofit_module_class )
FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, tt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, t1_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, cff_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class ) FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class ) FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class ) FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class ) FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcd_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class ) FT_USE_MODULE( FT_Renderer_Class, ft_smooth_lcdv_renderer_class )
FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class ) FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
/* EOF */ /* EOF */

File diff suppressed because it is too large Load diff

View file

@ -1,173 +1,174 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftstdlib.h */ /* ftstdlib.h */
/* */ /* */
/* ANSI-specific library and header configuration file (specification */ /* ANSI-specific library and header configuration file (specification */
/* only). */ /* only). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2009 by */ /* Copyright 2002-2007, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This file is used to group all #includes to the ANSI C library that */ /* This file is used to group all #includes to the ANSI C library that */
/* FreeType normally requires. It also defines macros to rename the */ /* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */ /* standard functions within the FreeType source code. */
/* */ /* */
/* Load a file which defines __FTSTDLIB_H__ before this one to override */ /* Load a file which defines __FTSTDLIB_H__ before this one to override */
/* it. */ /* it. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTSTDLIB_H__ #ifndef __FTSTDLIB_H__
#define __FTSTDLIB_H__ #define __FTSTDLIB_H__
#include <stddef.h> #include <stddef.h>
#define ft_ptrdiff_t ptrdiff_t #define ft_ptrdiff_t ptrdiff_t
/**********************************************************************/ /**********************************************************************/
/* */ /* */
/* integer limits */ /* integer limits */
/* */ /* */
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */ /* UINT_MAX and ULONG_MAX are used to automatically compute the size */
/* of `int' and `long' in bytes at compile-time. So far, this works */ /* of `int' and `long' in bytes at compile-time. So far, this works */
/* for all platforms the library has been tested on. */ /* for all platforms the library has been tested on. */
/* */ /* */
/* Note that on the extremely rare platforms that do not provide */ /* Note that on the extremely rare platforms that do not provide */
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */ /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
/* old Crays where `int' is 36 bits), we do not make any guarantee */ /* old Crays where `int' is 36 bits), we do not make any guarantee */
/* about the correct behaviour of FT2 with all fonts. */ /* about the correct behaviour of FT2 with all fonts. */
/* */ /* */
/* In these case, `ftconfig.h' will refuse to compile anyway with a */ /* In these case, `ftconfig.h' will refuse to compile anyway with a */
/* message like `couldn't find 32-bit type' or something similar. */ /* message like `couldn't find 32-bit type' or something similar. */
/* */ /* */
/**********************************************************************/ /**********************************************************************/
#include <limits.h> #include <limits.h>
#define FT_CHAR_BIT CHAR_BIT #define FT_CHAR_BIT CHAR_BIT
#define FT_INT_MAX INT_MAX #define FT_USHORT_MAX USHRT_MAX
#define FT_INT_MIN INT_MIN #define FT_INT_MAX INT_MAX
#define FT_UINT_MAX UINT_MAX #define FT_INT_MIN INT_MIN
#define FT_ULONG_MAX ULONG_MAX #define FT_UINT_MAX UINT_MAX
#define FT_ULONG_MAX ULONG_MAX
/**********************************************************************/
/* */ /**********************************************************************/
/* character and string processing */ /* */
/* */ /* character and string processing */
/**********************************************************************/ /* */
/**********************************************************************/
#include <string.h>
#include <string.h>
#define ft_memchr memchr
#define ft_memcmp memcmp #define ft_memchr memchr
#define ft_memcpy memcpy #define ft_memcmp memcmp
#define ft_memmove memmove #define ft_memcpy memcpy
#define ft_memset memset #define ft_memmove memmove
#define ft_strcat strcat #define ft_memset memset
#define ft_strcmp strcmp #define ft_strcat strcat
#define ft_strcpy strcpy #define ft_strcmp strcmp
#define ft_strlen strlen #define ft_strcpy strcpy
#define ft_strncmp strncmp #define ft_strlen strlen
#define ft_strncpy strncpy #define ft_strncmp strncmp
#define ft_strrchr strrchr #define ft_strncpy strncpy
#define ft_strstr strstr #define ft_strrchr strrchr
#define ft_strstr strstr
/**********************************************************************/
/* */ /**********************************************************************/
/* file handling */ /* */
/* */ /* file handling */
/**********************************************************************/ /* */
/**********************************************************************/
#include <stdio.h>
#include <stdio.h>
#define FT_FILE FILE
#define ft_fclose fclose #define FT_FILE FILE
#define ft_fopen fopen #define ft_fclose fclose
#define ft_fread fread #define ft_fopen fopen
#define ft_fseek fseek #define ft_fread fread
#define ft_ftell ftell #define ft_fseek fseek
#define ft_sprintf sprintf #define ft_ftell ftell
#define ft_sprintf sprintf
/**********************************************************************/
/* */ /**********************************************************************/
/* sorting */ /* */
/* */ /* sorting */
/**********************************************************************/ /* */
/**********************************************************************/
#include <stdlib.h>
#include <stdlib.h>
#define ft_qsort qsort
#define ft_qsort qsort
/**********************************************************************/
/* */ /**********************************************************************/
/* memory allocation */ /* */
/* */ /* memory allocation */
/**********************************************************************/ /* */
/**********************************************************************/
#define ft_scalloc calloc
#define ft_sfree free #define ft_scalloc calloc
#define ft_smalloc malloc #define ft_sfree free
#define ft_srealloc realloc #define ft_smalloc malloc
#define ft_srealloc realloc
/**********************************************************************/
/* */ /**********************************************************************/
/* miscellaneous */ /* */
/* */ /* miscellaneous */
/**********************************************************************/ /* */
/**********************************************************************/
#define ft_atol atol
#define ft_labs labs #define ft_atol atol
#define ft_labs labs
/**********************************************************************/
/* */ /**********************************************************************/
/* execution control */ /* */
/* */ /* execution control */
/**********************************************************************/ /* */
/**********************************************************************/
#include <setjmp.h>
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* jmp_buf is defined as a macro */ #define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* on certain platforms */ /* jmp_buf is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */ #define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */
/* the following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */ /* the following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
#include <stdarg.h>
#include <stdarg.h>
#endif /* __FTSTDLIB_H__ */
#endif /* __FTSTDLIB_H__ */
/* END */
/* END */

File diff suppressed because it is too large Load diff

View file

@ -1,179 +1,179 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftadvanc.h */ /* ftadvanc.h */
/* */ /* */
/* Quick computation of advance widths (specification only). */ /* Quick computation of advance widths (specification only). */
/* */ /* */
/* Copyright 2008 by */ /* Copyright 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTADVANC_H__ #ifndef __FTADVANC_H__
#define __FTADVANC_H__ #define __FTADVANC_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/************************************************************************** /**************************************************************************
* *
* @section: * @section:
* quick_advance * quick_advance
* *
* @title: * @title:
* Quick retrieval of advance values * Quick retrieval of advance values
* *
* @abstract: * @abstract:
* Retrieve horizontal and vertical advance values without processing * Retrieve horizontal and vertical advance values without processing
* glyph outlines, if possible. * glyph outlines, if possible.
* *
* @description: * @description:
* This section contains functions to quickly extract advance values * This section contains functions to quickly extract advance values
* without handling glyph outlines, if possible. * without handling glyph outlines, if possible.
*/ */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Const> */ /* <Const> */
/* FT_ADVANCE_FLAG_FAST_ONLY */ /* FT_ADVANCE_FLAG_FAST_ONLY */
/* */ /* */
/* <Description> */ /* <Description> */
/* A bit-flag to be OR-ed with the `flags' parameter of the */ /* A bit-flag to be OR-ed with the `flags' parameter of the */
/* @FT_Get_Advance and @FT_Get_Advances functions. */ /* @FT_Get_Advance and @FT_Get_Advances functions. */
/* */ /* */
/* If set, it indicates that you want these functions to fail if the */ /* If set, it indicates that you want these functions to fail if the */
/* corresponding hinting mode or font driver doesn't allow for very */ /* corresponding hinting mode or font driver doesn't allow for very */
/* quick advance computation. */ /* quick advance computation. */
/* */ /* */
/* Typically, glyphs which are either unscaled, unhinted, bitmapped, */ /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */
/* or light-hinted can have their advance width computed very */ /* or light-hinted can have their advance width computed very */
/* quickly. */ /* quickly. */
/* */ /* */
/* Normal and bytecode hinted modes, which require loading, scaling, */ /* Normal and bytecode hinted modes, which require loading, scaling, */
/* and hinting of the glyph outline, are extremely slow by */ /* and hinting of the glyph outline, are extremely slow by */
/* comparison. */ /* comparison. */
/* */ /* */
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL #define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000UL
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_Advance */ /* FT_Get_Advance */
/* */ /* */
/* <Description> */ /* <Description> */
/* Retrieve the advance value of a given glyph outline in an */ /* Retrieve the advance value of a given glyph outline in an */
/* @FT_Face. By default, the unhinted advance is returned in font */ /* @FT_Face. By default, the unhinted advance is returned in font */
/* units. */ /* units. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: The source @FT_Face handle. */ /* face :: The source @FT_Face handle. */
/* */ /* */
/* gindex :: The glyph index. */ /* gindex :: The glyph index. */
/* */ /* */
/* load_flags :: A set of bit flags similar to those used when */ /* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph, used to determine what kind */ /* calling @FT_Load_Glyph, used to determine what kind */
/* of advances you need. */ /* of advances you need. */
/* <Output> */ /* <Output> */
/* padvance :: The advance value, in either font units or 16.16 */ /* padvance :: The advance value, in either font units or 16.16 */
/* format. */ /* format. */
/* */ /* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */ /* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
/* vertical advance corresponding to a vertical layout. */ /* vertical advance corresponding to a vertical layout. */
/* Otherwise, it is the horizontal advance in a */ /* Otherwise, it is the horizontal advance in a */
/* horizontal layout. */ /* horizontal layout. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */ /* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */ /* retrieve the advances. */
/* */ /* */
/* A scaled advance is returned in 16.16 format but isn't transformed */ /* A scaled advance is returned in 16.16 format but isn't transformed */
/* by the affine transformation specified by @FT_Set_Transform. */ /* by the affine transformation specified by @FT_Set_Transform. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_Advance( FT_Face face, FT_Get_Advance( FT_Face face,
FT_UInt gindex, FT_UInt gindex,
FT_Int32 load_flags, FT_Int32 load_flags,
FT_Fixed *padvance ); FT_Fixed *padvance );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_Advances */ /* FT_Get_Advances */
/* */ /* */
/* <Description> */ /* <Description> */
/* Retrieve the advance values of several glyph outlines in an */ /* Retrieve the advance values of several glyph outlines in an */
/* @FT_Face. By default, the unhinted advances are returned in font */ /* @FT_Face. By default, the unhinted advances are returned in font */
/* units. */ /* units. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: The source @FT_Face handle. */ /* face :: The source @FT_Face handle. */
/* */ /* */
/* start :: The first glyph index. */ /* start :: The first glyph index. */
/* */ /* */
/* count :: The number of advance values you want to retrieve. */ /* count :: The number of advance values you want to retrieve. */
/* */ /* */
/* load_flags :: A set of bit flags similar to those used when */ /* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph. */ /* calling @FT_Load_Glyph. */
/* */ /* */
/* <Output> */ /* <Output> */
/* padvance :: The advances, in either font units or 16.16 format. */ /* padvance :: The advances, in either font units or 16.16 format. */
/* This array must contain at least `count' elements. */ /* This array must contain at least `count' elements. */
/* */ /* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */ /* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
/* vertical advances corresponding to a vertical layout. */ /* vertical advances corresponding to a vertical layout. */
/* Otherwise, they are the horizontal advances in a */ /* Otherwise, they are the horizontal advances in a */
/* horizontal layout. */ /* horizontal layout. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */ /* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */ /* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */ /* retrieve the advances. */
/* */ /* */
/* Scaled advances are returned in 16.16 format but aren't */ /* Scaled advances are returned in 16.16 format but aren't */
/* transformed by the affine transformation specified by */ /* transformed by the affine transformation specified by */
/* @FT_Set_Transform. */ /* @FT_Set_Transform. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_Advances( FT_Face face, FT_Get_Advances( FT_Face face,
FT_UInt start, FT_UInt start,
FT_UInt count, FT_UInt count,
FT_Int32 load_flags, FT_Int32 load_flags,
FT_Fixed *padvances ); FT_Fixed *padvances );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTADVANC_H__ */ #endif /* __FTADVANC_H__ */
/* END */ /* END */

View file

@ -1,94 +1,102 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftbbox.h */ /* ftbbox.h */
/* */ /* */
/* FreeType exact bbox computation (specification). */ /* FreeType exact bbox computation (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2007 by */ /* Copyright 1996-2001, 2003, 2007, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This component has a _single_ role: to compute exact outline bounding */ /* This component has a _single_ role: to compute exact outline bounding */
/* boxes. */ /* boxes. */
/* */ /* */
/* It is separated from the rest of the engine for various technical */ /* It is separated from the rest of the engine for various technical */
/* reasons. It may well be integrated in `ftoutln' later. */ /* reasons. It may well be integrated in `ftoutln' later. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTBBOX_H__ #ifndef __FTBBOX_H__
#define __FTBBOX_H__ #define __FTBBOX_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* outline_processing */ /* outline_processing */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Outline_Get_BBox */ /* FT_Outline_Get_BBox */
/* */ /* */
/* <Description> */ /* <Description> */
/* Compute the exact bounding box of an outline. This is slower */ /* Compute the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */ /* than computing the control box. However, it uses an advanced */
/* algorithm which returns _very_ quickly when the two boxes */ /* algorithm which returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bézier arcs are traversed to */ /* coincide. Otherwise, the outline Bézier arcs are traversed to */
/* extract their extrema. */ /* extract their extrema. */
/* */ /* */
/* <Input> */ /* <Input> */
/* outline :: A pointer to the source outline. */ /* outline :: A pointer to the source outline. */
/* */ /* */
/* <Output> */ /* <Output> */
/* abbox :: The outline's exact bounding box. */ /* abbox :: The outline's exact bounding box. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) /* <Note> */
FT_Outline_Get_BBox( FT_Outline* outline, /* If the font is tricky and the glyph has been loaded with */
FT_BBox *abbox ); /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
/* reasonable values for the BBox it is necessary to load the glyph */
/* at a large ppem value (so that the hinting instructions can */
/* */ /* properly shift and scale the subglyphs), then extracting the BBox */
/* which can be eventually converted back to font units. */
/* */
FT_END_HEADER FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
#endif /* __FTBBOX_H__ */ FT_BBox *abbox );
/* END */ /* */
/* Local Variables: */ FT_END_HEADER
/* coding: utf-8 */
/* End: */ #endif /* __FTBBOX_H__ */
/* END */
/* Local Variables: */
/* coding: utf-8 */
/* End: */

View file

@ -1,209 +1,209 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftbdf.h */ /* ftbdf.h */
/* */ /* */
/* FreeType API for accessing BDF-specific strings (specification). */ /* FreeType API for accessing BDF-specific strings (specification). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2006, 2009 by */ /* Copyright 2002, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTBDF_H__ #ifndef __FTBDF_H__
#define __FTBDF_H__ #define __FTBDF_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* bdf_fonts */ /* bdf_fonts */
/* */ /* */
/* <Title> */ /* <Title> */
/* BDF and PCF Files */ /* BDF and PCF Files */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* BDF and PCF specific API. */ /* BDF and PCF specific API. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains the declaration of functions specific to BDF */ /* This section contains the declaration of functions specific to BDF */
/* and PCF fonts. */ /* and PCF fonts. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/********************************************************************** /**********************************************************************
* *
* @enum: * @enum:
* FT_PropertyType * FT_PropertyType
* *
* @description: * @description:
* A list of BDF property types. * A list of BDF property types.
* *
* @values: * @values:
* BDF_PROPERTY_TYPE_NONE :: * BDF_PROPERTY_TYPE_NONE ::
* Value~0 is used to indicate a missing property. * Value~0 is used to indicate a missing property.
* *
* BDF_PROPERTY_TYPE_ATOM :: * BDF_PROPERTY_TYPE_ATOM ::
* Property is a string atom. * Property is a string atom.
* *
* BDF_PROPERTY_TYPE_INTEGER :: * BDF_PROPERTY_TYPE_INTEGER ::
* Property is a 32-bit signed integer. * Property is a 32-bit signed integer.
* *
* BDF_PROPERTY_TYPE_CARDINAL :: * BDF_PROPERTY_TYPE_CARDINAL ::
* Property is a 32-bit unsigned integer. * Property is a 32-bit unsigned integer.
*/ */
typedef enum BDF_PropertyType_ typedef enum BDF_PropertyType_
{ {
BDF_PROPERTY_TYPE_NONE = 0, BDF_PROPERTY_TYPE_NONE = 0,
BDF_PROPERTY_TYPE_ATOM = 1, BDF_PROPERTY_TYPE_ATOM = 1,
BDF_PROPERTY_TYPE_INTEGER = 2, BDF_PROPERTY_TYPE_INTEGER = 2,
BDF_PROPERTY_TYPE_CARDINAL = 3 BDF_PROPERTY_TYPE_CARDINAL = 3
} BDF_PropertyType; } BDF_PropertyType;
/********************************************************************** /**********************************************************************
* *
* @type: * @type:
* BDF_Property * BDF_Property
* *
* @description: * @description:
* A handle to a @BDF_PropertyRec structure to model a given * A handle to a @BDF_PropertyRec structure to model a given
* BDF/PCF property. * BDF/PCF property.
*/ */
typedef struct BDF_PropertyRec_* BDF_Property; typedef struct BDF_PropertyRec_* BDF_Property;
/********************************************************************** /**********************************************************************
* *
* @struct: * @struct:
* BDF_PropertyRec * BDF_PropertyRec
* *
* @description: * @description:
* This structure models a given BDF/PCF property. * This structure models a given BDF/PCF property.
* *
* @fields: * @fields:
* type :: * type ::
* The property type. * The property type.
* *
* u.atom :: * u.atom ::
* The atom string, if type is @BDF_PROPERTY_TYPE_ATOM. * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
* *
* u.integer :: * u.integer ::
* A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER. * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
* *
* u.cardinal :: * u.cardinal ::
* An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL. * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
*/ */
typedef struct BDF_PropertyRec_ typedef struct BDF_PropertyRec_
{ {
BDF_PropertyType type; BDF_PropertyType type;
union { union {
const char* atom; const char* atom;
FT_Int32 integer; FT_Int32 integer;
FT_UInt32 cardinal; FT_UInt32 cardinal;
} u; } u;
} BDF_PropertyRec; } BDF_PropertyRec;
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_BDF_Charset_ID * FT_Get_BDF_Charset_ID
* *
* @description: * @description:
* Retrieve a BDF font character set identity, according to * Retrieve a BDF font character set identity, according to
* the BDF specification. * the BDF specification.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* @output: * @output:
* acharset_encoding :: * acharset_encoding ::
* Charset encoding, as a C~string, owned by the face. * Charset encoding, as a C~string, owned by the face.
* *
* acharset_registry :: * acharset_registry ::
* Charset registry, as a C~string, owned by the face. * Charset registry, as a C~string, owned by the face.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with BDF faces, returning an error otherwise. * This function only works with BDF faces, returning an error otherwise.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_BDF_Charset_ID( FT_Face face, FT_Get_BDF_Charset_ID( FT_Face face,
const char* *acharset_encoding, const char* *acharset_encoding,
const char* *acharset_registry ); const char* *acharset_registry );
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_BDF_Property * FT_Get_BDF_Property
* *
* @description: * @description:
* Retrieve a BDF property from a BDF or PCF font file. * Retrieve a BDF property from a BDF or PCF font file.
* *
* @input: * @input:
* face :: A handle to the input face. * face :: A handle to the input face.
* *
* name :: The property name. * name :: The property name.
* *
* @output: * @output:
* aproperty :: The property. * aproperty :: The property.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function works with BDF _and_ PCF fonts. It returns an error * This function works with BDF _and_ PCF fonts. It returns an error
* otherwise. It also returns an error if the property is not in the * otherwise. It also returns an error if the property is not in the
* font. * font.
* *
* A `property' is a either key-value pair within the STARTPROPERTIES * A `property' is a either key-value pair within the STARTPROPERTIES
* ... ENDPROPERTIES block of a BDF font or a key-value pair from the * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
* `info->props' array within a `FontRec' structure of a PCF font. * `info->props' array within a `FontRec' structure of a PCF font.
* *
* Integer properties are always stored as `signed' within PCF fonts; * Integer properties are always stored as `signed' within PCF fonts;
* consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
* for BDF fonts only. * for BDF fonts only.
* *
* In case of error, `aproperty->type' is always set to * In case of error, `aproperty->type' is always set to
* @BDF_PROPERTY_TYPE_NONE. * @BDF_PROPERTY_TYPE_NONE.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_BDF_Property( FT_Face face, FT_Get_BDF_Property( FT_Face face,
const char* prop_name, const char* prop_name,
BDF_PropertyRec *aproperty ); BDF_PropertyRec *aproperty );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTBDF_H__ */ #endif /* __FTBDF_H__ */
/* END */ /* END */

View file

@ -1,227 +1,227 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftbitmap.h */ /* ftbitmap.h */
/* */ /* */
/* FreeType utility functions for bitmaps (specification). */ /* FreeType utility functions for bitmaps (specification). */
/* */ /* */
/* Copyright 2004, 2005, 2006, 2008 by */ /* Copyright 2004, 2005, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTBITMAP_H__ #ifndef __FTBITMAP_H__
#define __FTBITMAP_H__ #define __FTBITMAP_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* bitmap_handling */ /* bitmap_handling */
/* */ /* */
/* <Title> */ /* <Title> */
/* Bitmap Handling */ /* Bitmap Handling */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Handling FT_Bitmap objects. */ /* Handling FT_Bitmap objects. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains functions for converting FT_Bitmap objects. */ /* This section contains functions for converting FT_Bitmap objects. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Bitmap_New */ /* FT_Bitmap_New */
/* */ /* */
/* <Description> */ /* <Description> */
/* Initialize a pointer to an @FT_Bitmap structure. */ /* Initialize a pointer to an @FT_Bitmap structure. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* abitmap :: A pointer to the bitmap structure. */ /* abitmap :: A pointer to the bitmap structure. */
/* */ /* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Bitmap_New( FT_Bitmap *abitmap ); FT_Bitmap_New( FT_Bitmap *abitmap );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Bitmap_Copy */ /* FT_Bitmap_Copy */
/* */ /* */
/* <Description> */ /* <Description> */
/* Copy a bitmap into another one. */ /* Copy a bitmap into another one. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to a library object. */ /* library :: A handle to a library object. */
/* */ /* */
/* source :: A handle to the source bitmap. */ /* source :: A handle to the source bitmap. */
/* */ /* */
/* <Output> */ /* <Output> */
/* target :: A handle to the target bitmap. */ /* target :: A handle to the target bitmap. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Bitmap_Copy( FT_Library library, FT_Bitmap_Copy( FT_Library library,
const FT_Bitmap *source, const FT_Bitmap *source,
FT_Bitmap *target); FT_Bitmap *target);
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Bitmap_Embolden */ /* FT_Bitmap_Embolden */
/* */ /* */
/* <Description> */ /* <Description> */
/* Embolden a bitmap. The new bitmap will be about `xStrength' */ /* Embolden a bitmap. The new bitmap will be about `xStrength' */
/* pixels wider and `yStrength' pixels higher. The left and bottom */ /* pixels wider and `yStrength' pixels higher. The left and bottom */
/* borders are kept unchanged. */ /* borders are kept unchanged. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to a library object. */ /* library :: A handle to a library object. */
/* */ /* */
/* xStrength :: How strong the glyph is emboldened horizontally. */ /* xStrength :: How strong the glyph is emboldened horizontally. */
/* Expressed in 26.6 pixel format. */ /* Expressed in 26.6 pixel format. */
/* */ /* */
/* yStrength :: How strong the glyph is emboldened vertically. */ /* yStrength :: How strong the glyph is emboldened vertically. */
/* Expressed in 26.6 pixel format. */ /* Expressed in 26.6 pixel format. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* bitmap :: A handle to the target bitmap. */ /* bitmap :: A handle to the target bitmap. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The current implementation restricts `xStrength' to be less than */ /* The current implementation restricts `xStrength' to be less than */
/* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */ /* or equal to~8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO. */
/* */ /* */
/* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */ /* If you want to embolden the bitmap owned by a @FT_GlyphSlotRec, */
/* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */ /* you should call @FT_GlyphSlot_Own_Bitmap on the slot first. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Bitmap_Embolden( FT_Library library, FT_Bitmap_Embolden( FT_Library library,
FT_Bitmap* bitmap, FT_Bitmap* bitmap,
FT_Pos xStrength, FT_Pos xStrength,
FT_Pos yStrength ); FT_Pos yStrength );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Bitmap_Convert */ /* FT_Bitmap_Convert */
/* */ /* */
/* <Description> */ /* <Description> */
/* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */ /* Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a */
/* bitmap object with depth 8bpp, making the number of used bytes per */ /* bitmap object with depth 8bpp, making the number of used bytes per */
/* line (a.k.a. the `pitch') a multiple of `alignment'. */ /* line (a.k.a. the `pitch') a multiple of `alignment'. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to a library object. */ /* library :: A handle to a library object. */
/* */ /* */
/* source :: The source bitmap. */ /* source :: The source bitmap. */
/* */ /* */
/* alignment :: The pitch of the bitmap is a multiple of this */ /* alignment :: The pitch of the bitmap is a multiple of this */
/* parameter. Common values are 1, 2, or 4. */ /* parameter. Common values are 1, 2, or 4. */
/* */ /* */
/* <Output> */ /* <Output> */
/* target :: The target bitmap. */ /* target :: The target bitmap. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* It is possible to call @FT_Bitmap_Convert multiple times without */ /* It is possible to call @FT_Bitmap_Convert multiple times without */
/* calling @FT_Bitmap_Done (the memory is simply reallocated). */ /* calling @FT_Bitmap_Done (the memory is simply reallocated). */
/* */ /* */
/* Use @FT_Bitmap_Done to finally remove the bitmap object. */ /* Use @FT_Bitmap_Done to finally remove the bitmap object. */
/* */ /* */
/* The `library' argument is taken to have access to FreeType's */ /* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */ /* memory handling functions. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Bitmap_Convert( FT_Library library, FT_Bitmap_Convert( FT_Library library,
const FT_Bitmap *source, const FT_Bitmap *source,
FT_Bitmap *target, FT_Bitmap *target,
FT_Int alignment ); FT_Int alignment );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_GlyphSlot_Own_Bitmap */ /* FT_GlyphSlot_Own_Bitmap */
/* */ /* */
/* <Description> */ /* <Description> */
/* Make sure that a glyph slot owns `slot->bitmap'. */ /* Make sure that a glyph slot owns `slot->bitmap'. */
/* */ /* */
/* <Input> */ /* <Input> */
/* slot :: The glyph slot. */ /* slot :: The glyph slot. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This function is to be used in combination with */ /* This function is to be used in combination with */
/* @FT_Bitmap_Embolden. */ /* @FT_Bitmap_Embolden. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot ); FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot slot );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Bitmap_Done */ /* FT_Bitmap_Done */
/* */ /* */
/* <Description> */ /* <Description> */
/* Destroy a bitmap object created with @FT_Bitmap_New. */ /* Destroy a bitmap object created with @FT_Bitmap_New. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to a library object. */ /* library :: A handle to a library object. */
/* */ /* */
/* bitmap :: The bitmap object to be freed. */ /* bitmap :: The bitmap object to be freed. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The `library' argument is taken to have access to FreeType's */ /* The `library' argument is taken to have access to FreeType's */
/* memory handling functions. */ /* memory handling functions. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Bitmap_Done( FT_Library library, FT_Bitmap_Done( FT_Library library,
FT_Bitmap *bitmap ); FT_Bitmap *bitmap );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTBITMAP_H__ */ #endif /* __FTBITMAP_H__ */
/* END */ /* END */

View file

@ -0,0 +1,102 @@
/***************************************************************************/
/* */
/* ftbzip2.h */
/* */
/* Bzip2-compressed stream support. */
/* */
/* Copyright 2010 by */
/* Joel Klinghed. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __FTBZIP2_H__
#define __FTBZIP2_H__
#include <ft2build.h>
#include FT_FREETYPE_H
#ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first."
#endif
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* bzip2 */
/* */
/* <Title> */
/* BZIP2 Streams */
/* */
/* <Abstract> */
/* Using bzip2-compressed font files. */
/* */
/* <Description> */
/* This section contains the declaration of Bzip2-specific functions. */
/* */
/*************************************************************************/
/************************************************************************
*
* @function:
* FT_Stream_OpenBzip2
*
* @description:
* Open a new stream to parse bzip2-compressed font files. This is
* mainly used to support the compressed `*.pcf.bz2' fonts that come
* with XFree86.
*
* @input:
* stream ::
* The target embedding stream.
*
* source ::
* The source stream.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* The source stream must be opened _before_ calling this function.
*
* Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap.
*
* The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream.
*
* In certain builds of the library, bzip2 compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a bzip2 compressed stream
* from it and re-open the face with it.
*
* This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with bzip2 support.
*/
FT_EXPORT( FT_Error )
FT_Stream_OpenBzip2( FT_Stream stream,
FT_Stream source );
/* */
FT_END_HEADER
#endif /* __FTBZIP2_H__ */
/* END */

File diff suppressed because it is too large Load diff

View file

@ -1,103 +1,104 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* This file defines the structure of the FreeType reference. */ /* This file defines the structure of the FreeType reference. */
/* It is used by the python script which generates the HTML files. */ /* It is used by the python script which generates the HTML files. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* <Chapter> */ /* <Chapter> */
/* general_remarks */ /* general_remarks */
/* */ /* */
/* <Title> */ /* <Title> */
/* General Remarks */ /* General Remarks */
/* */ /* */
/* <Sections> */ /* <Sections> */
/* user_allocation */ /* user_allocation */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* <Chapter> */ /* <Chapter> */
/* core_api */ /* core_api */
/* */ /* */
/* <Title> */ /* <Title> */
/* Core API */ /* Core API */
/* */ /* */
/* <Sections> */ /* <Sections> */
/* version */ /* version */
/* basic_types */ /* basic_types */
/* base_interface */ /* base_interface */
/* glyph_variants */ /* glyph_variants */
/* glyph_management */ /* glyph_management */
/* mac_specific */ /* mac_specific */
/* sizes_management */ /* sizes_management */
/* header_file_macros */ /* header_file_macros */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* <Chapter> */ /* <Chapter> */
/* format_specific */ /* format_specific */
/* */ /* */
/* <Title> */ /* <Title> */
/* Format-Specific API */ /* Format-Specific API */
/* */ /* */
/* <Sections> */ /* <Sections> */
/* multiple_masters */ /* multiple_masters */
/* truetype_tables */ /* truetype_tables */
/* type1_tables */ /* type1_tables */
/* sfnt_names */ /* sfnt_names */
/* bdf_fonts */ /* bdf_fonts */
/* cid_fonts */ /* cid_fonts */
/* pfr_fonts */ /* pfr_fonts */
/* winfnt_fonts */ /* winfnt_fonts */
/* font_formats */ /* font_formats */
/* gasp_table */ /* gasp_table */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* <Chapter> */ /* <Chapter> */
/* cache_subsystem */ /* cache_subsystem */
/* */ /* */
/* <Title> */ /* <Title> */
/* Cache Sub-System */ /* Cache Sub-System */
/* */ /* */
/* <Sections> */ /* <Sections> */
/* cache_subsystem */ /* cache_subsystem */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* <Chapter> */ /* <Chapter> */
/* support_api */ /* support_api */
/* */ /* */
/* <Title> */ /* <Title> */
/* Support API */ /* Support API */
/* */ /* */
/* <Sections> */ /* <Sections> */
/* computations */ /* computations */
/* list_processing */ /* list_processing */
/* outline_processing */ /* outline_processing */
/* quick_advance */ /* quick_advance */
/* bitmap_handling */ /* bitmap_handling */
/* raster */ /* raster */
/* glyph_stroker */ /* glyph_stroker */
/* system_interface */ /* system_interface */
/* module_management */ /* module_management */
/* gzip */ /* gzip */
/* lzw */ /* lzw */
/* lcd_filtering */ /* bzip2 */
/* */ /* lcd_filtering */
/***************************************************************************/ /* */
/***************************************************************************/

View file

@ -1,166 +1,166 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftcid.h */ /* ftcid.h */
/* */ /* */
/* FreeType API for accessing CID font information (specification). */ /* FreeType API for accessing CID font information (specification). */
/* */ /* */
/* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */ /* Copyright 2007, 2009 by Dereg Clegg, Michael Toftdal. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTCID_H__ #ifndef __FTCID_H__
#define __FTCID_H__ #define __FTCID_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* cid_fonts */ /* cid_fonts */
/* */ /* */
/* <Title> */ /* <Title> */
/* CID Fonts */ /* CID Fonts */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* CID-keyed font specific API. */ /* CID-keyed font specific API. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains the declaration of CID-keyed font specific */ /* This section contains the declaration of CID-keyed font specific */
/* functions. */ /* functions. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_CID_Registry_Ordering_Supplement * FT_Get_CID_Registry_Ordering_Supplement
* *
* @description: * @description:
* Retrieve the Registry/Ordering/Supplement triple (also known as the * Retrieve the Registry/Ordering/Supplement triple (also known as the
* "R/O/S") from a CID-keyed font. * "R/O/S") from a CID-keyed font.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* @output: * @output:
* registry :: * registry ::
* The registry, as a C~string, owned by the face. * The registry, as a C~string, owned by the face.
* *
* ordering :: * ordering ::
* The ordering, as a C~string, owned by the face. * The ordering, as a C~string, owned by the face.
* *
* supplement :: * supplement ::
* The supplement. * The supplement.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with CID faces, returning an error * This function only works with CID faces, returning an error
* otherwise. * otherwise.
* *
* @since: * @since:
* 2.3.6 * 2.3.6
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_CID_Registry_Ordering_Supplement( FT_Face face, FT_Get_CID_Registry_Ordering_Supplement( FT_Face face,
const char* *registry, const char* *registry,
const char* *ordering, const char* *ordering,
FT_Int *supplement); FT_Int *supplement);
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_CID_Is_Internally_CID_Keyed * FT_Get_CID_Is_Internally_CID_Keyed
* *
* @description: * @description:
* Retrieve the type of the input face, CID keyed or not. In * Retrieve the type of the input face, CID keyed or not. In
* constrast to the @FT_IS_CID_KEYED macro this function returns * constrast to the @FT_IS_CID_KEYED macro this function returns
* successfully also for CID-keyed fonts in an SNFT wrapper. * successfully also for CID-keyed fonts in an SNFT wrapper.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* @output: * @output:
* is_cid :: * is_cid ::
* The type of the face as an @FT_Bool. * The type of the face as an @FT_Bool.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with CID faces and OpenType fonts, * This function only works with CID faces and OpenType fonts,
* returning an error otherwise. * returning an error otherwise.
* *
* @since: * @since:
* 2.3.9 * 2.3.9
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face, FT_Get_CID_Is_Internally_CID_Keyed( FT_Face face,
FT_Bool *is_cid ); FT_Bool *is_cid );
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_CID_From_Glyph_Index * FT_Get_CID_From_Glyph_Index
* *
* @description: * @description:
* Retrieve the CID of the input glyph index. * Retrieve the CID of the input glyph index.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* glyph_index :: * glyph_index ::
* The input glyph index. * The input glyph index.
* *
* @output: * @output:
* cid :: * cid ::
* The CID as an @FT_UInt. * The CID as an @FT_UInt.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with CID faces and OpenType fonts, * This function only works with CID faces and OpenType fonts,
* returning an error otherwise. * returning an error otherwise.
* *
* @since: * @since:
* 2.3.9 * 2.3.9
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_CID_From_Glyph_Index( FT_Face face, FT_Get_CID_From_Glyph_Index( FT_Face face,
FT_UInt glyph_index, FT_UInt glyph_index,
FT_UInt *cid ); FT_UInt *cid );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTCID_H__ */ #endif /* __FTCID_H__ */
/* END */ /* END */

View file

@ -1,244 +1,243 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* fterrdef.h */ /* fterrdef.h */
/* */ /* */
/* FreeType error codes (specification). */ /* FreeType error codes (specification). */
/* */ /* */
/* Copyright 2002, 2004, 2006, 2007, 2010 by */ /* Copyright 2002, 2004, 2006, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
/***** LIST OF ERROR CODES/MESSAGES *****/ /***** LIST OF ERROR CODES/MESSAGES *****/
/***** *****/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */ /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */
/* including this file. */ /* including this file. */
/* generic errors */ /* generic errors */
FT_NOERRORDEF_( Ok, 0x00, \ FT_NOERRORDEF_( Ok, 0x00, \
"no error" ) "no error" )
FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \ FT_ERRORDEF_( Cannot_Open_Resource, 0x01, \
"cannot open resource" ) "cannot open resource" )
FT_ERRORDEF_( Unknown_File_Format, 0x02, \ FT_ERRORDEF_( Unknown_File_Format, 0x02, \
"unknown file format" ) "unknown file format" )
FT_ERRORDEF_( Invalid_File_Format, 0x03, \ FT_ERRORDEF_( Invalid_File_Format, 0x03, \
"broken file" ) "broken file" )
FT_ERRORDEF_( Invalid_Version, 0x04, \ FT_ERRORDEF_( Invalid_Version, 0x04, \
"invalid FreeType version" ) "invalid FreeType version" )
FT_ERRORDEF_( Lower_Module_Version, 0x05, \ FT_ERRORDEF_( Lower_Module_Version, 0x05, \
"module version is too low" ) "module version is too low" )
FT_ERRORDEF_( Invalid_Argument, 0x06, \ FT_ERRORDEF_( Invalid_Argument, 0x06, \
"invalid argument" ) "invalid argument" )
FT_ERRORDEF_( Unimplemented_Feature, 0x07, \ FT_ERRORDEF_( Unimplemented_Feature, 0x07, \
"unimplemented feature" ) "unimplemented feature" )
FT_ERRORDEF_( Invalid_Table, 0x08, \ FT_ERRORDEF_( Invalid_Table, 0x08, \
"broken table" ) "broken table" )
FT_ERRORDEF_( Invalid_Offset, 0x09, \ FT_ERRORDEF_( Invalid_Offset, 0x09, \
"broken offset within table" ) "broken offset within table" )
FT_ERRORDEF_( Array_Too_Large, 0x0A, \ FT_ERRORDEF_( Array_Too_Large, 0x0A, \
"array allocation size too large" ) "array allocation size too large" )
/* glyph/character errors */ /* glyph/character errors */
FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \ FT_ERRORDEF_( Invalid_Glyph_Index, 0x10, \
"invalid glyph index" ) "invalid glyph index" )
FT_ERRORDEF_( Invalid_Character_Code, 0x11, \ FT_ERRORDEF_( Invalid_Character_Code, 0x11, \
"invalid character code" ) "invalid character code" )
FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \ FT_ERRORDEF_( Invalid_Glyph_Format, 0x12, \
"unsupported glyph image format" ) "unsupported glyph image format" )
FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \ FT_ERRORDEF_( Cannot_Render_Glyph, 0x13, \
"cannot render this glyph format" ) "cannot render this glyph format" )
FT_ERRORDEF_( Invalid_Outline, 0x14, \ FT_ERRORDEF_( Invalid_Outline, 0x14, \
"invalid outline" ) "invalid outline" )
FT_ERRORDEF_( Invalid_Composite, 0x15, \ FT_ERRORDEF_( Invalid_Composite, 0x15, \
"invalid composite glyph" ) "invalid composite glyph" )
FT_ERRORDEF_( Too_Many_Hints, 0x16, \ FT_ERRORDEF_( Too_Many_Hints, 0x16, \
"too many hints" ) "too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \ FT_ERRORDEF_( Invalid_Pixel_Size, 0x17, \
"invalid pixel size" ) "invalid pixel size" )
/* handle errors */ /* handle errors */
FT_ERRORDEF_( Invalid_Handle, 0x20, \ FT_ERRORDEF_( Invalid_Handle, 0x20, \
"invalid object handle" ) "invalid object handle" )
FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \ FT_ERRORDEF_( Invalid_Library_Handle, 0x21, \
"invalid library handle" ) "invalid library handle" )
FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \ FT_ERRORDEF_( Invalid_Driver_Handle, 0x22, \
"invalid module handle" ) "invalid module handle" )
FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \ FT_ERRORDEF_( Invalid_Face_Handle, 0x23, \
"invalid face handle" ) "invalid face handle" )
FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \ FT_ERRORDEF_( Invalid_Size_Handle, 0x24, \
"invalid size handle" ) "invalid size handle" )
FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \ FT_ERRORDEF_( Invalid_Slot_Handle, 0x25, \
"invalid glyph slot handle" ) "invalid glyph slot handle" )
FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \ FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26, \
"invalid charmap handle" ) "invalid charmap handle" )
FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \ FT_ERRORDEF_( Invalid_Cache_Handle, 0x27, \
"invalid cache manager handle" ) "invalid cache manager handle" )
FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \ FT_ERRORDEF_( Invalid_Stream_Handle, 0x28, \
"invalid stream handle" ) "invalid stream handle" )
/* driver errors */ /* driver errors */
FT_ERRORDEF_( Too_Many_Drivers, 0x30, \ FT_ERRORDEF_( Too_Many_Drivers, 0x30, \
"too many modules" ) "too many modules" )
FT_ERRORDEF_( Too_Many_Extensions, 0x31, \ FT_ERRORDEF_( Too_Many_Extensions, 0x31, \
"too many extensions" ) "too many extensions" )
/* memory errors */ /* memory errors */
FT_ERRORDEF_( Out_Of_Memory, 0x40, \ FT_ERRORDEF_( Out_Of_Memory, 0x40, \
"out of memory" ) "out of memory" )
FT_ERRORDEF_( Unlisted_Object, 0x41, \ FT_ERRORDEF_( Unlisted_Object, 0x41, \
"unlisted object" ) "unlisted object" )
/* stream errors */ /* stream errors */
FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \ FT_ERRORDEF_( Cannot_Open_Stream, 0x51, \
"cannot open stream" ) "cannot open stream" )
FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \ FT_ERRORDEF_( Invalid_Stream_Seek, 0x52, \
"invalid stream seek" ) "invalid stream seek" )
FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \ FT_ERRORDEF_( Invalid_Stream_Skip, 0x53, \
"invalid stream skip" ) "invalid stream skip" )
FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \ FT_ERRORDEF_( Invalid_Stream_Read, 0x54, \
"invalid stream read" ) "invalid stream read" )
FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \ FT_ERRORDEF_( Invalid_Stream_Operation, 0x55, \
"invalid stream operation" ) "invalid stream operation" )
FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \ FT_ERRORDEF_( Invalid_Frame_Operation, 0x56, \
"invalid frame operation" ) "invalid frame operation" )
FT_ERRORDEF_( Nested_Frame_Access, 0x57, \ FT_ERRORDEF_( Nested_Frame_Access, 0x57, \
"nested frame access" ) "nested frame access" )
FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \ FT_ERRORDEF_( Invalid_Frame_Read, 0x58, \
"invalid frame read" ) "invalid frame read" )
/* raster errors */ /* raster errors */
FT_ERRORDEF_( Raster_Uninitialized, 0x60, \ FT_ERRORDEF_( Raster_Uninitialized, 0x60, \
"raster uninitialized" ) "raster uninitialized" )
FT_ERRORDEF_( Raster_Corrupted, 0x61, \ FT_ERRORDEF_( Raster_Corrupted, 0x61, \
"raster corrupted" ) "raster corrupted" )
FT_ERRORDEF_( Raster_Overflow, 0x62, \ FT_ERRORDEF_( Raster_Overflow, 0x62, \
"raster overflow" ) "raster overflow" )
FT_ERRORDEF_( Raster_Negative_Height, 0x63, \ FT_ERRORDEF_( Raster_Negative_Height, 0x63, \
"negative height while rastering" ) "negative height while rastering" )
/* cache errors */ /* cache errors */
FT_ERRORDEF_( Too_Many_Caches, 0x70, \ FT_ERRORDEF_( Too_Many_Caches, 0x70, \
"too many registered caches" ) "too many registered caches" )
/* TrueType and SFNT errors */ /* TrueType and SFNT errors */
FT_ERRORDEF_( Invalid_Opcode, 0x80, \ FT_ERRORDEF_( Invalid_Opcode, 0x80, \
"invalid opcode" ) "invalid opcode" )
FT_ERRORDEF_( Too_Few_Arguments, 0x81, \ FT_ERRORDEF_( Too_Few_Arguments, 0x81, \
"too few arguments" ) "too few arguments" )
FT_ERRORDEF_( Stack_Overflow, 0x82, \ FT_ERRORDEF_( Stack_Overflow, 0x82, \
"stack overflow" ) "stack overflow" )
FT_ERRORDEF_( Code_Overflow, 0x83, \ FT_ERRORDEF_( Code_Overflow, 0x83, \
"code overflow" ) "code overflow" )
FT_ERRORDEF_( Bad_Argument, 0x84, \ FT_ERRORDEF_( Bad_Argument, 0x84, \
"bad argument" ) "bad argument" )
FT_ERRORDEF_( Divide_By_Zero, 0x85, \ FT_ERRORDEF_( Divide_By_Zero, 0x85, \
"division by zero" ) "division by zero" )
FT_ERRORDEF_( Invalid_Reference, 0x86, \ FT_ERRORDEF_( Invalid_Reference, 0x86, \
"invalid reference" ) "invalid reference" )
FT_ERRORDEF_( Debug_OpCode, 0x87, \ FT_ERRORDEF_( Debug_OpCode, 0x87, \
"found debug opcode" ) "found debug opcode" )
FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \ FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88, \
"found ENDF opcode in execution stream" ) "found ENDF opcode in execution stream" )
FT_ERRORDEF_( Nested_DEFS, 0x89, \ FT_ERRORDEF_( Nested_DEFS, 0x89, \
"nested DEFS" ) "nested DEFS" )
FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \ FT_ERRORDEF_( Invalid_CodeRange, 0x8A, \
"invalid code range" ) "invalid code range" )
FT_ERRORDEF_( Execution_Too_Long, 0x8B, \ FT_ERRORDEF_( Execution_Too_Long, 0x8B, \
"execution context too long" ) "execution context too long" )
FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \ FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C, \
"too many function definitions" ) "too many function definitions" )
FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \ FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D, \
"too many instruction definitions" ) "too many instruction definitions" )
FT_ERRORDEF_( Table_Missing, 0x8E, \ FT_ERRORDEF_( Table_Missing, 0x8E, \
"SFNT font table missing" ) "SFNT font table missing" )
FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \ FT_ERRORDEF_( Horiz_Header_Missing, 0x8F, \
"horizontal header (hhea) table missing" ) "horizontal header (hhea) table missing" )
FT_ERRORDEF_( Locations_Missing, 0x90, \ FT_ERRORDEF_( Locations_Missing, 0x90, \
"locations (loca) table missing" ) "locations (loca) table missing" )
FT_ERRORDEF_( Name_Table_Missing, 0x91, \ FT_ERRORDEF_( Name_Table_Missing, 0x91, \
"name table missing" ) "name table missing" )
FT_ERRORDEF_( CMap_Table_Missing, 0x92, \ FT_ERRORDEF_( CMap_Table_Missing, 0x92, \
"character map (cmap) table missing" ) "character map (cmap) table missing" )
FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \ FT_ERRORDEF_( Hmtx_Table_Missing, 0x93, \
"horizontal metrics (hmtx) table missing" ) "horizontal metrics (hmtx) table missing" )
FT_ERRORDEF_( Post_Table_Missing, 0x94, \ FT_ERRORDEF_( Post_Table_Missing, 0x94, \
"PostScript (post) table missing" ) "PostScript (post) table missing" )
FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \ FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95, \
"invalid horizontal metrics" ) "invalid horizontal metrics" )
FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \ FT_ERRORDEF_( Invalid_CharMap_Format, 0x96, \
"invalid character map (cmap) format" ) "invalid character map (cmap) format" )
FT_ERRORDEF_( Invalid_PPem, 0x97, \ FT_ERRORDEF_( Invalid_PPem, 0x97, \
"invalid ppem value" ) "invalid ppem value" )
FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \ FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98, \
"invalid vertical metrics" ) "invalid vertical metrics" )
FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \ FT_ERRORDEF_( Could_Not_Find_Context, 0x99, \
"could not find context" ) "could not find context" )
FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \ FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A, \
"invalid PostScript (post) table format" ) "invalid PostScript (post) table format" )
FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \ FT_ERRORDEF_( Invalid_Post_Table, 0x9B, \
"invalid PostScript (post) table" ) "invalid PostScript (post) table" )
/* CFF, CID, and Type 1 errors */ /* CFF, CID, and Type 1 errors */
FT_ERRORDEF_( Syntax_Error, 0xA0, \ FT_ERRORDEF_( Syntax_Error, 0xA0, \
"opcode syntax error" ) "opcode syntax error" )
FT_ERRORDEF_( Stack_Underflow, 0xA1, \ FT_ERRORDEF_( Stack_Underflow, 0xA1, \
"argument stack underflow" ) "argument stack underflow" )
FT_ERRORDEF_( Ignore, 0xA2, \ FT_ERRORDEF_( Ignore, 0xA2, \
"ignore" ) "ignore" )
FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \ FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \
"no Unicode glyph name found" ) "no Unicode glyph name found" )
/* BDF errors */
/* BDF errors */
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \
FT_ERRORDEF_( Missing_Startfont_Field, 0xB0, \ "`STARTFONT' field missing" )
"`STARTFONT' field missing" ) FT_ERRORDEF_( Missing_Font_Field, 0xB1, \
FT_ERRORDEF_( Missing_Font_Field, 0xB1, \ "`FONT' field missing" )
"`FONT' field missing" ) FT_ERRORDEF_( Missing_Size_Field, 0xB2, \
FT_ERRORDEF_( Missing_Size_Field, 0xB2, \ "`SIZE' field missing" )
"`SIZE' field missing" ) FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \
FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3, \ "`FONTBOUNDINGBOX' field missing" )
"`FONTBOUNDINGBOX' field missing" ) FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \
FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \ "`CHARS' field missing" )
"`CHARS' field missing" ) FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \
FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \ "`STARTCHAR' field missing" )
"`STARTCHAR' field missing" ) FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \
FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \ "`ENCODING' field missing" )
"`ENCODING' field missing" ) FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \
FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \ "`BBX' field missing" )
"`BBX' field missing" ) FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \
FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \ "`BBX' too big" )
"`BBX' too big" ) FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \
FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \ "Font header corrupted or missing fields" )
"Font header corrupted or missing fields" ) FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \
FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \ "Font glyphs corrupted or missing fields" )
"Font glyphs corrupted or missing fields" )
/* END */
/* END */

View file

@ -1,206 +1,206 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* fterrors.h */ /* fterrors.h */
/* */ /* */
/* FreeType error code handling (specification). */ /* FreeType error code handling (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2004, 2007 by */ /* Copyright 1996-2001, 2002, 2004, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This special header file is used to define the handling of FT2 */ /* This special header file is used to define the handling of FT2 */
/* enumeration constants. It can also be used to generate error message */ /* enumeration constants. It can also be used to generate error message */
/* strings with a small macro trick explained below. */ /* strings with a small macro trick explained below. */
/* */ /* */
/* I - Error Formats */ /* I - Error Formats */
/* ----------------- */ /* ----------------- */
/* */ /* */
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */ /* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
/* defined in ftoption.h in order to make the higher byte indicate */ /* defined in ftoption.h in order to make the higher byte indicate */
/* the module where the error has happened (this is not compatible */ /* the module where the error has happened (this is not compatible */
/* with standard builds of FreeType 2). You can then use the macro */ /* with standard builds of FreeType 2). You can then use the macro */
/* FT_ERROR_BASE macro to extract the generic error code from an */ /* FT_ERROR_BASE macro to extract the generic error code from an */
/* FT_Error value. */ /* FT_Error value. */
/* */ /* */
/* */ /* */
/* II - Error Message strings */ /* II - Error Message strings */
/* -------------------------- */ /* -------------------------- */
/* */ /* */
/* The error definitions below are made through special macros that */ /* The error definitions below are made through special macros that */
/* allow client applications to build a table of error message strings */ /* allow client applications to build a table of error message strings */
/* if they need it. The strings are not included in a normal build of */ /* if they need it. The strings are not included in a normal build of */
/* FreeType 2 to save space (most client applications do not use */ /* FreeType 2 to save space (most client applications do not use */
/* them). */ /* them). */
/* */ /* */
/* To do so, you have to define the following macros before including */ /* To do so, you have to define the following macros before including */
/* this file: */ /* this file: */
/* */ /* */
/* FT_ERROR_START_LIST :: */ /* FT_ERROR_START_LIST :: */
/* This macro is called before anything else to define the start of */ /* This macro is called before anything else to define the start of */
/* the error list. It is followed by several FT_ERROR_DEF calls */ /* the error list. It is followed by several FT_ERROR_DEF calls */
/* (see below). */ /* (see below). */
/* */ /* */
/* FT_ERROR_DEF( e, v, s ) :: */ /* FT_ERROR_DEF( e, v, s ) :: */
/* This macro is called to define one single error. */ /* This macro is called to define one single error. */
/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */ /* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
/* `v' is the error numerical value. */ /* `v' is the error numerical value. */
/* `s' is the corresponding error string. */ /* `s' is the corresponding error string. */
/* */ /* */
/* FT_ERROR_END_LIST :: */ /* FT_ERROR_END_LIST :: */
/* This macro ends the list. */ /* This macro ends the list. */
/* */ /* */
/* Additionally, you have to undefine __FTERRORS_H__ before #including */ /* Additionally, you have to undefine __FTERRORS_H__ before #including */
/* this file. */ /* this file. */
/* */ /* */
/* Here is a simple example: */ /* Here is a simple example: */
/* */ /* */
/* { */ /* { */
/* #undef __FTERRORS_H__ */ /* #undef __FTERRORS_H__ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */ /* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */ /* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, 0 } }; */ /* #define FT_ERROR_END_LIST { 0, 0 } }; */
/* */ /* */
/* const struct */ /* const struct */
/* { */ /* { */
/* int err_code; */ /* int err_code; */
/* const char* err_msg; */ /* const char* err_msg; */
/* } ft_errors[] = */ /* } ft_errors[] = */
/* */ /* */
/* #include FT_ERRORS_H */ /* #include FT_ERRORS_H */
/* } */ /* } */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTERRORS_H__ #ifndef __FTERRORS_H__
#define __FTERRORS_H__ #define __FTERRORS_H__
/* include module base error codes */ /* include module base error codes */
#include FT_MODULE_ERRORS_H #include FT_MODULE_ERRORS_H
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
/***** SETUP MACROS *****/ /***** SETUP MACROS *****/
/***** *****/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#undef FT_NEED_EXTERN_C #undef FT_NEED_EXTERN_C
#undef FT_ERR_XCAT #undef FT_ERR_XCAT
#undef FT_ERR_CAT #undef FT_ERR_CAT
#define FT_ERR_XCAT( x, y ) x ## y #define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y ) #define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
/* FT_ERR_PREFIX is used as a prefix for error identifiers. */ /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
/* By default, we use `FT_Err_'. */ /* By default, we use `FT_Err_'. */
/* */ /* */
#ifndef FT_ERR_PREFIX #ifndef FT_ERR_PREFIX
#define FT_ERR_PREFIX FT_Err_ #define FT_ERR_PREFIX FT_Err_
#endif #endif
/* FT_ERR_BASE is used as the base for module-specific errors. */ /* FT_ERR_BASE is used as the base for module-specific errors. */
/* */ /* */
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
#ifndef FT_ERR_BASE #ifndef FT_ERR_BASE
#define FT_ERR_BASE FT_Mod_Err_Base #define FT_ERR_BASE FT_Mod_Err_Base
#endif #endif
#else #else
#undef FT_ERR_BASE #undef FT_ERR_BASE
#define FT_ERR_BASE 0 #define FT_ERR_BASE 0
#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */ #endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
/* If FT_ERRORDEF is not defined, we need to define a simple */ /* If FT_ERRORDEF is not defined, we need to define a simple */
/* enumeration type. */ /* enumeration type. */
/* */ /* */
#ifndef FT_ERRORDEF #ifndef FT_ERRORDEF
#define FT_ERRORDEF( e, v, s ) e = v, #define FT_ERRORDEF( e, v, s ) e = v,
#define FT_ERROR_START_LIST enum { #define FT_ERROR_START_LIST enum {
#define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) }; #define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
#ifdef __cplusplus #ifdef __cplusplus
#define FT_NEED_EXTERN_C #define FT_NEED_EXTERN_C
extern "C" { extern "C" {
#endif #endif
#endif /* !FT_ERRORDEF */ #endif /* !FT_ERRORDEF */
/* this macro is used to define an error */ /* this macro is used to define an error */
#define FT_ERRORDEF_( e, v, s ) \ #define FT_ERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s ) FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
/* this is only used for <module>_Err_Ok, which must be 0! */ /* this is only used for <module>_Err_Ok, which must be 0! */
#define FT_NOERRORDEF_( e, v, s ) \ #define FT_NOERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s ) FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
#ifdef FT_ERROR_START_LIST #ifdef FT_ERROR_START_LIST
FT_ERROR_START_LIST FT_ERROR_START_LIST
#endif #endif
/* now include the error codes */ /* now include the error codes */
#include FT_ERROR_DEFINITIONS_H #include FT_ERROR_DEFINITIONS_H
#ifdef FT_ERROR_END_LIST #ifdef FT_ERROR_END_LIST
FT_ERROR_END_LIST FT_ERROR_END_LIST
#endif #endif
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
/***** SIMPLE CLEANUP *****/ /***** SIMPLE CLEANUP *****/
/***** *****/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#ifdef FT_NEED_EXTERN_C #ifdef FT_NEED_EXTERN_C
} }
#endif #endif
#undef FT_ERROR_START_LIST #undef FT_ERROR_START_LIST
#undef FT_ERROR_END_LIST #undef FT_ERROR_END_LIST
#undef FT_ERRORDEF #undef FT_ERRORDEF
#undef FT_ERRORDEF_ #undef FT_ERRORDEF_
#undef FT_NOERRORDEF_ #undef FT_NOERRORDEF_
#undef FT_NEED_EXTERN_C #undef FT_NEED_EXTERN_C
#undef FT_ERR_CONCAT #undef FT_ERR_CONCAT
#undef FT_ERR_BASE #undef FT_ERR_BASE
/* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */ /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */
#ifndef FT_KEEP_ERR_PREFIX #ifndef FT_KEEP_ERR_PREFIX
#undef FT_ERR_PREFIX #undef FT_ERR_PREFIX
#endif #endif
#endif /* __FTERRORS_H__ */ #endif /* __FTERRORS_H__ */
/* END */ /* END */

View file

@ -1,120 +1,128 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftgasp.h */ /* ftgasp.h */
/* */ /* */
/* Access of TrueType's `gasp' table (specification). */ /* Access of TrueType's `gasp' table (specification). */
/* */ /* */
/* Copyright 2007, 2008 by */ /* Copyright 2007, 2008, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef _FT_GASP_H_ #ifndef _FT_GASP_H_
#define _FT_GASP_H_ #define _FT_GASP_H_
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
/*************************************************************************** /***************************************************************************
* *
* @section: * @section:
* gasp_table * gasp_table
* *
* @title: * @title:
* Gasp Table * Gasp Table
* *
* @abstract: * @abstract:
* Retrieving TrueType `gasp' table entries. * Retrieving TrueType `gasp' table entries.
* *
* @description: * @description:
* The function @FT_Get_Gasp can be used to query a TrueType or OpenType * The function @FT_Get_Gasp can be used to query a TrueType or OpenType
* font for specific entries in its `gasp' table, if any. This is * font for specific entries in its `gasp' table, if any. This is
* mainly useful when implementing native TrueType hinting with the * mainly useful when implementing native TrueType hinting with the
* bytecode interpreter to duplicate the Windows text rendering results. * bytecode interpreter to duplicate the Windows text rendering results.
*/ */
/************************************************************************* /*************************************************************************
* *
* @enum: * @enum:
* FT_GASP_XXX * FT_GASP_XXX
* *
* @description: * @description:
* A list of values and/or bit-flags returned by the @FT_Get_Gasp * A list of values and/or bit-flags returned by the @FT_Get_Gasp
* function. * function.
* *
* @values: * @values:
* FT_GASP_NO_TABLE :: * FT_GASP_NO_TABLE ::
* This special value means that there is no GASP table in this face. * This special value means that there is no GASP table in this face.
* It is up to the client to decide what to do. * It is up to the client to decide what to do.
* *
* FT_GASP_DO_GRIDFIT :: * FT_GASP_DO_GRIDFIT ::
* Grid-fitting and hinting should be performed at the specified ppem. * Grid-fitting and hinting should be performed at the specified ppem.
* This *really* means TrueType bytecode interpretation. * This *really* means TrueType bytecode interpretation. If this bit
* * is not set, no hinting gets applied.
* FT_GASP_DO_GRAY :: *
* Anti-aliased rendering should be performed at the specified ppem. * FT_GASP_DO_GRAY ::
* * Anti-aliased rendering should be performed at the specified ppem.
* FT_GASP_SYMMETRIC_SMOOTHING :: * If not set, do monochrome rendering.
* Smoothing along multiple axes must be used with ClearType. *
* * FT_GASP_SYMMETRIC_SMOOTHING ::
* FT_GASP_SYMMETRIC_GRIDFIT :: * If set, smoothing along multiple axes must be used with ClearType.
* Grid-fitting must be used with ClearType's symmetric smoothing. *
* * FT_GASP_SYMMETRIC_GRIDFIT ::
* @note: * Grid-fitting must be used with ClearType's symmetric smoothing.
* `ClearType' is Microsoft's implementation of LCD rendering, partly *
* protected by patents. * @note:
* * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
* @since: * used for standard font rasterization only. Independently of that,
* 2.3.0 * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
*/ * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
#define FT_GASP_NO_TABLE -1 * `FT_GASP_DO_GRAY' are consequently ignored).
#define FT_GASP_DO_GRIDFIT 0x01 *
#define FT_GASP_DO_GRAY 0x02 * `ClearType' is Microsoft's implementation of LCD rendering, partly
#define FT_GASP_SYMMETRIC_SMOOTHING 0x08 * protected by patents.
#define FT_GASP_SYMMETRIC_GRIDFIT 0x10 *
* @since:
* 2.3.0
/************************************************************************* */
* #define FT_GASP_NO_TABLE -1
* @func: #define FT_GASP_DO_GRIDFIT 0x01
* FT_Get_Gasp #define FT_GASP_DO_GRAY 0x02
* #define FT_GASP_SYMMETRIC_SMOOTHING 0x08
* @description: #define FT_GASP_SYMMETRIC_GRIDFIT 0x10
* Read the `gasp' table from a TrueType or OpenType font file and
* return the entry corresponding to a given character pixel size.
* /*************************************************************************
* @input: *
* face :: The source face handle. * @func:
* ppem :: The vertical character pixel size. * FT_Get_Gasp
* *
* @return: * @description:
* Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no * Read the `gasp' table from a TrueType or OpenType font file and
* `gasp' table in the face. * return the entry corresponding to a given character pixel size.
* *
* @since: * @input:
* 2.3.0 * face :: The source face handle.
*/ * ppem :: The vertical character pixel size.
FT_EXPORT( FT_Int ) *
FT_Get_Gasp( FT_Face face, * @return:
FT_UInt ppem ); * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
* `gasp' table in the face.
/* */ *
* @since:
#endif /* _FT_GASP_H_ */ * 2.3.0
*/
FT_EXPORT( FT_Int )
/* END */ FT_Get_Gasp( FT_Face face,
FT_UInt ppem );
/* */
#endif /* _FT_GASP_H_ */
/* END */

File diff suppressed because it is too large Load diff

View file

@ -1,358 +1,358 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftgxval.h */ /* ftgxval.h */
/* */ /* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */ /* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */ /* */
/* Copyright 2004, 2005, 2006 by */ /* Copyright 2004, 2005, 2006 by */
/* Masatake YAMATO, Redhat K.K, */ /* Masatake YAMATO, Redhat K.K, */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* gxvalid is derived from both gxlayout module and otvalid module. */ /* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */ /* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */ /* Promotion Agency(IPA), Japan. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTGXVAL_H__ #ifndef __FTGXVAL_H__
#define __FTGXVAL_H__ #define __FTGXVAL_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* gx_validation */ /* gx_validation */
/* */ /* */
/* <Title> */ /* <Title> */
/* TrueTypeGX/AAT Validation */ /* TrueTypeGX/AAT Validation */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* An API to validate TrueTypeGX/AAT tables. */ /* An API to validate TrueTypeGX/AAT tables. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains the declaration of functions to validate */ /* This section contains the declaration of functions to validate */
/* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */ /* some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, */
/* trak, prop, lcar). */ /* trak, prop, lcar). */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* */ /* */
/* Warning: Use FT_VALIDATE_XXX to validate a table. */ /* Warning: Use FT_VALIDATE_XXX to validate a table. */
/* Following definitions are for gxvalid developers. */ /* Following definitions are for gxvalid developers. */
/* */ /* */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#define FT_VALIDATE_feat_INDEX 0 #define FT_VALIDATE_feat_INDEX 0
#define FT_VALIDATE_mort_INDEX 1 #define FT_VALIDATE_mort_INDEX 1
#define FT_VALIDATE_morx_INDEX 2 #define FT_VALIDATE_morx_INDEX 2
#define FT_VALIDATE_bsln_INDEX 3 #define FT_VALIDATE_bsln_INDEX 3
#define FT_VALIDATE_just_INDEX 4 #define FT_VALIDATE_just_INDEX 4
#define FT_VALIDATE_kern_INDEX 5 #define FT_VALIDATE_kern_INDEX 5
#define FT_VALIDATE_opbd_INDEX 6 #define FT_VALIDATE_opbd_INDEX 6
#define FT_VALIDATE_trak_INDEX 7 #define FT_VALIDATE_trak_INDEX 7
#define FT_VALIDATE_prop_INDEX 8 #define FT_VALIDATE_prop_INDEX 8
#define FT_VALIDATE_lcar_INDEX 9 #define FT_VALIDATE_lcar_INDEX 9
#define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX #define FT_VALIDATE_GX_LAST_INDEX FT_VALIDATE_lcar_INDEX
/************************************************************************* /*************************************************************************
* *
* @macro: * @macro:
* FT_VALIDATE_GX_LENGTH * FT_VALIDATE_GX_LENGTH
* *
* @description: * @description:
* The number of tables checked in this module. Use it as a parameter * The number of tables checked in this module. Use it as a parameter
* for the `table-length' argument of function @FT_TrueTypeGX_Validate. * for the `table-length' argument of function @FT_TrueTypeGX_Validate.
*/ */
#define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1) #define FT_VALIDATE_GX_LENGTH (FT_VALIDATE_GX_LAST_INDEX + 1)
/* */ /* */
/* Up to 0x1000 is used by otvalid. /* Up to 0x1000 is used by otvalid.
Ox2xxx is reserved for feature OT extension. */ Ox2xxx is reserved for feature OT extension. */
#define FT_VALIDATE_GX_START 0x4000 #define FT_VALIDATE_GX_START 0x4000
#define FT_VALIDATE_GX_BITFIELD( tag ) \ #define FT_VALIDATE_GX_BITFIELD( tag ) \
( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX ) ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )
/********************************************************************** /**********************************************************************
* *
* @enum: * @enum:
* FT_VALIDATE_GXXXX * FT_VALIDATE_GXXXX
* *
* @description: * @description:
* A list of bit-field constants used with @FT_TrueTypeGX_Validate to * A list of bit-field constants used with @FT_TrueTypeGX_Validate to
* indicate which TrueTypeGX/AAT Type tables should be validated. * indicate which TrueTypeGX/AAT Type tables should be validated.
* *
* @values: * @values:
* FT_VALIDATE_feat :: * FT_VALIDATE_feat ::
* Validate `feat' table. * Validate `feat' table.
* *
* FT_VALIDATE_mort :: * FT_VALIDATE_mort ::
* Validate `mort' table. * Validate `mort' table.
* *
* FT_VALIDATE_morx :: * FT_VALIDATE_morx ::
* Validate `morx' table. * Validate `morx' table.
* *
* FT_VALIDATE_bsln :: * FT_VALIDATE_bsln ::
* Validate `bsln' table. * Validate `bsln' table.
* *
* FT_VALIDATE_just :: * FT_VALIDATE_just ::
* Validate `just' table. * Validate `just' table.
* *
* FT_VALIDATE_kern :: * FT_VALIDATE_kern ::
* Validate `kern' table. * Validate `kern' table.
* *
* FT_VALIDATE_opbd :: * FT_VALIDATE_opbd ::
* Validate `opbd' table. * Validate `opbd' table.
* *
* FT_VALIDATE_trak :: * FT_VALIDATE_trak ::
* Validate `trak' table. * Validate `trak' table.
* *
* FT_VALIDATE_prop :: * FT_VALIDATE_prop ::
* Validate `prop' table. * Validate `prop' table.
* *
* FT_VALIDATE_lcar :: * FT_VALIDATE_lcar ::
* Validate `lcar' table. * Validate `lcar' table.
* *
* FT_VALIDATE_GX :: * FT_VALIDATE_GX ::
* Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, * Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,
* opbd, trak, prop and lcar). * opbd, trak, prop and lcar).
* *
*/ */
#define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) #define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat )
#define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) #define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort )
#define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) #define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx )
#define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) #define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln )
#define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) #define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just )
#define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) #define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern )
#define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) #define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd )
#define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) #define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak )
#define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) #define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop )
#define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) #define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar )
#define FT_VALIDATE_GX ( FT_VALIDATE_feat | \ #define FT_VALIDATE_GX ( FT_VALIDATE_feat | \
FT_VALIDATE_mort | \ FT_VALIDATE_mort | \
FT_VALIDATE_morx | \ FT_VALIDATE_morx | \
FT_VALIDATE_bsln | \ FT_VALIDATE_bsln | \
FT_VALIDATE_just | \ FT_VALIDATE_just | \
FT_VALIDATE_kern | \ FT_VALIDATE_kern | \
FT_VALIDATE_opbd | \ FT_VALIDATE_opbd | \
FT_VALIDATE_trak | \ FT_VALIDATE_trak | \
FT_VALIDATE_prop | \ FT_VALIDATE_prop | \
FT_VALIDATE_lcar ) FT_VALIDATE_lcar )
/* */ /* */
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_TrueTypeGX_Validate * FT_TrueTypeGX_Validate
* *
* @description: * @description:
* Validate various TrueTypeGX tables to assure that all offsets and * Validate various TrueTypeGX tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which * indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without * actually does the text layout can access those tables without
* error checking (which can be quite time consuming). * error checking (which can be quite time consuming).
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* validation_flags :: * validation_flags ::
* A bit field which specifies the tables to be validated. See * A bit field which specifies the tables to be validated. See
* @FT_VALIDATE_GXXXX for possible values. * @FT_VALIDATE_GXXXX for possible values.
* *
* table_length :: * table_length ::
* The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH * The size of the `tables' array. Normally, @FT_VALIDATE_GX_LENGTH
* should be passed. * should be passed.
* *
* @output: * @output:
* tables :: * tables ::
* The array where all validated sfnt tables are stored. * The array where all validated sfnt tables are stored.
* The array itself must be allocated by a client. * The array itself must be allocated by a client.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with TrueTypeGX fonts, returning an error * This function only works with TrueTypeGX fonts, returning an error
* otherwise. * otherwise.
* *
* After use, the application should deallocate the buffers pointed to by * After use, the application should deallocate the buffers pointed to by
* each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value * each `tables' element, by calling @FT_TrueTypeGX_Free. A NULL value
* indicates that the table either doesn't exist in the font, the * indicates that the table either doesn't exist in the font, the
* application hasn't asked for validation, or the validator doesn't have * application hasn't asked for validation, or the validator doesn't have
* the ability to validate the sfnt table. * the ability to validate the sfnt table.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_TrueTypeGX_Validate( FT_Face face, FT_TrueTypeGX_Validate( FT_Face face,
FT_UInt validation_flags, FT_UInt validation_flags,
FT_Bytes tables[FT_VALIDATE_GX_LENGTH], FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
FT_UInt table_length ); FT_UInt table_length );
/* */ /* */
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_TrueTypeGX_Free * FT_TrueTypeGX_Free
* *
* @description: * @description:
* Free the buffer allocated by TrueTypeGX validator. * Free the buffer allocated by TrueTypeGX validator.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* table :: * table ::
* The pointer to the buffer allocated by * The pointer to the buffer allocated by
* @FT_TrueTypeGX_Validate. * @FT_TrueTypeGX_Validate.
* *
* @note: * @note:
* This function must be used to free the buffer allocated by * This function must be used to free the buffer allocated by
* @FT_TrueTypeGX_Validate only. * @FT_TrueTypeGX_Validate only.
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_TrueTypeGX_Free( FT_Face face, FT_TrueTypeGX_Free( FT_Face face,
FT_Bytes table ); FT_Bytes table );
/* */ /* */
/********************************************************************** /**********************************************************************
* *
* @enum: * @enum:
* FT_VALIDATE_CKERNXXX * FT_VALIDATE_CKERNXXX
* *
* @description: * @description:
* A list of bit-field constants used with @FT_ClassicKern_Validate * A list of bit-field constants used with @FT_ClassicKern_Validate
* to indicate the classic kern dialect or dialects. If the selected * to indicate the classic kern dialect or dialects. If the selected
* type doesn't fit, @FT_ClassicKern_Validate regards the table as * type doesn't fit, @FT_ClassicKern_Validate regards the table as
* invalid. * invalid.
* *
* @values: * @values:
* FT_VALIDATE_MS :: * FT_VALIDATE_MS ::
* Handle the `kern' table as a classic Microsoft kern table. * Handle the `kern' table as a classic Microsoft kern table.
* *
* FT_VALIDATE_APPLE :: * FT_VALIDATE_APPLE ::
* Handle the `kern' table as a classic Apple kern table. * Handle the `kern' table as a classic Apple kern table.
* *
* FT_VALIDATE_CKERN :: * FT_VALIDATE_CKERN ::
* Handle the `kern' as either classic Apple or Microsoft kern table. * Handle the `kern' as either classic Apple or Microsoft kern table.
*/ */
#define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) #define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 )
#define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) #define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 )
#define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) #define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )
/* */ /* */
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_ClassicKern_Validate * FT_ClassicKern_Validate
* *
* @description: * @description:
* Validate classic (16-bit format) kern table to assure that the offsets * Validate classic (16-bit format) kern table to assure that the offsets
* and indices are valid. The idea is that a higher-level library which * and indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without error * actually does the text layout can access those tables without error
* checking (which can be quite time consuming). * checking (which can be quite time consuming).
* *
* The `kern' table validator in @FT_TrueTypeGX_Validate deals with both * The `kern' table validator in @FT_TrueTypeGX_Validate deals with both
* the new 32-bit format and the classic 16-bit format, while * the new 32-bit format and the classic 16-bit format, while
* FT_ClassicKern_Validate only supports the classic 16-bit format. * FT_ClassicKern_Validate only supports the classic 16-bit format.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* validation_flags :: * validation_flags ::
* A bit field which specifies the dialect to be validated. See * A bit field which specifies the dialect to be validated. See
* @FT_VALIDATE_CKERNXXX for possible values. * @FT_VALIDATE_CKERNXXX for possible values.
* *
* @output: * @output:
* ckern_table :: * ckern_table ::
* A pointer to the kern table. * A pointer to the kern table.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* After use, the application should deallocate the buffers pointed to by * After use, the application should deallocate the buffers pointed to by
* `ckern_table', by calling @FT_ClassicKern_Free. A NULL value * `ckern_table', by calling @FT_ClassicKern_Free. A NULL value
* indicates that the table doesn't exist in the font. * indicates that the table doesn't exist in the font.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_ClassicKern_Validate( FT_Face face, FT_ClassicKern_Validate( FT_Face face,
FT_UInt validation_flags, FT_UInt validation_flags,
FT_Bytes *ckern_table ); FT_Bytes *ckern_table );
/* */ /* */
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_ClassicKern_Free * FT_ClassicKern_Free
* *
* @description: * @description:
* Free the buffer allocated by classic Kern validator. * Free the buffer allocated by classic Kern validator.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* table :: * table ::
* The pointer to the buffer that is allocated by * The pointer to the buffer that is allocated by
* @FT_ClassicKern_Validate. * @FT_ClassicKern_Validate.
* *
* @note: * @note:
* This function must be used to free the buffer allocated by * This function must be used to free the buffer allocated by
* @FT_ClassicKern_Validate only. * @FT_ClassicKern_Validate only.
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_ClassicKern_Free( FT_Face face, FT_ClassicKern_Free( FT_Face face,
FT_Bytes table ); FT_Bytes table );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTGXVAL_H__ */ #endif /* __FTGXVAL_H__ */
/* END */ /* END */

View file

@ -1,102 +1,102 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftgzip.h */ /* ftgzip.h */
/* */ /* */
/* Gzip-compressed stream support. */ /* Gzip-compressed stream support. */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2006 by */ /* Copyright 2002, 2003, 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTGZIP_H__ #ifndef __FTGZIP_H__
#define __FTGZIP_H__ #define __FTGZIP_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* gzip */ /* gzip */
/* */ /* */
/* <Title> */ /* <Title> */
/* GZIP Streams */ /* GZIP Streams */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Using gzip-compressed font files. */ /* Using gzip-compressed font files. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains the declaration of Gzip-specific functions. */ /* This section contains the declaration of Gzip-specific functions. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/************************************************************************ /************************************************************************
* *
* @function: * @function:
* FT_Stream_OpenGzip * FT_Stream_OpenGzip
* *
* @description: * @description:
* Open a new stream to parse gzip-compressed font files. This is * Open a new stream to parse gzip-compressed font files. This is
* mainly used to support the compressed `*.pcf.gz' fonts that come * mainly used to support the compressed `*.pcf.gz' fonts that come
* with XFree86. * with XFree86.
* *
* @input: * @input:
* stream :: * stream ::
* The target embedding stream. * The target embedding stream.
* *
* source :: * source ::
* The source stream. * The source stream.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* The source stream must be opened _before_ calling this function. * The source stream must be opened _before_ calling this function.
* *
* Calling the internal function `FT_Stream_Close' on the new stream will * Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream * *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap. * objects will be released to the heap.
* *
* The stream implementation is very basic and resets the decompression * The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream. * process each time seeking backwards is needed within the stream.
* *
* In certain builds of the library, gzip compression recognition is * In certain builds of the library, gzip compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face. * automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw * This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a gzipped stream from * compressed file, the library will try to open a gzipped stream from
* it and re-open the face with it. * it and re-open the face with it.
* *
* This function may return `FT_Err_Unimplemented_Feature' if your build * This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with zlib support. * of FreeType was not compiled with zlib support.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Stream_OpenGzip( FT_Stream stream, FT_Stream_OpenGzip( FT_Stream stream,
FT_Stream source ); FT_Stream source );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTGZIP_H__ */ #endif /* __FTGZIP_H__ */
/* END */ /* END */

File diff suppressed because it is too large Load diff

View file

@ -1,353 +1,353 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftincrem.h */ /* ftincrem.h */
/* */ /* */
/* FreeType incremental loading (specification). */ /* FreeType incremental loading (specification). */
/* */ /* */
/* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */ /* Copyright 2002, 2003, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTINCREM_H__ #ifndef __FTINCREM_H__
#define __FTINCREM_H__ #define __FTINCREM_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************** /***************************************************************************
* *
* @section: * @section:
* incremental * incremental
* *
* @title: * @title:
* Incremental Loading * Incremental Loading
* *
* @abstract: * @abstract:
* Custom Glyph Loading. * Custom Glyph Loading.
* *
* @description: * @description:
* This section contains various functions used to perform so-called * This section contains various functions used to perform so-called
* `incremental' glyph loading. This is a mode where all glyphs loaded * `incremental' glyph loading. This is a mode where all glyphs loaded
* from a given @FT_Face are provided by the client application, * from a given @FT_Face are provided by the client application,
* *
* Apart from that, all other tables are loaded normally from the font * Apart from that, all other tables are loaded normally from the font
* file. This mode is useful when FreeType is used within another * file. This mode is useful when FreeType is used within another
* engine, e.g., a PostScript Imaging Processor. * engine, e.g., a PostScript Imaging Processor.
* *
* To enable this mode, you must use @FT_Open_Face, passing an * To enable this mode, you must use @FT_Open_Face, passing an
* @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an * @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an
* @FT_Incremental_Interface value. See the comments for * @FT_Incremental_Interface value. See the comments for
* @FT_Incremental_InterfaceRec for an example. * @FT_Incremental_InterfaceRec for an example.
* *
*/ */
/*************************************************************************** /***************************************************************************
* *
* @type: * @type:
* FT_Incremental * FT_Incremental
* *
* @description: * @description:
* An opaque type describing a user-provided object used to implement * An opaque type describing a user-provided object used to implement
* `incremental' glyph loading within FreeType. This is used to support * `incremental' glyph loading within FreeType. This is used to support
* embedded fonts in certain environments (e.g., PostScript interpreters), * embedded fonts in certain environments (e.g., PostScript interpreters),
* where the glyph data isn't in the font file, or must be overridden by * where the glyph data isn't in the font file, or must be overridden by
* different values. * different values.
* *
* @note: * @note:
* It is up to client applications to create and implement @FT_Incremental * It is up to client applications to create and implement @FT_Incremental
* objects, as long as they provide implementations for the methods * objects, as long as they provide implementations for the methods
* @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc
* and @FT_Incremental_GetGlyphMetricsFunc. * and @FT_Incremental_GetGlyphMetricsFunc.
* *
* See the description of @FT_Incremental_InterfaceRec to understand how * See the description of @FT_Incremental_InterfaceRec to understand how
* to use incremental objects with FreeType. * to use incremental objects with FreeType.
* *
*/ */
typedef struct FT_IncrementalRec_* FT_Incremental; typedef struct FT_IncrementalRec_* FT_Incremental;
/*************************************************************************** /***************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_MetricsRec * FT_Incremental_MetricsRec
* *
* @description: * @description:
* A small structure used to contain the basic glyph metrics returned * A small structure used to contain the basic glyph metrics returned
* by the @FT_Incremental_GetGlyphMetricsFunc method. * by the @FT_Incremental_GetGlyphMetricsFunc method.
* *
* @fields: * @fields:
* bearing_x :: * bearing_x ::
* Left bearing, in font units. * Left bearing, in font units.
* *
* bearing_y :: * bearing_y ::
* Top bearing, in font units. * Top bearing, in font units.
* *
* advance :: * advance ::
* Horizontal component of glyph advance, in font units. * Horizontal component of glyph advance, in font units.
* *
* advance_v :: * advance_v ::
* Vertical component of glyph advance, in font units. * Vertical component of glyph advance, in font units.
* *
* @note: * @note:
* These correspond to horizontal or vertical metrics depending on the * These correspond to horizontal or vertical metrics depending on the
* value of the `vertical' argument to the function * value of the `vertical' argument to the function
* @FT_Incremental_GetGlyphMetricsFunc. * @FT_Incremental_GetGlyphMetricsFunc.
* *
*/ */
typedef struct FT_Incremental_MetricsRec_ typedef struct FT_Incremental_MetricsRec_
{ {
FT_Long bearing_x; FT_Long bearing_x;
FT_Long bearing_y; FT_Long bearing_y;
FT_Long advance; FT_Long advance;
FT_Long advance_v; /* since 2.3.12 */ FT_Long advance_v; /* since 2.3.12 */
} FT_Incremental_MetricsRec; } FT_Incremental_MetricsRec;
/*************************************************************************** /***************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_Metrics * FT_Incremental_Metrics
* *
* @description: * @description:
* A handle to an @FT_Incremental_MetricsRec structure. * A handle to an @FT_Incremental_MetricsRec structure.
* *
*/ */
typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics; typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics;
/*************************************************************************** /***************************************************************************
* *
* @type: * @type:
* FT_Incremental_GetGlyphDataFunc * FT_Incremental_GetGlyphDataFunc
* *
* @description: * @description:
* A function called by FreeType to access a given glyph's data bytes * A function called by FreeType to access a given glyph's data bytes
* during @FT_Load_Glyph or @FT_Load_Char if incremental loading is * during @FT_Load_Glyph or @FT_Load_Char if incremental loading is
* enabled. * enabled.
* *
* Note that the format of the glyph's data bytes depends on the font * Note that the format of the glyph's data bytes depends on the font
* file format. For TrueType, it must correspond to the raw bytes within * file format. For TrueType, it must correspond to the raw bytes within
* the `glyf' table. For PostScript formats, it must correspond to the * the `glyf' table. For PostScript formats, it must correspond to the
* *unencrypted* charstring bytes, without any `lenIV' header. It is * *unencrypted* charstring bytes, without any `lenIV' header. It is
* undefined for any other format. * undefined for any other format.
* *
* @input: * @input:
* incremental :: * incremental ::
* Handle to an opaque @FT_Incremental handle provided by the client * Handle to an opaque @FT_Incremental handle provided by the client
* application. * application.
* *
* glyph_index :: * glyph_index ::
* Index of relevant glyph. * Index of relevant glyph.
* *
* @output: * @output:
* adata :: * adata ::
* A structure describing the returned glyph data bytes (which will be * A structure describing the returned glyph data bytes (which will be
* accessed as a read-only byte block). * accessed as a read-only byte block).
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* If this function returns successfully the method * If this function returns successfully the method
* @FT_Incremental_FreeGlyphDataFunc will be called later to release * @FT_Incremental_FreeGlyphDataFunc will be called later to release
* the data bytes. * the data bytes.
* *
* Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for
* compound glyphs. * compound glyphs.
* *
*/ */
typedef FT_Error typedef FT_Error
(*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental, (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental,
FT_UInt glyph_index, FT_UInt glyph_index,
FT_Data* adata ); FT_Data* adata );
/*************************************************************************** /***************************************************************************
* *
* @type: * @type:
* FT_Incremental_FreeGlyphDataFunc * FT_Incremental_FreeGlyphDataFunc
* *
* @description: * @description:
* A function used to release the glyph data bytes returned by a * A function used to release the glyph data bytes returned by a
* successful call to @FT_Incremental_GetGlyphDataFunc. * successful call to @FT_Incremental_GetGlyphDataFunc.
* *
* @input: * @input:
* incremental :: * incremental ::
* A handle to an opaque @FT_Incremental handle provided by the client * A handle to an opaque @FT_Incremental handle provided by the client
* application. * application.
* *
* data :: * data ::
* A structure describing the glyph data bytes (which will be accessed * A structure describing the glyph data bytes (which will be accessed
* as a read-only byte block). * as a read-only byte block).
* *
*/ */
typedef void typedef void
(*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental, (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental,
FT_Data* data ); FT_Data* data );
/*************************************************************************** /***************************************************************************
* *
* @type: * @type:
* FT_Incremental_GetGlyphMetricsFunc * FT_Incremental_GetGlyphMetricsFunc
* *
* @description: * @description:
* A function used to retrieve the basic metrics of a given glyph index * A function used to retrieve the basic metrics of a given glyph index
* before accessing its data. This is necessary because, in certain * before accessing its data. This is necessary because, in certain
* formats like TrueType, the metrics are stored in a different place from * formats like TrueType, the metrics are stored in a different place from
* the glyph images proper. * the glyph images proper.
* *
* @input: * @input:
* incremental :: * incremental ::
* A handle to an opaque @FT_Incremental handle provided by the client * A handle to an opaque @FT_Incremental handle provided by the client
* application. * application.
* *
* glyph_index :: * glyph_index ::
* Index of relevant glyph. * Index of relevant glyph.
* *
* vertical :: * vertical ::
* If true, return vertical metrics. * If true, return vertical metrics.
* *
* ametrics :: * ametrics ::
* This parameter is used for both input and output. * This parameter is used for both input and output.
* The original glyph metrics, if any, in font units. If metrics are * The original glyph metrics, if any, in font units. If metrics are
* not available all the values must be set to zero. * not available all the values must be set to zero.
* *
* @output: * @output:
* ametrics :: * ametrics ::
* The replacement glyph metrics in font units. * The replacement glyph metrics in font units.
* *
*/ */
typedef FT_Error typedef FT_Error
(*FT_Incremental_GetGlyphMetricsFunc) (*FT_Incremental_GetGlyphMetricsFunc)
( FT_Incremental incremental, ( FT_Incremental incremental,
FT_UInt glyph_index, FT_UInt glyph_index,
FT_Bool vertical, FT_Bool vertical,
FT_Incremental_MetricsRec *ametrics ); FT_Incremental_MetricsRec *ametrics );
/************************************************************************** /**************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_FuncsRec * FT_Incremental_FuncsRec
* *
* @description: * @description:
* A table of functions for accessing fonts that load data * A table of functions for accessing fonts that load data
* incrementally. Used in @FT_Incremental_InterfaceRec. * incrementally. Used in @FT_Incremental_InterfaceRec.
* *
* @fields: * @fields:
* get_glyph_data :: * get_glyph_data ::
* The function to get glyph data. Must not be null. * The function to get glyph data. Must not be null.
* *
* free_glyph_data :: * free_glyph_data ::
* The function to release glyph data. Must not be null. * The function to release glyph data. Must not be null.
* *
* get_glyph_metrics :: * get_glyph_metrics ::
* The function to get glyph metrics. May be null if the font does * The function to get glyph metrics. May be null if the font does
* not provide overriding glyph metrics. * not provide overriding glyph metrics.
* *
*/ */
typedef struct FT_Incremental_FuncsRec_ typedef struct FT_Incremental_FuncsRec_
{ {
FT_Incremental_GetGlyphDataFunc get_glyph_data; FT_Incremental_GetGlyphDataFunc get_glyph_data;
FT_Incremental_FreeGlyphDataFunc free_glyph_data; FT_Incremental_FreeGlyphDataFunc free_glyph_data;
FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics; FT_Incremental_GetGlyphMetricsFunc get_glyph_metrics;
} FT_Incremental_FuncsRec; } FT_Incremental_FuncsRec;
/*************************************************************************** /***************************************************************************
* *
* @struct: * @struct:
* FT_Incremental_InterfaceRec * FT_Incremental_InterfaceRec
* *
* @description: * @description:
* A structure to be used with @FT_Open_Face to indicate that the user * A structure to be used with @FT_Open_Face to indicate that the user
* wants to support incremental glyph loading. You should use it with * wants to support incremental glyph loading. You should use it with
* @FT_PARAM_TAG_INCREMENTAL as in the following example: * @FT_PARAM_TAG_INCREMENTAL as in the following example:
* *
* { * {
* FT_Incremental_InterfaceRec inc_int; * FT_Incremental_InterfaceRec inc_int;
* FT_Parameter parameter; * FT_Parameter parameter;
* FT_Open_Args open_args; * FT_Open_Args open_args;
* *
* *
* // set up incremental descriptor * // set up incremental descriptor
* inc_int.funcs = my_funcs; * inc_int.funcs = my_funcs;
* inc_int.object = my_object; * inc_int.object = my_object;
* *
* // set up optional parameter * // set up optional parameter
* parameter.tag = FT_PARAM_TAG_INCREMENTAL; * parameter.tag = FT_PARAM_TAG_INCREMENTAL;
* parameter.data = &inc_int; * parameter.data = &inc_int;
* *
* // set up FT_Open_Args structure * // set up FT_Open_Args structure
* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
* open_args.pathname = my_font_pathname; * open_args.pathname = my_font_pathname;
* open_args.num_params = 1; * open_args.num_params = 1;
* open_args.params = &parameter; // we use one optional argument * open_args.params = &parameter; // we use one optional argument
* *
* // open the font * // open the font
* error = FT_Open_Face( library, &open_args, index, &face ); * error = FT_Open_Face( library, &open_args, index, &face );
* ... * ...
* } * }
* *
*/ */
typedef struct FT_Incremental_InterfaceRec_ typedef struct FT_Incremental_InterfaceRec_
{ {
const FT_Incremental_FuncsRec* funcs; const FT_Incremental_FuncsRec* funcs;
FT_Incremental object; FT_Incremental object;
} FT_Incremental_InterfaceRec; } FT_Incremental_InterfaceRec;
/*************************************************************************** /***************************************************************************
* *
* @type: * @type:
* FT_Incremental_Interface * FT_Incremental_Interface
* *
* @description: * @description:
* A pointer to an @FT_Incremental_InterfaceRec structure. * A pointer to an @FT_Incremental_InterfaceRec structure.
* *
*/ */
typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface; typedef FT_Incremental_InterfaceRec* FT_Incremental_Interface;
/*************************************************************************** /***************************************************************************
* *
* @constant: * @constant:
* FT_PARAM_TAG_INCREMENTAL * FT_PARAM_TAG_INCREMENTAL
* *
* @description: * @description:
* A constant used as the tag of @FT_Parameter structures to indicate * A constant used as the tag of @FT_Parameter structures to indicate
* an incremental loading object to be used by FreeType. * an incremental loading object to be used by FreeType.
* *
*/ */
#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) #define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTINCREM_H__ */ #endif /* __FTINCREM_H__ */
/* END */ /* END */

View file

@ -1,213 +1,213 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftlcdfil.h */ /* ftlcdfil.h */
/* */ /* */
/* FreeType API for color filtering of subpixel bitmap glyphs */ /* FreeType API for color filtering of subpixel bitmap glyphs */
/* (specification). */ /* (specification). */
/* */ /* */
/* Copyright 2006, 2007, 2008, 2010 by */ /* Copyright 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FT_LCD_FILTER_H__ #ifndef __FT_LCD_FILTER_H__
#define __FT_LCD_FILTER_H__ #define __FT_LCD_FILTER_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************** /***************************************************************************
* *
* @section: * @section:
* lcd_filtering * lcd_filtering
* *
* @title: * @title:
* LCD Filtering * LCD Filtering
* *
* @abstract: * @abstract:
* Reduce color fringes of LCD-optimized bitmaps. * Reduce color fringes of LCD-optimized bitmaps.
* *
* @description: * @description:
* The @FT_Library_SetLcdFilter API can be used to specify a low-pass * The @FT_Library_SetLcdFilter API can be used to specify a low-pass
* filter which is then applied to LCD-optimized bitmaps generated * filter which is then applied to LCD-optimized bitmaps generated
* through @FT_Render_Glyph. This is useful to reduce color fringes * through @FT_Render_Glyph. This is useful to reduce color fringes
* which would occur with unfiltered rendering. * which would occur with unfiltered rendering.
* *
* Note that no filter is active by default, and that this function is * Note that no filter is active by default, and that this function is
* *not* implemented in default builds of the library. You need to * *not* implemented in default builds of the library. You need to
* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file
* in order to activate it. * in order to activate it.
*/ */
/**************************************************************************** /****************************************************************************
* *
* @enum: * @enum:
* FT_LcdFilter * FT_LcdFilter
* *
* @description: * @description:
* A list of values to identify various types of LCD filters. * A list of values to identify various types of LCD filters.
* *
* @values: * @values:
* FT_LCD_FILTER_NONE :: * FT_LCD_FILTER_NONE ::
* Do not perform filtering. When used with subpixel rendering, this * Do not perform filtering. When used with subpixel rendering, this
* results in sometimes severe color fringes. * results in sometimes severe color fringes.
* *
* FT_LCD_FILTER_DEFAULT :: * FT_LCD_FILTER_DEFAULT ::
* The default filter reduces color fringes considerably, at the cost * The default filter reduces color fringes considerably, at the cost
* of a slight blurriness in the output. * of a slight blurriness in the output.
* *
* FT_LCD_FILTER_LIGHT :: * FT_LCD_FILTER_LIGHT ::
* The light filter is a variant that produces less blurriness at the * The light filter is a variant that produces less blurriness at the
* cost of slightly more color fringes than the default one. It might * cost of slightly more color fringes than the default one. It might
* be better, depending on taste, your monitor, or your personal vision. * be better, depending on taste, your monitor, or your personal vision.
* *
* FT_LCD_FILTER_LEGACY :: * FT_LCD_FILTER_LEGACY ::
* This filter corresponds to the original libXft color filter. It * This filter corresponds to the original libXft color filter. It
* provides high contrast output but can exhibit really bad color * provides high contrast output but can exhibit really bad color
* fringes if glyphs are not extremely well hinted to the pixel grid. * fringes if glyphs are not extremely well hinted to the pixel grid.
* In other words, it only works well if the TrueType bytecode * In other words, it only works well if the TrueType bytecode
* interpreter is enabled *and* high-quality hinted fonts are used. * interpreter is enabled *and* high-quality hinted fonts are used.
* *
* This filter is only provided for comparison purposes, and might be * This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future. * disabled or stay unsupported in the future.
* *
* @since: * @since:
* 2.3.0 * 2.3.0
*/ */
typedef enum FT_LcdFilter_ typedef enum FT_LcdFilter_
{ {
FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_NONE = 0,
FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_DEFAULT = 1,
FT_LCD_FILTER_LIGHT = 2, FT_LCD_FILTER_LIGHT = 2,
FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_LEGACY = 16,
FT_LCD_FILTER_MAX /* do not remove */ FT_LCD_FILTER_MAX /* do not remove */
} FT_LcdFilter; } FT_LcdFilter;
/************************************************************************** /**************************************************************************
* *
* @func: * @func:
* FT_Library_SetLcdFilter * FT_Library_SetLcdFilter
* *
* @description: * @description:
* This function is used to apply color filtering to LCD decimated * This function is used to apply color filtering to LCD decimated
* bitmaps, like the ones used when calling @FT_Render_Glyph with * bitmaps, like the ones used when calling @FT_Render_Glyph with
* @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V. * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
* *
* @input: * @input:
* library :: * library ::
* A handle to the target library instance. * A handle to the target library instance.
* *
* filter :: * filter ::
* The filter type. * The filter type.
* *
* You can use @FT_LCD_FILTER_NONE here to disable this feature, or * You can use @FT_LCD_FILTER_NONE here to disable this feature, or
* @FT_LCD_FILTER_DEFAULT to use a default filter that should work * @FT_LCD_FILTER_DEFAULT to use a default filter that should work
* well on most LCD screens. * well on most LCD screens.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This feature is always disabled by default. Clients must make an * This feature is always disabled by default. Clients must make an
* explicit call to this function with a `filter' value other than * explicit call to this function with a `filter' value other than
* @FT_LCD_FILTER_NONE in order to enable it. * @FT_LCD_FILTER_NONE in order to enable it.
* *
* Due to *PATENTS* covering subpixel rendering, this function doesn't * Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the * do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* defined in your build of the library, which should correspond to all * defined in your build of the library, which should correspond to all
* default builds of FreeType. * default builds of FreeType.
* *
* The filter affects glyph bitmaps rendered through @FT_Render_Glyph, * The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
* @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char. * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
* *
* It does _not_ affect the output of @FT_Outline_Render and * It does _not_ affect the output of @FT_Outline_Render and
* @FT_Outline_Get_Bitmap. * @FT_Outline_Get_Bitmap.
* *
* If this feature is activated, the dimensions of LCD glyph bitmaps are * If this feature is activated, the dimensions of LCD glyph bitmaps are
* either larger or taller than the dimensions of the corresponding * either larger or taller than the dimensions of the corresponding
* outline with regards to the pixel grid. For example, for * outline with regards to the pixel grid. For example, for
* @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and * @FT_RENDER_MODE_LCD, the filter adds up to 3~pixels to the left, and
* up to 3~pixels to the right. * up to 3~pixels to the right.
* *
* The bitmap offset values are adjusted correctly, so clients shouldn't * The bitmap offset values are adjusted correctly, so clients shouldn't
* need to modify their layout and glyph positioning code when enabling * need to modify their layout and glyph positioning code when enabling
* the filter. * the filter.
* *
* @since: * @since:
* 2.3.0 * 2.3.0
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Library_SetLcdFilter( FT_Library library, FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter ); FT_LcdFilter filter );
/************************************************************************** /**************************************************************************
* *
* @func: * @func:
* FT_Library_SetLcdFilterWeights * FT_Library_SetLcdFilterWeights
* *
* @description: * @description:
* Use this function to override the filter weights selected by * Use this function to override the filter weights selected by
* @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple * @FT_Library_SetLcdFilter. By default, FreeType uses the quintuple
* (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10, * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x10,
* 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and * 0x40, 0x70, 0x40, 0x10) for FT_LCD_FILTER_DEFAULT and
* FT_LCD_FILTER_LEGACY. * FT_LCD_FILTER_LEGACY.
* *
* @input: * @input:
* library :: * library ::
* A handle to the target library instance. * A handle to the target library instance.
* *
* weights :: * weights ::
* A pointer to an array; the function copies the first five bytes and * A pointer to an array; the function copies the first five bytes and
* uses them to specify the filter weights. * uses them to specify the filter weights.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* Due to *PATENTS* covering subpixel rendering, this function doesn't * Due to *PATENTS* covering subpixel rendering, this function doesn't
* do anything except returning `FT_Err_Unimplemented_Feature' if the * do anything except returning `FT_Err_Unimplemented_Feature' if the
* configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
* defined in your build of the library, which should correspond to all * defined in your build of the library, which should correspond to all
* default builds of FreeType. * default builds of FreeType.
* *
* This function must be called after @FT_Library_SetLcdFilter to have * This function must be called after @FT_Library_SetLcdFilter to have
* any effect. * any effect.
* *
* @since: * @since:
* 2.4.0 * 2.4.0
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Library_SetLcdFilterWeights( FT_Library library, FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights ); unsigned char *weights );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FT_LCD_FILTER_H__ */ #endif /* __FT_LCD_FILTER_H__ */
/* END */ /* END */

View file

@ -1,277 +1,277 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftlist.h */ /* ftlist.h */
/* */ /* */
/* Generic list support for FreeType (specification). */ /* Generic list support for FreeType (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2007, 2010 by */ /* Copyright 1996-2001, 2003, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This file implements functions relative to list processing. Its */ /* This file implements functions relative to list processing. Its */
/* data structures are defined in `freetype.h'. */ /* data structures are defined in `freetype.h'. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTLIST_H__ #ifndef __FTLIST_H__
#define __FTLIST_H__ #define __FTLIST_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* list_processing */ /* list_processing */
/* */ /* */
/* <Title> */ /* <Title> */
/* List Processing */ /* List Processing */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Simple management of lists. */ /* Simple management of lists. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains various definitions related to list */ /* This section contains various definitions related to list */
/* processing using doubly-linked nodes. */ /* processing using doubly-linked nodes. */
/* */ /* */
/* <Order> */ /* <Order> */
/* FT_List */ /* FT_List */
/* FT_ListNode */ /* FT_ListNode */
/* FT_ListRec */ /* FT_ListRec */
/* FT_ListNodeRec */ /* FT_ListNodeRec */
/* */ /* */
/* FT_List_Add */ /* FT_List_Add */
/* FT_List_Insert */ /* FT_List_Insert */
/* FT_List_Find */ /* FT_List_Find */
/* FT_List_Remove */ /* FT_List_Remove */
/* FT_List_Up */ /* FT_List_Up */
/* FT_List_Iterate */ /* FT_List_Iterate */
/* FT_List_Iterator */ /* FT_List_Iterator */
/* FT_List_Finalize */ /* FT_List_Finalize */
/* FT_List_Destructor */ /* FT_List_Destructor */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_List_Find */ /* FT_List_Find */
/* */ /* */
/* <Description> */ /* <Description> */
/* Find the list node for a given listed object. */ /* Find the list node for a given listed object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* list :: A pointer to the parent list. */ /* list :: A pointer to the parent list. */
/* data :: The address of the listed object. */ /* data :: The address of the listed object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* List node. NULL if it wasn't found. */ /* List node. NULL if it wasn't found. */
/* */ /* */
FT_EXPORT( FT_ListNode ) FT_EXPORT( FT_ListNode )
FT_List_Find( FT_List list, FT_List_Find( FT_List list,
void* data ); void* data );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_List_Add */ /* FT_List_Add */
/* */ /* */
/* <Description> */ /* <Description> */
/* Append an element to the end of a list. */ /* Append an element to the end of a list. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* list :: A pointer to the parent list. */ /* list :: A pointer to the parent list. */
/* node :: The node to append. */ /* node :: The node to append. */
/* */ /* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Add( FT_List list, FT_List_Add( FT_List list,
FT_ListNode node ); FT_ListNode node );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_List_Insert */ /* FT_List_Insert */
/* */ /* */
/* <Description> */ /* <Description> */
/* Insert an element at the head of a list. */ /* Insert an element at the head of a list. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* list :: A pointer to parent list. */ /* list :: A pointer to parent list. */
/* node :: The node to insert. */ /* node :: The node to insert. */
/* */ /* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Insert( FT_List list, FT_List_Insert( FT_List list,
FT_ListNode node ); FT_ListNode node );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_List_Remove */ /* FT_List_Remove */
/* */ /* */
/* <Description> */ /* <Description> */
/* Remove a node from a list. This function doesn't check whether */ /* Remove a node from a list. This function doesn't check whether */
/* the node is in the list! */ /* the node is in the list! */
/* */ /* */
/* <Input> */ /* <Input> */
/* node :: The node to remove. */ /* node :: The node to remove. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* list :: A pointer to the parent list. */ /* list :: A pointer to the parent list. */
/* */ /* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Remove( FT_List list, FT_List_Remove( FT_List list,
FT_ListNode node ); FT_ListNode node );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_List_Up */ /* FT_List_Up */
/* */ /* */
/* <Description> */ /* <Description> */
/* Move a node to the head/top of a list. Used to maintain LRU */ /* Move a node to the head/top of a list. Used to maintain LRU */
/* lists. */ /* lists. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* list :: A pointer to the parent list. */ /* list :: A pointer to the parent list. */
/* node :: The node to move. */ /* node :: The node to move. */
/* */ /* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Up( FT_List list, FT_List_Up( FT_List list,
FT_ListNode node ); FT_ListNode node );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_List_Iterator */ /* FT_List_Iterator */
/* */ /* */
/* <Description> */ /* <Description> */
/* An FT_List iterator function which is called during a list parse */ /* An FT_List iterator function which is called during a list parse */
/* by @FT_List_Iterate. */ /* by @FT_List_Iterate. */
/* */ /* */
/* <Input> */ /* <Input> */
/* node :: The current iteration list node. */ /* node :: The current iteration list node. */
/* */ /* */
/* user :: A typeless pointer passed to @FT_List_Iterate. */ /* user :: A typeless pointer passed to @FT_List_Iterate. */
/* Can be used to point to the iteration's state. */ /* Can be used to point to the iteration's state. */
/* */ /* */
typedef FT_Error typedef FT_Error
(*FT_List_Iterator)( FT_ListNode node, (*FT_List_Iterator)( FT_ListNode node,
void* user ); void* user );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_List_Iterate */ /* FT_List_Iterate */
/* */ /* */
/* <Description> */ /* <Description> */
/* Parse a list and calls a given iterator function on each element. */ /* Parse a list and calls a given iterator function on each element. */
/* Note that parsing is stopped as soon as one of the iterator calls */ /* Note that parsing is stopped as soon as one of the iterator calls */
/* returns a non-zero value. */ /* returns a non-zero value. */
/* */ /* */
/* <Input> */ /* <Input> */
/* list :: A handle to the list. */ /* list :: A handle to the list. */
/* iterator :: An iterator function, called on each node of the list. */ /* iterator :: An iterator function, called on each node of the list. */
/* user :: A user-supplied field which is passed as the second */ /* user :: A user-supplied field which is passed as the second */
/* argument to the iterator. */ /* argument to the iterator. */
/* */ /* */
/* <Return> */ /* <Return> */
/* The result (a FreeType error code) of the last iterator call. */ /* The result (a FreeType error code) of the last iterator call. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_List_Iterate( FT_List list, FT_List_Iterate( FT_List list,
FT_List_Iterator iterator, FT_List_Iterator iterator,
void* user ); void* user );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_List_Destructor */ /* FT_List_Destructor */
/* */ /* */
/* <Description> */ /* <Description> */
/* An @FT_List iterator function which is called during a list */ /* An @FT_List iterator function which is called during a list */
/* finalization by @FT_List_Finalize to destroy all elements in a */ /* finalization by @FT_List_Finalize to destroy all elements in a */
/* given list. */ /* given list. */
/* */ /* */
/* <Input> */ /* <Input> */
/* system :: The current system object. */ /* system :: The current system object. */
/* */ /* */
/* data :: The current object to destroy. */ /* data :: The current object to destroy. */
/* */ /* */
/* user :: A typeless pointer passed to @FT_List_Iterate. It can */ /* user :: A typeless pointer passed to @FT_List_Iterate. It can */
/* be used to point to the iteration's state. */ /* be used to point to the iteration's state. */
/* */ /* */
typedef void typedef void
(*FT_List_Destructor)( FT_Memory memory, (*FT_List_Destructor)( FT_Memory memory,
void* data, void* data,
void* user ); void* user );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_List_Finalize */ /* FT_List_Finalize */
/* */ /* */
/* <Description> */ /* <Description> */
/* Destroy all elements in the list as well as the list itself. */ /* Destroy all elements in the list as well as the list itself. */
/* */ /* */
/* <Input> */ /* <Input> */
/* list :: A handle to the list. */ /* list :: A handle to the list. */
/* */ /* */
/* destroy :: A list destructor that will be applied to each element */ /* destroy :: A list destructor that will be applied to each element */
/* of the list. */ /* of the list. */
/* */ /* */
/* memory :: The current memory object which handles deallocation. */ /* memory :: The current memory object which handles deallocation. */
/* */ /* */
/* user :: A user-supplied field which is passed as the last */ /* user :: A user-supplied field which is passed as the last */
/* argument to the destructor. */ /* argument to the destructor. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This function expects that all nodes added by @FT_List_Add or */ /* This function expects that all nodes added by @FT_List_Add or */
/* @FT_List_Insert have been dynamically allocated. */ /* @FT_List_Insert have been dynamically allocated. */
/* */ /* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_List_Finalize( FT_List list, FT_List_Finalize( FT_List list,
FT_List_Destructor destroy, FT_List_Destructor destroy,
FT_Memory memory, FT_Memory memory,
void* user ); void* user );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTLIST_H__ */ #endif /* __FTLIST_H__ */
/* END */ /* END */

View file

@ -1,99 +1,99 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftlzw.h */ /* ftlzw.h */
/* */ /* */
/* LZW-compressed stream support. */ /* LZW-compressed stream support. */
/* */ /* */
/* Copyright 2004, 2006 by */ /* Copyright 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTLZW_H__ #ifndef __FTLZW_H__
#define __FTLZW_H__ #define __FTLZW_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* lzw */ /* lzw */
/* */ /* */
/* <Title> */ /* <Title> */
/* LZW Streams */ /* LZW Streams */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Using LZW-compressed font files. */ /* Using LZW-compressed font files. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains the declaration of LZW-specific functions. */ /* This section contains the declaration of LZW-specific functions. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/************************************************************************ /************************************************************************
* *
* @function: * @function:
* FT_Stream_OpenLZW * FT_Stream_OpenLZW
* *
* @description: * @description:
* Open a new stream to parse LZW-compressed font files. This is * Open a new stream to parse LZW-compressed font files. This is
* mainly used to support the compressed `*.pcf.Z' fonts that come * mainly used to support the compressed `*.pcf.Z' fonts that come
* with XFree86. * with XFree86.
* *
* @input: * @input:
* stream :: The target embedding stream. * stream :: The target embedding stream.
* *
* source :: The source stream. * source :: The source stream.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* The source stream must be opened _before_ calling this function. * The source stream must be opened _before_ calling this function.
* *
* Calling the internal function `FT_Stream_Close' on the new stream will * Calling the internal function `FT_Stream_Close' on the new stream will
* *not* call `FT_Stream_Close' on the source stream. None of the stream * *not* call `FT_Stream_Close' on the source stream. None of the stream
* objects will be released to the heap. * objects will be released to the heap.
* *
* The stream implementation is very basic and resets the decompression * The stream implementation is very basic and resets the decompression
* process each time seeking backwards is needed within the stream * process each time seeking backwards is needed within the stream
* *
* In certain builds of the library, LZW compression recognition is * In certain builds of the library, LZW compression recognition is
* automatically handled when calling @FT_New_Face or @FT_Open_Face. * automatically handled when calling @FT_New_Face or @FT_Open_Face.
* This means that if no font driver is capable of handling the raw * This means that if no font driver is capable of handling the raw
* compressed file, the library will try to open a LZW stream from it * compressed file, the library will try to open a LZW stream from it
* and re-open the face with it. * and re-open the face with it.
* *
* This function may return `FT_Err_Unimplemented_Feature' if your build * This function may return `FT_Err_Unimplemented_Feature' if your build
* of FreeType was not compiled with LZW support. * of FreeType was not compiled with LZW support.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Stream_OpenLZW( FT_Stream stream, FT_Stream_OpenLZW( FT_Stream stream,
FT_Stream source ); FT_Stream source );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTLZW_H__ */ #endif /* __FTLZW_H__ */
/* END */ /* END */

View file

@ -1,274 +1,274 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftmac.h */ /* ftmac.h */
/* */ /* */
/* Additional Mac-specific API. */ /* Additional Mac-specific API. */
/* */ /* */
/* Copyright 1996-2001, 2004, 2006, 2007 by */ /* Copyright 1996-2001, 2004, 2006, 2007 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* NOTE: Include this file after <freetype/freetype.h> and after any */ /* NOTE: Include this file after <freetype/freetype.h> and after any */
/* Mac-specific headers (because this header uses Mac types such as */ /* Mac-specific headers (because this header uses Mac types such as */
/* Handle, FSSpec, FSRef, etc.) */ /* Handle, FSSpec, FSRef, etc.) */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTMAC_H__ #ifndef __FTMAC_H__
#define __FTMAC_H__ #define __FTMAC_H__
#include <ft2build.h> #include <ft2build.h>
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* gcc-3.4.1 and later can warn about functions tagged as deprecated */ /* gcc-3.4.1 and later can warn about functions tagged as deprecated */
#ifndef FT_DEPRECATED_ATTRIBUTE #ifndef FT_DEPRECATED_ATTRIBUTE
#if defined(__GNUC__) && \ #if defined(__GNUC__) && \
((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated)) #define FT_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#else #else
#define FT_DEPRECATED_ATTRIBUTE #define FT_DEPRECATED_ATTRIBUTE
#endif #endif
#endif #endif
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* mac_specific */ /* mac_specific */
/* */ /* */
/* <Title> */ /* <Title> */
/* Mac Specific Interface */ /* Mac Specific Interface */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Only available on the Macintosh. */ /* Only available on the Macintosh. */
/* */ /* */
/* <Description> */ /* <Description> */
/* The following definitions are only available if FreeType is */ /* The following definitions are only available if FreeType is */
/* compiled on a Macintosh. */ /* compiled on a Macintosh. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_New_Face_From_FOND */ /* FT_New_Face_From_FOND */
/* */ /* */
/* <Description> */ /* <Description> */
/* Create a new face object from a FOND resource. */ /* Create a new face object from a FOND resource. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* library :: A handle to the library resource. */ /* library :: A handle to the library resource. */
/* */ /* */
/* <Input> */ /* <Input> */
/* fond :: A FOND resource. */ /* fond :: A FOND resource. */
/* */ /* */
/* face_index :: Only supported for the -1 `sanity check' special */ /* face_index :: Only supported for the -1 `sanity check' special */
/* case. */ /* case. */
/* */ /* */
/* <Output> */ /* <Output> */
/* aface :: A handle to a new face object. */ /* aface :: A handle to a new face object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Notes> */ /* <Notes> */
/* This function can be used to create @FT_Face objects from fonts */ /* This function can be used to create @FT_Face objects from fonts */
/* that are installed in the system as follows. */ /* that are installed in the system as follows. */
/* */ /* */
/* { */ /* { */
/* fond = GetResource( 'FOND', fontName ); */ /* fond = GetResource( 'FOND', fontName ); */
/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */ /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
/* } */ /* } */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Face_From_FOND( FT_Library library, FT_New_Face_From_FOND( FT_Library library,
Handle fond, Handle fond,
FT_Long face_index, FT_Long face_index,
FT_Face *aface ) FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_GetFile_From_Mac_Name */ /* FT_GetFile_From_Mac_Name */
/* */ /* */
/* <Description> */ /* <Description> */
/* Return an FSSpec for the disk file containing the named font. */ /* Return an FSSpec for the disk file containing the named font. */
/* */ /* */
/* <Input> */ /* <Input> */
/* fontName :: Mac OS name of the font (e.g., Times New Roman */ /* fontName :: Mac OS name of the font (e.g., Times New Roman */
/* Bold). */ /* Bold). */
/* */ /* */
/* <Output> */ /* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */ /* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */ /* @FT_New_Face_From_FSSpec. */
/* */ /* */
/* face_index :: Index of the face. For passing to */ /* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */ /* @FT_New_Face_From_FSSpec. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_Name( const char* fontName, FT_GetFile_From_Mac_Name( const char* fontName,
FSSpec* pathSpec, FSSpec* pathSpec,
FT_Long* face_index ) FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_GetFile_From_Mac_ATS_Name */ /* FT_GetFile_From_Mac_ATS_Name */
/* */ /* */
/* <Description> */ /* <Description> */
/* Return an FSSpec for the disk file containing the named font. */ /* Return an FSSpec for the disk file containing the named font. */
/* */ /* */
/* <Input> */ /* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */ /* fontName :: Mac OS name of the font in ATS framework. */
/* */ /* */
/* <Output> */ /* <Output> */
/* pathSpec :: FSSpec to the file. For passing to */ /* pathSpec :: FSSpec to the file. For passing to */
/* @FT_New_Face_From_FSSpec. */ /* @FT_New_Face_From_FSSpec. */
/* */ /* */
/* face_index :: Index of the face. For passing to */ /* face_index :: Index of the face. For passing to */
/* @FT_New_Face_From_FSSpec. */ /* @FT_New_Face_From_FSSpec. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_GetFile_From_Mac_ATS_Name( const char* fontName, FT_GetFile_From_Mac_ATS_Name( const char* fontName,
FSSpec* pathSpec, FSSpec* pathSpec,
FT_Long* face_index ) FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_GetFilePath_From_Mac_ATS_Name */ /* FT_GetFilePath_From_Mac_ATS_Name */
/* */ /* */
/* <Description> */ /* <Description> */
/* Return a pathname of the disk file and face index for given font */ /* Return a pathname of the disk file and face index for given font */
/* name which is handled by ATS framework. */ /* name which is handled by ATS framework. */
/* */ /* */
/* <Input> */ /* <Input> */
/* fontName :: Mac OS name of the font in ATS framework. */ /* fontName :: Mac OS name of the font in ATS framework. */
/* */ /* */
/* <Output> */ /* <Output> */
/* path :: Buffer to store pathname of the file. For passing */ /* path :: Buffer to store pathname of the file. For passing */
/* to @FT_New_Face. The client must allocate this */ /* to @FT_New_Face. The client must allocate this */
/* buffer before calling this function. */ /* buffer before calling this function. */
/* */ /* */
/* maxPathSize :: Lengths of the buffer `path' that client allocated. */ /* maxPathSize :: Lengths of the buffer `path' that client allocated. */
/* */ /* */
/* face_index :: Index of the face. For passing to @FT_New_Face. */ /* face_index :: Index of the face. For passing to @FT_New_Face. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_GetFilePath_From_Mac_ATS_Name( const char* fontName, FT_GetFilePath_From_Mac_ATS_Name( const char* fontName,
UInt8* path, UInt8* path,
UInt32 maxPathSize, UInt32 maxPathSize,
FT_Long* face_index ) FT_Long* face_index )
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_New_Face_From_FSSpec */ /* FT_New_Face_From_FSSpec */
/* */ /* */
/* <Description> */ /* <Description> */
/* Create a new face object from a given resource and typeface index */ /* Create a new face object from a given resource and typeface index */
/* using an FSSpec to the font file. */ /* using an FSSpec to the font file. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* library :: A handle to the library resource. */ /* library :: A handle to the library resource. */
/* */ /* */
/* <Input> */ /* <Input> */
/* spec :: FSSpec to the font file. */ /* spec :: FSSpec to the font file. */
/* */ /* */
/* face_index :: The index of the face within the resource. The */ /* face_index :: The index of the face within the resource. The */
/* first face has index~0. */ /* first face has index~0. */
/* <Output> */ /* <Output> */
/* aface :: A handle to a new face object. */ /* aface :: A handle to a new face object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */ /* @FT_New_Face_From_FSSpec is identical to @FT_New_Face except */
/* it accepts an FSSpec instead of a path. */ /* it accepts an FSSpec instead of a path. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Face_From_FSSpec( FT_Library library, FT_New_Face_From_FSSpec( FT_Library library,
const FSSpec *spec, const FSSpec *spec,
FT_Long face_index, FT_Long face_index,
FT_Face *aface ) FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_New_Face_From_FSRef */ /* FT_New_Face_From_FSRef */
/* */ /* */
/* <Description> */ /* <Description> */
/* Create a new face object from a given resource and typeface index */ /* Create a new face object from a given resource and typeface index */
/* using an FSRef to the font file. */ /* using an FSRef to the font file. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* library :: A handle to the library resource. */ /* library :: A handle to the library resource. */
/* */ /* */
/* <Input> */ /* <Input> */
/* spec :: FSRef to the font file. */ /* spec :: FSRef to the font file. */
/* */ /* */
/* face_index :: The index of the face within the resource. The */ /* face_index :: The index of the face within the resource. The */
/* first face has index~0. */ /* first face has index~0. */
/* <Output> */ /* <Output> */
/* aface :: A handle to a new face object. */ /* aface :: A handle to a new face object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */ /* @FT_New_Face_From_FSRef is identical to @FT_New_Face except */
/* it accepts an FSRef instead of a path. */ /* it accepts an FSRef instead of a path. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Face_From_FSRef( FT_Library library, FT_New_Face_From_FSRef( FT_Library library,
const FSRef *ref, const FSRef *ref,
FT_Long face_index, FT_Long face_index,
FT_Face *aface ) FT_Face *aface )
FT_DEPRECATED_ATTRIBUTE; FT_DEPRECATED_ATTRIBUTE;
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTMAC_H__ */ #endif /* __FTMAC_H__ */
/* END */ /* END */

View file

@ -1,378 +1,378 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftmm.h */ /* ftmm.h */
/* */ /* */
/* FreeType Multiple Master font interface (specification). */ /* FreeType Multiple Master font interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ /* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTMM_H__ #ifndef __FTMM_H__
#define __FTMM_H__ #define __FTMM_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_TYPE1_TABLES_H #include FT_TYPE1_TABLES_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* multiple_masters */ /* multiple_masters */
/* */ /* */
/* <Title> */ /* <Title> */
/* Multiple Masters */ /* Multiple Masters */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* How to manage Multiple Masters fonts. */ /* How to manage Multiple Masters fonts. */
/* */ /* */
/* <Description> */ /* <Description> */
/* The following types and functions are used to manage Multiple */ /* The following types and functions are used to manage Multiple */
/* Master fonts, i.e., the selection of specific design instances by */ /* Master fonts, i.e., the selection of specific design instances by */
/* setting design axis coordinates. */ /* setting design axis coordinates. */
/* */ /* */
/* George Williams has extended this interface to make it work with */ /* George Williams has extended this interface to make it work with */
/* both Type~1 Multiple Masters fonts and GX distortable (var) */ /* both Type~1 Multiple Masters fonts and GX distortable (var) */
/* fonts. Some of these routines only work with MM fonts, others */ /* fonts. Some of these routines only work with MM fonts, others */
/* will work with both types. They are similar enough that a */ /* will work with both types. They are similar enough that a */
/* consistent interface makes sense. */ /* consistent interface makes sense. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_MM_Axis */ /* FT_MM_Axis */
/* */ /* */
/* <Description> */ /* <Description> */
/* A simple structure used to model a given axis in design space for */ /* A simple structure used to model a given axis in design space for */
/* Multiple Masters fonts. */ /* Multiple Masters fonts. */
/* */ /* */
/* This structure can't be used for GX var fonts. */ /* This structure can't be used for GX var fonts. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* name :: The axis's name. */ /* name :: The axis's name. */
/* */ /* */
/* minimum :: The axis's minimum design coordinate. */ /* minimum :: The axis's minimum design coordinate. */
/* */ /* */
/* maximum :: The axis's maximum design coordinate. */ /* maximum :: The axis's maximum design coordinate. */
/* */ /* */
typedef struct FT_MM_Axis_ typedef struct FT_MM_Axis_
{ {
FT_String* name; FT_String* name;
FT_Long minimum; FT_Long minimum;
FT_Long maximum; FT_Long maximum;
} FT_MM_Axis; } FT_MM_Axis;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_Multi_Master */ /* FT_Multi_Master */
/* */ /* */
/* <Description> */ /* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */ /* A structure used to model the axes and space of a Multiple Masters */
/* font. */ /* font. */
/* */ /* */
/* This structure can't be used for GX var fonts. */ /* This structure can't be used for GX var fonts. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* num_axis :: Number of axes. Cannot exceed~4. */ /* num_axis :: Number of axes. Cannot exceed~4. */
/* */ /* */
/* num_designs :: Number of designs; should be normally 2^num_axis */ /* num_designs :: Number of designs; should be normally 2^num_axis */
/* even though the Type~1 specification strangely */ /* even though the Type~1 specification strangely */
/* allows for intermediate designs to be present. This */ /* allows for intermediate designs to be present. This */
/* number cannot exceed~16. */ /* number cannot exceed~16. */
/* */ /* */
/* axis :: A table of axis descriptors. */ /* axis :: A table of axis descriptors. */
/* */ /* */
typedef struct FT_Multi_Master_ typedef struct FT_Multi_Master_
{ {
FT_UInt num_axis; FT_UInt num_axis;
FT_UInt num_designs; FT_UInt num_designs;
FT_MM_Axis axis[T1_MAX_MM_AXIS]; FT_MM_Axis axis[T1_MAX_MM_AXIS];
} FT_Multi_Master; } FT_Multi_Master;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_Var_Axis */ /* FT_Var_Axis */
/* */ /* */
/* <Description> */ /* <Description> */
/* A simple structure used to model a given axis in design space for */ /* A simple structure used to model a given axis in design space for */
/* Multiple Masters and GX var fonts. */ /* Multiple Masters and GX var fonts. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* name :: The axis's name. */ /* name :: The axis's name. */
/* Not always meaningful for GX. */ /* Not always meaningful for GX. */
/* */ /* */
/* minimum :: The axis's minimum design coordinate. */ /* minimum :: The axis's minimum design coordinate. */
/* */ /* */
/* def :: The axis's default design coordinate. */ /* def :: The axis's default design coordinate. */
/* FreeType computes meaningful default values for MM; it */ /* FreeType computes meaningful default values for MM; it */
/* is then an integer value, not in 16.16 format. */ /* is then an integer value, not in 16.16 format. */
/* */ /* */
/* maximum :: The axis's maximum design coordinate. */ /* maximum :: The axis's maximum design coordinate. */
/* */ /* */
/* tag :: The axis's tag (the GX equivalent to `name'). */ /* tag :: The axis's tag (the GX equivalent to `name'). */
/* FreeType provides default values for MM if possible. */ /* FreeType provides default values for MM if possible. */
/* */ /* */
/* strid :: The entry in `name' table (another GX version of */ /* strid :: The entry in `name' table (another GX version of */
/* `name'). */ /* `name'). */
/* Not meaningful for MM. */ /* Not meaningful for MM. */
/* */ /* */
typedef struct FT_Var_Axis_ typedef struct FT_Var_Axis_
{ {
FT_String* name; FT_String* name;
FT_Fixed minimum; FT_Fixed minimum;
FT_Fixed def; FT_Fixed def;
FT_Fixed maximum; FT_Fixed maximum;
FT_ULong tag; FT_ULong tag;
FT_UInt strid; FT_UInt strid;
} FT_Var_Axis; } FT_Var_Axis;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_Var_Named_Style */ /* FT_Var_Named_Style */
/* */ /* */
/* <Description> */ /* <Description> */
/* A simple structure used to model a named style in a GX var font. */ /* A simple structure used to model a named style in a GX var font. */
/* */ /* */
/* This structure can't be used for MM fonts. */ /* This structure can't be used for MM fonts. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* coords :: The design coordinates for this style. */ /* coords :: The design coordinates for this style. */
/* This is an array with one entry for each axis. */ /* This is an array with one entry for each axis. */
/* */ /* */
/* strid :: The entry in `name' table identifying this style. */ /* strid :: The entry in `name' table identifying this style. */
/* */ /* */
typedef struct FT_Var_Named_Style_ typedef struct FT_Var_Named_Style_
{ {
FT_Fixed* coords; FT_Fixed* coords;
FT_UInt strid; FT_UInt strid;
} FT_Var_Named_Style; } FT_Var_Named_Style;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_MM_Var */ /* FT_MM_Var */
/* */ /* */
/* <Description> */ /* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */ /* A structure used to model the axes and space of a Multiple Masters */
/* or GX var distortable font. */ /* or GX var distortable font. */
/* */ /* */
/* Some fields are specific to one format and not to the other. */ /* Some fields are specific to one format and not to the other. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* num_axis :: The number of axes. The maximum value is~4 for */ /* num_axis :: The number of axes. The maximum value is~4 for */
/* MM; no limit in GX. */ /* MM; no limit in GX. */
/* */ /* */
/* num_designs :: The number of designs; should be normally */ /* num_designs :: The number of designs; should be normally */
/* 2^num_axis for MM fonts. Not meaningful for GX */ /* 2^num_axis for MM fonts. Not meaningful for GX */
/* (where every glyph could have a different */ /* (where every glyph could have a different */
/* number of designs). */ /* number of designs). */
/* */ /* */
/* num_namedstyles :: The number of named styles; only meaningful for */ /* num_namedstyles :: The number of named styles; only meaningful for */
/* GX which allows certain design coordinates to */ /* GX which allows certain design coordinates to */
/* have a string ID (in the `name' table) */ /* have a string ID (in the `name' table) */
/* associated with them. The font can tell the */ /* associated with them. The font can tell the */
/* user that, for example, Weight=1.5 is `Bold'. */ /* user that, for example, Weight=1.5 is `Bold'. */
/* */ /* */
/* axis :: A table of axis descriptors. */ /* axis :: A table of axis descriptors. */
/* GX fonts contain slightly more data than MM. */ /* GX fonts contain slightly more data than MM. */
/* */ /* */
/* namedstyles :: A table of named styles. */ /* namedstyles :: A table of named styles. */
/* Only meaningful with GX. */ /* Only meaningful with GX. */
/* */ /* */
typedef struct FT_MM_Var_ typedef struct FT_MM_Var_
{ {
FT_UInt num_axis; FT_UInt num_axis;
FT_UInt num_designs; FT_UInt num_designs;
FT_UInt num_namedstyles; FT_UInt num_namedstyles;
FT_Var_Axis* axis; FT_Var_Axis* axis;
FT_Var_Named_Style* namedstyle; FT_Var_Named_Style* namedstyle;
} FT_MM_Var; } FT_MM_Var;
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_Multi_Master */ /* FT_Get_Multi_Master */
/* */ /* */
/* <Description> */ /* <Description> */
/* Retrieve the Multiple Master descriptor of a given font. */ /* Retrieve the Multiple Master descriptor of a given font. */
/* */ /* */
/* This function can't be used with GX fonts. */ /* This function can't be used with GX fonts. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* <Output> */ /* <Output> */
/* amaster :: The Multiple Masters descriptor. */ /* amaster :: The Multiple Masters descriptor. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_Multi_Master( FT_Face face, FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master *amaster ); FT_Multi_Master *amaster );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_MM_Var */ /* FT_Get_MM_Var */
/* */ /* */
/* <Description> */ /* <Description> */
/* Retrieve the Multiple Master/GX var descriptor of a given font. */ /* Retrieve the Multiple Master/GX var descriptor of a given font. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* <Output> */ /* <Output> */
/* amaster :: The Multiple Masters/GX var descriptor. */ /* amaster :: The Multiple Masters/GX var descriptor. */
/* Allocates a data structure, which the user must free */ /* Allocates a data structure, which the user must free */
/* (a single call to FT_FREE will do it). */ /* (a single call to FT_FREE will do it). */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_MM_Var( FT_Face face, FT_Get_MM_Var( FT_Face face,
FT_MM_Var* *amaster ); FT_MM_Var* *amaster );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Set_MM_Design_Coordinates */ /* FT_Set_MM_Design_Coordinates */
/* */ /* */
/* <Description> */ /* <Description> */
/* For Multiple Masters fonts, choose an interpolated font design */ /* For Multiple Masters fonts, choose an interpolated font design */
/* through design coordinates. */ /* through design coordinates. */
/* */ /* */
/* This function can't be used with GX fonts. */ /* This function can't be used with GX fonts. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* <Input> */ /* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */ /* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */ /* the number of axes in the font). */
/* */ /* */
/* coords :: An array of design coordinates. */ /* coords :: An array of design coordinates. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Set_MM_Design_Coordinates( FT_Face face, FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Long* coords ); FT_Long* coords );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Set_Var_Design_Coordinates */ /* FT_Set_Var_Design_Coordinates */
/* */ /* */
/* <Description> */ /* <Description> */
/* For Multiple Master or GX Var fonts, choose an interpolated font */ /* For Multiple Master or GX Var fonts, choose an interpolated font */
/* design through design coordinates. */ /* design through design coordinates. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* <Input> */ /* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */ /* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */ /* the number of axes in the font). */
/* */ /* */
/* coords :: An array of design coordinates. */ /* coords :: An array of design coordinates. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Set_Var_Design_Coordinates( FT_Face face, FT_Set_Var_Design_Coordinates( FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Fixed* coords ); FT_Fixed* coords );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Set_MM_Blend_Coordinates */ /* FT_Set_MM_Blend_Coordinates */
/* */ /* */
/* <Description> */ /* <Description> */
/* For Multiple Masters and GX var fonts, choose an interpolated font */ /* For Multiple Masters and GX var fonts, choose an interpolated font */
/* design through normalized blend coordinates. */ /* design through normalized blend coordinates. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* <Input> */ /* <Input> */
/* num_coords :: The number of design coordinates (must be equal to */ /* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */ /* the number of axes in the font). */
/* */ /* */
/* coords :: The design coordinates array (each element must be */ /* coords :: The design coordinates array (each element must be */
/* between 0 and 1.0). */ /* between 0 and 1.0). */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Set_MM_Blend_Coordinates( FT_Face face, FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Fixed* coords ); FT_Fixed* coords );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Set_Var_Blend_Coordinates */ /* FT_Set_Var_Blend_Coordinates */
/* */ /* */
/* <Description> */ /* <Description> */
/* This is another name of @FT_Set_MM_Blend_Coordinates. */ /* This is another name of @FT_Set_MM_Blend_Coordinates. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Set_Var_Blend_Coordinates( FT_Face face, FT_Set_Var_Blend_Coordinates( FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Fixed* coords ); FT_Fixed* coords );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTMM_H__ */ #endif /* __FTMM_H__ */
/* END */ /* END */

View file

@ -1,483 +1,483 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftmodapi.h */ /* ftmodapi.h */
/* */ /* */
/* FreeType modules public interface (specification). */ /* FreeType modules public interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTMODAPI_H__ #ifndef __FTMODAPI_H__
#define __FTMODAPI_H__ #define __FTMODAPI_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* module_management */ /* module_management */
/* */ /* */
/* <Title> */ /* <Title> */
/* Module Management */ /* Module Management */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* How to add, upgrade, and remove modules from FreeType. */ /* How to add, upgrade, and remove modules from FreeType. */
/* */ /* */
/* <Description> */ /* <Description> */
/* The definitions below are used to manage modules within FreeType. */ /* The definitions below are used to manage modules within FreeType. */
/* Modules can be added, upgraded, and removed at runtime. */ /* Modules can be added, upgraded, and removed at runtime. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/* module bit flags */ /* module bit flags */
#define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ #define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */
#define FT_MODULE_RENDERER 2 /* this module is a renderer */ #define FT_MODULE_RENDERER 2 /* this module is a renderer */
#define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ #define FT_MODULE_HINTER 4 /* this module is a glyph hinter */
#define FT_MODULE_STYLER 8 /* this module is a styler */ #define FT_MODULE_STYLER 8 /* this module is a styler */
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ #define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
/* scalable fonts */ /* scalable fonts */
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ #define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
/* support vector outlines */ /* support vector outlines */
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ #define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
/* own hinter */ /* own hinter */
/* deprecated values */ /* deprecated values */
#define ft_module_font_driver FT_MODULE_FONT_DRIVER #define ft_module_font_driver FT_MODULE_FONT_DRIVER
#define ft_module_renderer FT_MODULE_RENDERER #define ft_module_renderer FT_MODULE_RENDERER
#define ft_module_hinter FT_MODULE_HINTER #define ft_module_hinter FT_MODULE_HINTER
#define ft_module_styler FT_MODULE_STYLER #define ft_module_styler FT_MODULE_STYLER
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE #define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
#define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES #define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES
#define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER #define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER
typedef FT_Pointer FT_Module_Interface; typedef FT_Pointer FT_Module_Interface;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_Module_Constructor */ /* FT_Module_Constructor */
/* */ /* */
/* <Description> */ /* <Description> */
/* A function used to initialize (not create) a new module object. */ /* A function used to initialize (not create) a new module object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* module :: The module to initialize. */ /* module :: The module to initialize. */
/* */ /* */
typedef FT_Error typedef FT_Error
(*FT_Module_Constructor)( FT_Module module ); (*FT_Module_Constructor)( FT_Module module );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_Module_Destructor */ /* FT_Module_Destructor */
/* */ /* */
/* <Description> */ /* <Description> */
/* A function used to finalize (not destroy) a given module object. */ /* A function used to finalize (not destroy) a given module object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* module :: The module to finalize. */ /* module :: The module to finalize. */
/* */ /* */
typedef void typedef void
(*FT_Module_Destructor)( FT_Module module ); (*FT_Module_Destructor)( FT_Module module );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_Module_Requester */ /* FT_Module_Requester */
/* */ /* */
/* <Description> */ /* <Description> */
/* A function used to query a given module for a specific interface. */ /* A function used to query a given module for a specific interface. */
/* */ /* */
/* <Input> */ /* <Input> */
/* module :: The module to finalize. */ /* module :: The module to finalize. */
/* */ /* */
/* name :: The name of the interface in the module. */ /* name :: The name of the interface in the module. */
/* */ /* */
typedef FT_Module_Interface typedef FT_Module_Interface
(*FT_Module_Requester)( FT_Module module, (*FT_Module_Requester)( FT_Module module,
const char* name ); const char* name );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_Module_Class */ /* FT_Module_Class */
/* */ /* */
/* <Description> */ /* <Description> */
/* The module class descriptor. */ /* The module class descriptor. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* module_flags :: Bit flags describing the module. */ /* module_flags :: Bit flags describing the module. */
/* */ /* */
/* module_size :: The size of one module object/instance in */ /* module_size :: The size of one module object/instance in */
/* bytes. */ /* bytes. */
/* */ /* */
/* module_name :: The name of the module. */ /* module_name :: The name of the module. */
/* */ /* */
/* module_version :: The version, as a 16.16 fixed number */ /* module_version :: The version, as a 16.16 fixed number */
/* (major.minor). */ /* (major.minor). */
/* */ /* */
/* module_requires :: The version of FreeType this module requires, */ /* module_requires :: The version of FreeType this module requires, */
/* as a 16.16 fixed number (major.minor). Starts */ /* as a 16.16 fixed number (major.minor). Starts */
/* at version 2.0, i.e., 0x20000. */ /* at version 2.0, i.e., 0x20000. */
/* */ /* */
/* module_init :: The initializing function. */ /* module_init :: The initializing function. */
/* */ /* */
/* module_done :: The finalizing function. */ /* module_done :: The finalizing function. */
/* */ /* */
/* get_interface :: The interface requesting function. */ /* get_interface :: The interface requesting function. */
/* */ /* */
typedef struct FT_Module_Class_ typedef struct FT_Module_Class_
{ {
FT_ULong module_flags; FT_ULong module_flags;
FT_Long module_size; FT_Long module_size;
const FT_String* module_name; const FT_String* module_name;
FT_Fixed module_version; FT_Fixed module_version;
FT_Fixed module_requires; FT_Fixed module_requires;
const void* module_interface; const void* module_interface;
FT_Module_Constructor module_init; FT_Module_Constructor module_init;
FT_Module_Destructor module_done; FT_Module_Destructor module_done;
FT_Module_Requester get_interface; FT_Module_Requester get_interface;
} FT_Module_Class; } FT_Module_Class;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Add_Module */ /* FT_Add_Module */
/* */ /* */
/* <Description> */ /* <Description> */
/* Add a new module to a given library instance. */ /* Add a new module to a given library instance. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* library :: A handle to the library object. */ /* library :: A handle to the library object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* clazz :: A pointer to class descriptor for the module. */ /* clazz :: A pointer to class descriptor for the module. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* An error will be returned if a module already exists by that name, */ /* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */ /* or if the module requires a version of FreeType that is too great. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Add_Module( FT_Library library, FT_Add_Module( FT_Library library,
const FT_Module_Class* clazz ); const FT_Module_Class* clazz );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_Module */ /* FT_Get_Module */
/* */ /* */
/* <Description> */ /* <Description> */
/* Find a module by its name. */ /* Find a module by its name. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to the library object. */ /* library :: A handle to the library object. */
/* */ /* */
/* module_name :: The module's name (as an ASCII string). */ /* module_name :: The module's name (as an ASCII string). */
/* */ /* */
/* <Return> */ /* <Return> */
/* A module handle. 0~if none was found. */ /* A module handle. 0~if none was found. */
/* */ /* */
/* <Note> */ /* <Note> */
/* FreeType's internal modules aren't documented very well, and you */ /* FreeType's internal modules aren't documented very well, and you */
/* should look up the source code for details. */ /* should look up the source code for details. */
/* */ /* */
FT_EXPORT( FT_Module ) FT_EXPORT( FT_Module )
FT_Get_Module( FT_Library library, FT_Get_Module( FT_Library library,
const char* module_name ); const char* module_name );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Remove_Module */ /* FT_Remove_Module */
/* */ /* */
/* <Description> */ /* <Description> */
/* Remove a given module from a library instance. */ /* Remove a given module from a library instance. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* library :: A handle to a library object. */ /* library :: A handle to a library object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* module :: A handle to a module object. */ /* module :: A handle to a module object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The module object is destroyed by the function in case of success. */ /* The module object is destroyed by the function in case of success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Remove_Module( FT_Library library, FT_Remove_Module( FT_Library library,
FT_Module module ); FT_Module module );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Reference_Library */ /* FT_Reference_Library */
/* */ /* */
/* <Description> */ /* <Description> */
/* A counter gets initialized to~1 at the time an @FT_Library */ /* A counter gets initialized to~1 at the time an @FT_Library */
/* structure is created. This function increments the counter. */ /* structure is created. This function increments the counter. */
/* @FT_Done_Library then only destroys a library if the counter is~1, */ /* @FT_Done_Library then only destroys a library if the counter is~1, */
/* otherwise it simply decrements the counter. */ /* otherwise it simply decrements the counter. */
/* */ /* */
/* This function helps in managing life-cycles of structures which */ /* This function helps in managing life-cycles of structures which */
/* reference @FT_Library objects. */ /* reference @FT_Library objects. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to a target library object. */ /* library :: A handle to a target library object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Since> */ /* <Since> */
/* 2.4.2 */ /* 2.4.2 */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Reference_Library( FT_Library library ); FT_Reference_Library( FT_Library library );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_New_Library */ /* FT_New_Library */
/* */ /* */
/* <Description> */ /* <Description> */
/* This function is used to create a new FreeType library instance */ /* This function is used to create a new FreeType library instance */
/* from a given memory object. It is thus possible to use libraries */ /* from a given memory object. It is thus possible to use libraries */
/* with distinct memory allocators within the same program. */ /* with distinct memory allocators within the same program. */
/* */ /* */
/* Normally, you would call this function (followed by a call to */ /* Normally, you would call this function (followed by a call to */
/* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */
/* instead of @FT_Init_FreeType to initialize the FreeType library. */ /* instead of @FT_Init_FreeType to initialize the FreeType library. */
/* */ /* */
/* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */
/* library instance. */ /* library instance. */
/* */ /* */
/* <Input> */ /* <Input> */
/* memory :: A handle to the original memory object. */ /* memory :: A handle to the original memory object. */
/* */ /* */
/* <Output> */ /* <Output> */
/* alibrary :: A pointer to handle of a new library object. */ /* alibrary :: A pointer to handle of a new library object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* See the discussion of reference counters in the description of */ /* See the discussion of reference counters in the description of */
/* @FT_Reference_Library. */ /* @FT_Reference_Library. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Library( FT_Memory memory, FT_New_Library( FT_Memory memory,
FT_Library *alibrary ); FT_Library *alibrary );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Done_Library */ /* FT_Done_Library */
/* */ /* */
/* <Description> */ /* <Description> */
/* Discard a given library object. This closes all drivers and */ /* Discard a given library object. This closes all drivers and */
/* discards all resource objects. */ /* discards all resource objects. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to the target library. */ /* library :: A handle to the target library. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* See the discussion of reference counters in the description of */ /* See the discussion of reference counters in the description of */
/* @FT_Reference_Library. */ /* @FT_Reference_Library. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Done_Library( FT_Library library ); FT_Done_Library( FT_Library library );
/* */ /* */
typedef void typedef void
(*FT_DebugHook_Func)( void* arg ); (*FT_DebugHook_Func)( void* arg );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Set_Debug_Hook */ /* FT_Set_Debug_Hook */
/* */ /* */
/* <Description> */ /* <Description> */
/* Set a debug hook function for debugging the interpreter of a font */ /* Set a debug hook function for debugging the interpreter of a font */
/* format. */ /* format. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* library :: A handle to the library object. */ /* library :: A handle to the library object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* hook_index :: The index of the debug hook. You should use the */ /* hook_index :: The index of the debug hook. You should use the */
/* values defined in `ftobjs.h', e.g., */ /* values defined in `ftobjs.h', e.g., */
/* `FT_DEBUG_HOOK_TRUETYPE'. */ /* `FT_DEBUG_HOOK_TRUETYPE'. */
/* */ /* */
/* debug_hook :: The function used to debug the interpreter. */ /* debug_hook :: The function used to debug the interpreter. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Currently, four debug hook slots are available, but only two (for */ /* Currently, four debug hook slots are available, but only two (for */
/* the TrueType and the Type~1 interpreter) are defined. */ /* the TrueType and the Type~1 interpreter) are defined. */
/* */ /* */
/* Since the internal headers of FreeType are no longer installed, */ /* Since the internal headers of FreeType are no longer installed, */
/* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */
/* This is a bug and will be fixed in a forthcoming release. */ /* This is a bug and will be fixed in a forthcoming release. */
/* */ /* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Set_Debug_Hook( FT_Library library, FT_Set_Debug_Hook( FT_Library library,
FT_UInt hook_index, FT_UInt hook_index,
FT_DebugHook_Func debug_hook ); FT_DebugHook_Func debug_hook );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Add_Default_Modules */ /* FT_Add_Default_Modules */
/* */ /* */
/* <Description> */ /* <Description> */
/* Add the set of default drivers to a given library object. */ /* Add the set of default drivers to a given library object. */
/* This is only useful when you create a library object with */ /* This is only useful when you create a library object with */
/* @FT_New_Library (usually to plug a custom memory manager). */ /* @FT_New_Library (usually to plug a custom memory manager). */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* library :: A handle to a new library object. */ /* library :: A handle to a new library object. */
/* */ /* */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Add_Default_Modules( FT_Library library ); FT_Add_Default_Modules( FT_Library library );
/************************************************************************** /**************************************************************************
* *
* @section: * @section:
* truetype_engine * truetype_engine
* *
* @title: * @title:
* The TrueType Engine * The TrueType Engine
* *
* @abstract: * @abstract:
* TrueType bytecode support. * TrueType bytecode support.
* *
* @description: * @description:
* This section contains a function used to query the level of TrueType * This section contains a function used to query the level of TrueType
* bytecode support compiled in this version of the library. * bytecode support compiled in this version of the library.
* *
*/ */
/************************************************************************** /**************************************************************************
* *
* @enum: * @enum:
* FT_TrueTypeEngineType * FT_TrueTypeEngineType
* *
* @description: * @description:
* A list of values describing which kind of TrueType bytecode * A list of values describing which kind of TrueType bytecode
* engine is implemented in a given FT_Library instance. It is used * engine is implemented in a given FT_Library instance. It is used
* by the @FT_Get_TrueType_Engine_Type function. * by the @FT_Get_TrueType_Engine_Type function.
* *
* @values: * @values:
* FT_TRUETYPE_ENGINE_TYPE_NONE :: * FT_TRUETYPE_ENGINE_TYPE_NONE ::
* The library doesn't implement any kind of bytecode interpreter. * The library doesn't implement any kind of bytecode interpreter.
* *
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED :: * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
* The library implements a bytecode interpreter that doesn't * The library implements a bytecode interpreter that doesn't
* support the patented operations of the TrueType virtual machine. * support the patented operations of the TrueType virtual machine.
* *
* Its main use is to load certain Asian fonts which position and * Its main use is to load certain Asian fonts which position and
* scale glyph components with bytecode instructions. It produces * scale glyph components with bytecode instructions. It produces
* bad output for most other fonts. * bad output for most other fonts.
* *
* FT_TRUETYPE_ENGINE_TYPE_PATENTED :: * FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
* The library implements a bytecode interpreter that covers * The library implements a bytecode interpreter that covers
* the full instruction set of the TrueType virtual machine (this * the full instruction set of the TrueType virtual machine (this
* was governed by patents until May 2010, hence the name). * was governed by patents until May 2010, hence the name).
* *
* @since: * @since:
* 2.2 * 2.2
* *
*/ */
typedef enum FT_TrueTypeEngineType_ typedef enum FT_TrueTypeEngineType_
{ {
FT_TRUETYPE_ENGINE_TYPE_NONE = 0, FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
FT_TRUETYPE_ENGINE_TYPE_PATENTED FT_TRUETYPE_ENGINE_TYPE_PATENTED
} FT_TrueTypeEngineType; } FT_TrueTypeEngineType;
/************************************************************************** /**************************************************************************
* *
* @func: * @func:
* FT_Get_TrueType_Engine_Type * FT_Get_TrueType_Engine_Type
* *
* @description: * @description:
* Return an @FT_TrueTypeEngineType value to indicate which level of * Return an @FT_TrueTypeEngineType value to indicate which level of
* the TrueType virtual machine a given library instance supports. * the TrueType virtual machine a given library instance supports.
* *
* @input: * @input:
* library :: * library ::
* A library instance. * A library instance.
* *
* @return: * @return:
* A value indicating which level is supported. * A value indicating which level is supported.
* *
* @since: * @since:
* 2.2 * 2.2
* *
*/ */
FT_EXPORT( FT_TrueTypeEngineType ) FT_EXPORT( FT_TrueTypeEngineType )
FT_Get_TrueType_Engine_Type( FT_Library library ); FT_Get_TrueType_Engine_Type( FT_Library library );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTMODAPI_H__ */ #endif /* __FTMODAPI_H__ */
/* END */ /* END */

View file

@ -1,155 +1,156 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftmoderr.h */ /* ftmoderr.h */
/* */ /* */
/* FreeType module error offsets (specification). */ /* FreeType module error offsets (specification). */
/* */ /* */
/* Copyright 2001, 2002, 2003, 2004, 2005 by */ /* Copyright 2001, 2002, 2003, 2004, 2005, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This file is used to define the FreeType module error offsets. */ /* This file is used to define the FreeType module error offsets. */
/* */ /* */
/* The lower byte gives the error code, the higher byte gives the */ /* The lower byte gives the error code, the higher byte gives the */
/* module. The base module has error offset 0. For example, the error */ /* module. The base module has error offset 0. For example, the error */
/* `FT_Err_Invalid_File_Format' has value 0x003, the error */ /* `FT_Err_Invalid_File_Format' has value 0x003, the error */
/* `TT_Err_Invalid_File_Format' has value 0x1103, the error */ /* `TT_Err_Invalid_File_Format' has value 0x1103, the error */
/* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */ /* `T1_Err_Invalid_File_Format' has value 0x1203, etc. */
/* */ /* */
/* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */ /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h */
/* to make the higher byte always zero (disabling the module error */ /* to make the higher byte always zero (disabling the module error */
/* mechanism). */ /* mechanism). */
/* */ /* */
/* It can also be used to create a module error message table easily */ /* It can also be used to create a module error message table easily */
/* with something like */ /* with something like */
/* */ /* */
/* { */ /* { */
/* #undef __FTMODERR_H__ */ /* #undef __FTMODERR_H__ */
/* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */ /* #define FT_MODERRDEF( e, v, s ) { FT_Mod_Err_ ## e, s }, */
/* #define FT_MODERR_START_LIST { */ /* #define FT_MODERR_START_LIST { */
/* #define FT_MODERR_END_LIST { 0, 0 } }; */ /* #define FT_MODERR_END_LIST { 0, 0 } }; */
/* */ /* */
/* const struct */ /* const struct */
/* { */ /* { */
/* int mod_err_offset; */ /* int mod_err_offset; */
/* const char* mod_err_msg */ /* const char* mod_err_msg */
/* } ft_mod_errors[] = */ /* } ft_mod_errors[] = */
/* */ /* */
/* #include FT_MODULE_ERRORS_H */ /* #include FT_MODULE_ERRORS_H */
/* } */ /* } */
/* */ /* */
/* To use such a table, all errors must be ANDed with 0xFF00 to remove */ /* To use such a table, all errors must be ANDed with 0xFF00 to remove */
/* the error code. */ /* the error code. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTMODERR_H__ #ifndef __FTMODERR_H__
#define __FTMODERR_H__ #define __FTMODERR_H__
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
/***** SETUP MACROS *****/ /***** SETUP MACROS *****/
/***** *****/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#undef FT_NEED_EXTERN_C #undef FT_NEED_EXTERN_C
#ifndef FT_MODERRDEF #ifndef FT_MODERRDEF
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v, #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
#else #else
#define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0, #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
#endif #endif
#define FT_MODERR_START_LIST enum { #define FT_MODERR_START_LIST enum {
#define FT_MODERR_END_LIST FT_Mod_Err_Max }; #define FT_MODERR_END_LIST FT_Mod_Err_Max };
#ifdef __cplusplus #ifdef __cplusplus
#define FT_NEED_EXTERN_C #define FT_NEED_EXTERN_C
extern "C" { extern "C" {
#endif #endif
#endif /* !FT_MODERRDEF */ #endif /* !FT_MODERRDEF */
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
/***** LIST MODULE ERROR BASES *****/ /***** LIST MODULE ERROR BASES *****/
/***** *****/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#ifdef FT_MODERR_START_LIST #ifdef FT_MODERR_START_LIST
FT_MODERR_START_LIST FT_MODERR_START_LIST
#endif #endif
FT_MODERRDEF( Base, 0x000, "base module" ) FT_MODERRDEF( Base, 0x000, "base module" )
FT_MODERRDEF( Autofit, 0x100, "autofitter module" ) FT_MODERRDEF( Autofit, 0x100, "autofitter module" )
FT_MODERRDEF( BDF, 0x200, "BDF module" ) FT_MODERRDEF( BDF, 0x200, "BDF module" )
FT_MODERRDEF( Cache, 0x300, "cache module" ) FT_MODERRDEF( Bzip2, 0x300, "Bzip2 module" )
FT_MODERRDEF( CFF, 0x400, "CFF module" ) FT_MODERRDEF( Cache, 0x400, "cache module" )
FT_MODERRDEF( CID, 0x500, "CID module" ) FT_MODERRDEF( CFF, 0x500, "CFF module" )
FT_MODERRDEF( Gzip, 0x600, "Gzip module" ) FT_MODERRDEF( CID, 0x600, "CID module" )
FT_MODERRDEF( LZW, 0x700, "LZW module" ) FT_MODERRDEF( Gzip, 0x700, "Gzip module" )
FT_MODERRDEF( OTvalid, 0x800, "OpenType validation module" ) FT_MODERRDEF( LZW, 0x800, "LZW module" )
FT_MODERRDEF( PCF, 0x900, "PCF module" ) FT_MODERRDEF( OTvalid, 0x900, "OpenType validation module" )
FT_MODERRDEF( PFR, 0xA00, "PFR module" ) FT_MODERRDEF( PCF, 0xA00, "PCF module" )
FT_MODERRDEF( PSaux, 0xB00, "PS auxiliary module" ) FT_MODERRDEF( PFR, 0xB00, "PFR module" )
FT_MODERRDEF( PShinter, 0xC00, "PS hinter module" ) FT_MODERRDEF( PSaux, 0xC00, "PS auxiliary module" )
FT_MODERRDEF( PSnames, 0xD00, "PS names module" ) FT_MODERRDEF( PShinter, 0xD00, "PS hinter module" )
FT_MODERRDEF( Raster, 0xE00, "raster module" ) FT_MODERRDEF( PSnames, 0xE00, "PS names module" )
FT_MODERRDEF( SFNT, 0xF00, "SFNT module" ) FT_MODERRDEF( Raster, 0xF00, "raster module" )
FT_MODERRDEF( Smooth, 0x1000, "smooth raster module" ) FT_MODERRDEF( SFNT, 0x1000, "SFNT module" )
FT_MODERRDEF( TrueType, 0x1100, "TrueType module" ) FT_MODERRDEF( Smooth, 0x1100, "smooth raster module" )
FT_MODERRDEF( Type1, 0x1200, "Type 1 module" ) FT_MODERRDEF( TrueType, 0x1200, "TrueType module" )
FT_MODERRDEF( Type42, 0x1300, "Type 42 module" ) FT_MODERRDEF( Type1, 0x1300, "Type 1 module" )
FT_MODERRDEF( Winfonts, 0x1400, "Windows FON/FNT module" ) FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
#ifdef FT_MODERR_END_LIST
FT_MODERR_END_LIST #ifdef FT_MODERR_END_LIST
#endif FT_MODERR_END_LIST
#endif
/*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /*******************************************************************/
/***** CLEANUP *****/ /***** *****/
/***** *****/ /***** CLEANUP *****/
/*******************************************************************/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/
#ifdef FT_NEED_EXTERN_C
} #ifdef FT_NEED_EXTERN_C
#endif }
#endif
#undef FT_MODERR_START_LIST
#undef FT_MODERR_END_LIST #undef FT_MODERR_START_LIST
#undef FT_MODERRDEF #undef FT_MODERR_END_LIST
#undef FT_NEED_EXTERN_C #undef FT_MODERRDEF
#undef FT_NEED_EXTERN_C
#endif /* __FTMODERR_H__ */
#endif /* __FTMODERR_H__ */
/* END */
/* END */

View file

@ -1,203 +1,203 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftotval.h */ /* ftotval.h */
/* */ /* */
/* FreeType API for validating OpenType tables (specification). */ /* FreeType API for validating OpenType tables (specification). */
/* */ /* */
/* Copyright 2004, 2005, 2006, 2007 by */ /* Copyright 2004, 2005, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* */ /* */
/* Warning: This module might be moved to a different library in the */ /* Warning: This module might be moved to a different library in the */
/* future to avoid a tight dependency between FreeType and the */ /* future to avoid a tight dependency between FreeType and the */
/* OpenType specification. */ /* OpenType specification. */
/* */ /* */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTOTVAL_H__ #ifndef __FTOTVAL_H__
#define __FTOTVAL_H__ #define __FTOTVAL_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* ot_validation */ /* ot_validation */
/* */ /* */
/* <Title> */ /* <Title> */
/* OpenType Validation */ /* OpenType Validation */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* An API to validate OpenType tables. */ /* An API to validate OpenType tables. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains the declaration of functions to validate */ /* This section contains the declaration of functions to validate */
/* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */ /* some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/********************************************************************** /**********************************************************************
* *
* @enum: * @enum:
* FT_VALIDATE_OTXXX * FT_VALIDATE_OTXXX
* *
* @description: * @description:
* A list of bit-field constants used with @FT_OpenType_Validate to * A list of bit-field constants used with @FT_OpenType_Validate to
* indicate which OpenType tables should be validated. * indicate which OpenType tables should be validated.
* *
* @values: * @values:
* FT_VALIDATE_BASE :: * FT_VALIDATE_BASE ::
* Validate BASE table. * Validate BASE table.
* *
* FT_VALIDATE_GDEF :: * FT_VALIDATE_GDEF ::
* Validate GDEF table. * Validate GDEF table.
* *
* FT_VALIDATE_GPOS :: * FT_VALIDATE_GPOS ::
* Validate GPOS table. * Validate GPOS table.
* *
* FT_VALIDATE_GSUB :: * FT_VALIDATE_GSUB ::
* Validate GSUB table. * Validate GSUB table.
* *
* FT_VALIDATE_JSTF :: * FT_VALIDATE_JSTF ::
* Validate JSTF table. * Validate JSTF table.
* *
* FT_VALIDATE_MATH :: * FT_VALIDATE_MATH ::
* Validate MATH table. * Validate MATH table.
* *
* FT_VALIDATE_OT :: * FT_VALIDATE_OT ::
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). * Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
* *
*/ */
#define FT_VALIDATE_BASE 0x0100 #define FT_VALIDATE_BASE 0x0100
#define FT_VALIDATE_GDEF 0x0200 #define FT_VALIDATE_GDEF 0x0200
#define FT_VALIDATE_GPOS 0x0400 #define FT_VALIDATE_GPOS 0x0400
#define FT_VALIDATE_GSUB 0x0800 #define FT_VALIDATE_GSUB 0x0800
#define FT_VALIDATE_JSTF 0x1000 #define FT_VALIDATE_JSTF 0x1000
#define FT_VALIDATE_MATH 0x2000 #define FT_VALIDATE_MATH 0x2000
#define FT_VALIDATE_OT FT_VALIDATE_BASE | \ #define FT_VALIDATE_OT FT_VALIDATE_BASE | \
FT_VALIDATE_GDEF | \ FT_VALIDATE_GDEF | \
FT_VALIDATE_GPOS | \ FT_VALIDATE_GPOS | \
FT_VALIDATE_GSUB | \ FT_VALIDATE_GSUB | \
FT_VALIDATE_JSTF | \ FT_VALIDATE_JSTF | \
FT_VALIDATE_MATH FT_VALIDATE_MATH
/* */ /* */
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_OpenType_Validate * FT_OpenType_Validate
* *
* @description: * @description:
* Validate various OpenType tables to assure that all offsets and * Validate various OpenType tables to assure that all offsets and
* indices are valid. The idea is that a higher-level library which * indices are valid. The idea is that a higher-level library which
* actually does the text layout can access those tables without * actually does the text layout can access those tables without
* error checking (which can be quite time consuming). * error checking (which can be quite time consuming).
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* validation_flags :: * validation_flags ::
* A bit field which specifies the tables to be validated. See * A bit field which specifies the tables to be validated. See
* @FT_VALIDATE_OTXXX for possible values. * @FT_VALIDATE_OTXXX for possible values.
* *
* @output: * @output:
* BASE_table :: * BASE_table ::
* A pointer to the BASE table. * A pointer to the BASE table.
* *
* GDEF_table :: * GDEF_table ::
* A pointer to the GDEF table. * A pointer to the GDEF table.
* *
* GPOS_table :: * GPOS_table ::
* A pointer to the GPOS table. * A pointer to the GPOS table.
* *
* GSUB_table :: * GSUB_table ::
* A pointer to the GSUB table. * A pointer to the GSUB table.
* *
* JSTF_table :: * JSTF_table ::
* A pointer to the JSTF table. * A pointer to the JSTF table.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with OpenType fonts, returning an error * This function only works with OpenType fonts, returning an error
* otherwise. * otherwise.
* *
* After use, the application should deallocate the five tables with * After use, the application should deallocate the five tables with
* @FT_OpenType_Free. A NULL value indicates that the table either * @FT_OpenType_Free. A NULL value indicates that the table either
* doesn't exist in the font, or the application hasn't asked for * doesn't exist in the font, or the application hasn't asked for
* validation. * validation.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_OpenType_Validate( FT_Face face, FT_OpenType_Validate( FT_Face face,
FT_UInt validation_flags, FT_UInt validation_flags,
FT_Bytes *BASE_table, FT_Bytes *BASE_table,
FT_Bytes *GDEF_table, FT_Bytes *GDEF_table,
FT_Bytes *GPOS_table, FT_Bytes *GPOS_table,
FT_Bytes *GSUB_table, FT_Bytes *GSUB_table,
FT_Bytes *JSTF_table ); FT_Bytes *JSTF_table );
/* */ /* */
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_OpenType_Free * FT_OpenType_Free
* *
* @description: * @description:
* Free the buffer allocated by OpenType validator. * Free the buffer allocated by OpenType validator.
* *
* @input: * @input:
* face :: * face ::
* A handle to the input face. * A handle to the input face.
* *
* table :: * table ::
* The pointer to the buffer that is allocated by * The pointer to the buffer that is allocated by
* @FT_OpenType_Validate. * @FT_OpenType_Validate.
* *
* @note: * @note:
* This function must be used to free the buffer allocated by * This function must be used to free the buffer allocated by
* @FT_OpenType_Validate only. * @FT_OpenType_Validate only.
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_OpenType_Free( FT_Face face, FT_OpenType_Free( FT_Face face,
FT_Bytes table ); FT_Bytes table );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTOTVAL_H__ */ #endif /* __FTOTVAL_H__ */
/* END */ /* END */

File diff suppressed because it is too large Load diff

View file

@ -1,172 +1,172 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftpfr.h */ /* ftpfr.h */
/* */ /* */
/* FreeType API for accessing PFR-specific data (specification only). */ /* FreeType API for accessing PFR-specific data (specification only). */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */ /* Copyright 2002, 2003, 2004, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTPFR_H__ #ifndef __FTPFR_H__
#define __FTPFR_H__ #define __FTPFR_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* pfr_fonts */ /* pfr_fonts */
/* */ /* */
/* <Title> */ /* <Title> */
/* PFR Fonts */ /* PFR Fonts */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* PFR/TrueDoc specific API. */ /* PFR/TrueDoc specific API. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains the declaration of PFR-specific functions. */ /* This section contains the declaration of PFR-specific functions. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_PFR_Metrics * FT_Get_PFR_Metrics
* *
* @description: * @description:
* Return the outline and metrics resolutions of a given PFR face. * Return the outline and metrics resolutions of a given PFR face.
* *
* @input: * @input:
* face :: Handle to the input face. It can be a non-PFR face. * face :: Handle to the input face. It can be a non-PFR face.
* *
* @output: * @output:
* aoutline_resolution :: * aoutline_resolution ::
* Outline resolution. This is equivalent to `face->units_per_EM' * Outline resolution. This is equivalent to `face->units_per_EM'
* for non-PFR fonts. Optional (parameter can be NULL). * for non-PFR fonts. Optional (parameter can be NULL).
* *
* ametrics_resolution :: * ametrics_resolution ::
* Metrics resolution. This is equivalent to `outline_resolution' * Metrics resolution. This is equivalent to `outline_resolution'
* for non-PFR fonts. Optional (parameter can be NULL). * for non-PFR fonts. Optional (parameter can be NULL).
* *
* ametrics_x_scale :: * ametrics_x_scale ::
* A 16.16 fixed-point number used to scale distance expressed * A 16.16 fixed-point number used to scale distance expressed
* in metrics units to device sub-pixels. This is equivalent to * in metrics units to device sub-pixels. This is equivalent to
* `face->size->x_scale', but for metrics only. Optional (parameter * `face->size->x_scale', but for metrics only. Optional (parameter
* can be NULL). * can be NULL).
* *
* ametrics_y_scale :: * ametrics_y_scale ::
* Same as `ametrics_x_scale' but for the vertical direction. * Same as `ametrics_x_scale' but for the vertical direction.
* optional (parameter can be NULL). * optional (parameter can be NULL).
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* If the input face is not a PFR, this function will return an error. * If the input face is not a PFR, this function will return an error.
* However, in all cases, it will return valid values. * However, in all cases, it will return valid values.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_PFR_Metrics( FT_Face face, FT_Get_PFR_Metrics( FT_Face face,
FT_UInt *aoutline_resolution, FT_UInt *aoutline_resolution,
FT_UInt *ametrics_resolution, FT_UInt *ametrics_resolution,
FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_x_scale,
FT_Fixed *ametrics_y_scale ); FT_Fixed *ametrics_y_scale );
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_PFR_Kerning * FT_Get_PFR_Kerning
* *
* @description: * @description:
* Return the kerning pair corresponding to two glyphs in a PFR face. * Return the kerning pair corresponding to two glyphs in a PFR face.
* The distance is expressed in metrics units, unlike the result of * The distance is expressed in metrics units, unlike the result of
* @FT_Get_Kerning. * @FT_Get_Kerning.
* *
* @input: * @input:
* face :: A handle to the input face. * face :: A handle to the input face.
* *
* left :: Index of the left glyph. * left :: Index of the left glyph.
* *
* right :: Index of the right glyph. * right :: Index of the right glyph.
* *
* @output: * @output:
* avector :: A kerning vector. * avector :: A kerning vector.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function always return distances in original PFR metrics * This function always return distances in original PFR metrics
* units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED * units. This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED
* mode, which always returns distances converted to outline units. * mode, which always returns distances converted to outline units.
* *
* You can use the value of the `x_scale' and `y_scale' parameters * You can use the value of the `x_scale' and `y_scale' parameters
* returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels. * returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_PFR_Kerning( FT_Face face, FT_Get_PFR_Kerning( FT_Face face,
FT_UInt left, FT_UInt left,
FT_UInt right, FT_UInt right,
FT_Vector *avector ); FT_Vector *avector );
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_PFR_Advance * FT_Get_PFR_Advance
* *
* @description: * @description:
* Return a given glyph advance, expressed in original metrics units, * Return a given glyph advance, expressed in original metrics units,
* from a PFR font. * from a PFR font.
* *
* @input: * @input:
* face :: A handle to the input face. * face :: A handle to the input face.
* *
* gindex :: The glyph index. * gindex :: The glyph index.
* *
* @output: * @output:
* aadvance :: The glyph advance in metrics units. * aadvance :: The glyph advance in metrics units.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics * You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics
* to convert the advance to device sub-pixels (i.e., 1/64th of pixels). * to convert the advance to device sub-pixels (i.e., 1/64th of pixels).
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_PFR_Advance( FT_Face face, FT_Get_PFR_Advance( FT_Face face,
FT_UInt gindex, FT_UInt gindex,
FT_Pos *aadvance ); FT_Pos *aadvance );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTPFR_H__ */ #endif /* __FTPFR_H__ */
/* END */ /* END */

View file

@ -1,230 +1,238 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftrender.h */ /* ftrender.h */
/* */ /* */
/* FreeType renderer modules public interface (specification). */ /* FreeType renderer modules public interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2005, 2006, 2010 by */ /* Copyright 1996-2001, 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTRENDER_H__ #ifndef __FTRENDER_H__
#define __FTRENDER_H__ #define __FTRENDER_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_MODULE_H #include FT_MODULE_H
#include FT_GLYPH_H #include FT_GLYPH_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* module_management */ /* module_management */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/* create a new glyph object */ /* create a new glyph object */
typedef FT_Error typedef FT_Error
(*FT_Glyph_InitFunc)( FT_Glyph glyph, (*FT_Glyph_InitFunc)( FT_Glyph glyph,
FT_GlyphSlot slot ); FT_GlyphSlot slot );
/* destroys a given glyph object */ /* destroys a given glyph object */
typedef void typedef void
(*FT_Glyph_DoneFunc)( FT_Glyph glyph ); (*FT_Glyph_DoneFunc)( FT_Glyph glyph );
typedef void typedef void
(*FT_Glyph_TransformFunc)( FT_Glyph glyph, (*FT_Glyph_TransformFunc)( FT_Glyph glyph,
const FT_Matrix* matrix, const FT_Matrix* matrix,
const FT_Vector* delta ); const FT_Vector* delta );
typedef void typedef void
(*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph, (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
FT_BBox* abbox ); FT_BBox* abbox );
typedef FT_Error typedef FT_Error
(*FT_Glyph_CopyFunc)( FT_Glyph source, (*FT_Glyph_CopyFunc)( FT_Glyph source,
FT_Glyph target ); FT_Glyph target );
typedef FT_Error typedef FT_Error
(*FT_Glyph_PrepareFunc)( FT_Glyph glyph, (*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
FT_GlyphSlot slot ); FT_GlyphSlot slot );
/* deprecated */ /* deprecated */
#define FT_Glyph_Init_Func FT_Glyph_InitFunc #define FT_Glyph_Init_Func FT_Glyph_InitFunc
#define FT_Glyph_Done_Func FT_Glyph_DoneFunc #define FT_Glyph_Done_Func FT_Glyph_DoneFunc
#define FT_Glyph_Transform_Func FT_Glyph_TransformFunc #define FT_Glyph_Transform_Func FT_Glyph_TransformFunc
#define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc #define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc
#define FT_Glyph_Copy_Func FT_Glyph_CopyFunc #define FT_Glyph_Copy_Func FT_Glyph_CopyFunc
#define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc #define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc
struct FT_Glyph_Class_ struct FT_Glyph_Class_
{ {
FT_Long glyph_size; FT_Long glyph_size;
FT_Glyph_Format glyph_format; FT_Glyph_Format glyph_format;
FT_Glyph_InitFunc glyph_init; FT_Glyph_InitFunc glyph_init;
FT_Glyph_DoneFunc glyph_done; FT_Glyph_DoneFunc glyph_done;
FT_Glyph_CopyFunc glyph_copy; FT_Glyph_CopyFunc glyph_copy;
FT_Glyph_TransformFunc glyph_transform; FT_Glyph_TransformFunc glyph_transform;
FT_Glyph_GetBBoxFunc glyph_bbox; FT_Glyph_GetBBoxFunc glyph_bbox;
FT_Glyph_PrepareFunc glyph_prepare; FT_Glyph_PrepareFunc glyph_prepare;
}; };
typedef FT_Error typedef FT_Error
(*FT_Renderer_RenderFunc)( FT_Renderer renderer, (*FT_Renderer_RenderFunc)( FT_Renderer renderer,
FT_GlyphSlot slot, FT_GlyphSlot slot,
FT_UInt mode, FT_UInt mode,
const FT_Vector* origin ); const FT_Vector* origin );
typedef FT_Error typedef FT_Error
(*FT_Renderer_TransformFunc)( FT_Renderer renderer, (*FT_Renderer_TransformFunc)( FT_Renderer renderer,
FT_GlyphSlot slot, FT_GlyphSlot slot,
const FT_Matrix* matrix, const FT_Matrix* matrix,
const FT_Vector* delta ); const FT_Vector* delta );
typedef void typedef void
(*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer, (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
FT_GlyphSlot slot, FT_GlyphSlot slot,
FT_BBox* cbox ); FT_BBox* cbox );
typedef FT_Error typedef FT_Error
(*FT_Renderer_SetModeFunc)( FT_Renderer renderer, (*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
FT_ULong mode_tag, FT_ULong mode_tag,
FT_Pointer mode_ptr ); FT_Pointer mode_ptr );
/* deprecated identifiers */ /* deprecated identifiers */
#define FTRenderer_render FT_Renderer_RenderFunc #define FTRenderer_render FT_Renderer_RenderFunc
#define FTRenderer_transform FT_Renderer_TransformFunc #define FTRenderer_transform FT_Renderer_TransformFunc
#define FTRenderer_getCBox FT_Renderer_GetCBoxFunc #define FTRenderer_getCBox FT_Renderer_GetCBoxFunc
#define FTRenderer_setMode FT_Renderer_SetModeFunc #define FTRenderer_setMode FT_Renderer_SetModeFunc
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_Renderer_Class */ /* FT_Renderer_Class */
/* */ /* */
/* <Description> */ /* <Description> */
/* The renderer module class descriptor. */ /* The renderer module class descriptor. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* root :: The root @FT_Module_Class fields. */ /* root :: The root @FT_Module_Class fields. */
/* */ /* */
/* glyph_format :: The glyph image format this renderer handles. */ /* glyph_format :: The glyph image format this renderer handles. */
/* */ /* */
/* render_glyph :: A method used to render the image that is in a */ /* render_glyph :: A method used to render the image that is in a */
/* given glyph slot into a bitmap. */ /* given glyph slot into a bitmap. */
/* */ /* */
/* transform_glyph :: A method used to transform the image that is in */ /* transform_glyph :: A method used to transform the image that is in */
/* a given glyph slot. */ /* a given glyph slot. */
/* */ /* */
/* get_glyph_cbox :: A method used to access the glyph's cbox. */ /* get_glyph_cbox :: A method used to access the glyph's cbox. */
/* */ /* */
/* set_mode :: A method used to pass additional parameters. */ /* set_mode :: A method used to pass additional parameters. */
/* */ /* */
/* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
/* This is a pointer to its raster's class. */ /* This is a pointer to its raster's class. */
/* */ /* */
typedef struct FT_Renderer_Class_ typedef struct FT_Renderer_Class_
{ {
FT_Module_Class root; FT_Module_Class root;
FT_Glyph_Format glyph_format; FT_Glyph_Format glyph_format;
FT_Renderer_RenderFunc render_glyph; FT_Renderer_RenderFunc render_glyph;
FT_Renderer_TransformFunc transform_glyph; FT_Renderer_TransformFunc transform_glyph;
FT_Renderer_GetCBoxFunc get_glyph_cbox; FT_Renderer_GetCBoxFunc get_glyph_cbox;
FT_Renderer_SetModeFunc set_mode; FT_Renderer_SetModeFunc set_mode;
FT_Raster_Funcs* raster_class; FT_Raster_Funcs* raster_class;
} FT_Renderer_Class; } FT_Renderer_Class;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_Renderer */ /* FT_Get_Renderer */
/* */ /* */
/* <Description> */ /* <Description> */
/* Retrieve the current renderer for a given glyph format. */ /* Retrieve the current renderer for a given glyph format. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to the library object. */ /* library :: A handle to the library object. */
/* */ /* */
/* format :: The glyph format. */ /* format :: The glyph format. */
/* */ /* */
/* <Return> */ /* <Return> */
/* A renderer handle. 0~if none found. */ /* A renderer handle. 0~if none found. */
/* */ /* */
/* <Note> */ /* <Note> */
/* An error will be returned if a module already exists by that name, */ /* An error will be returned if a module already exists by that name, */
/* or if the module requires a version of FreeType that is too great. */ /* or if the module requires a version of FreeType that is too great. */
/* */ /* */
/* To add a new renderer, simply use @FT_Add_Module. To retrieve a */ /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
/* renderer by its name, use @FT_Get_Module. */ /* renderer by its name, use @FT_Get_Module. */
/* */ /* */
FT_EXPORT( FT_Renderer ) FT_EXPORT( FT_Renderer )
FT_Get_Renderer( FT_Library library, FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format ); FT_Glyph_Format format );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Set_Renderer */ /* FT_Set_Renderer */
/* */ /* */
/* <Description> */ /* <Description> */
/* Set the current renderer to use, and set additional mode. */ /* Set the current renderer to use, and set additional mode. */
/* */ /* */
/* <InOut> */ /* <InOut> */
/* library :: A handle to the library object. */ /* library :: A handle to the library object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* renderer :: A handle to the renderer object. */ /* renderer :: A handle to the renderer object. */
/* */ /* */
/* num_params :: The number of additional parameters. */ /* num_params :: The number of additional parameters. */
/* */ /* */
/* parameters :: Additional parameters. */ /* parameters :: Additional parameters. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* In case of success, the renderer will be used to convert glyph */ /* In case of success, the renderer will be used to convert glyph */
/* images in the renderer's known format into bitmaps. */ /* images in the renderer's known format into bitmaps. */
/* */ /* */
/* This doesn't change the current renderer for other formats. */ /* This doesn't change the current renderer for other formats. */
/* */ /* */
FT_EXPORT( FT_Error ) /* Currently, only the B/W renderer, if compiled with */
FT_Set_Renderer( FT_Library library, /* FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels */
FT_Renderer renderer, /* anti-aliasing mode; this option must be set directly in */
FT_UInt num_params, /* `ftraster.c' and is undefined by default) accepts a single tag */
FT_Parameter* parameters ); /* `pal5' to set its gray palette as a character string with */
/* 5~elements. Consequently, the third and fourth argument are zero */
/* normally. */
/* */ /* */
FT_EXPORT( FT_Error )
FT_Set_Renderer( FT_Library library,
FT_END_HEADER FT_Renderer renderer,
FT_UInt num_params,
#endif /* __FTRENDER_H__ */ FT_Parameter* parameters );
/* END */ /* */
FT_END_HEADER
#endif /* __FTRENDER_H__ */
/* END */

View file

@ -1,159 +1,159 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftsizes.h */ /* ftsizes.h */
/* */ /* */
/* FreeType size objects management (specification). */ /* FreeType size objects management (specification). */
/* */ /* */
/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ /* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Typical application would normally not need to use these functions. */ /* Typical application would normally not need to use these functions. */
/* However, they have been placed in a public API for the rare cases */ /* However, they have been placed in a public API for the rare cases */
/* where they are needed. */ /* where they are needed. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTSIZES_H__ #ifndef __FTSIZES_H__
#define __FTSIZES_H__ #define __FTSIZES_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* sizes_management */ /* sizes_management */
/* */ /* */
/* <Title> */ /* <Title> */
/* Size Management */ /* Size Management */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Managing multiple sizes per face. */ /* Managing multiple sizes per face. */
/* */ /* */
/* <Description> */ /* <Description> */
/* When creating a new face object (e.g., with @FT_New_Face), an */ /* When creating a new face object (e.g., with @FT_New_Face), an */
/* @FT_Size object is automatically created and used to store all */ /* @FT_Size object is automatically created and used to store all */
/* pixel-size dependent information, available in the `face->size' */ /* pixel-size dependent information, available in the `face->size' */
/* field. */ /* field. */
/* */ /* */
/* It is however possible to create more sizes for a given face, */ /* It is however possible to create more sizes for a given face, */
/* mostly in order to manage several character pixel sizes of the */ /* mostly in order to manage several character pixel sizes of the */
/* same font family and style. See @FT_New_Size and @FT_Done_Size. */ /* same font family and style. See @FT_New_Size and @FT_Done_Size. */
/* */ /* */
/* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */ /* Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only */
/* modify the contents of the current `active' size; you thus need */ /* modify the contents of the current `active' size; you thus need */
/* to use @FT_Activate_Size to change it. */ /* to use @FT_Activate_Size to change it. */
/* */ /* */
/* 99% of applications won't need the functions provided here, */ /* 99% of applications won't need the functions provided here, */
/* especially if they use the caching sub-system, so be cautious */ /* especially if they use the caching sub-system, so be cautious */
/* when using these. */ /* when using these. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_New_Size */ /* FT_New_Size */
/* */ /* */
/* <Description> */ /* <Description> */
/* Create a new size object from a given face object. */ /* Create a new size object from a given face object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: A handle to a parent face object. */ /* face :: A handle to a parent face object. */
/* */ /* */
/* <Output> */ /* <Output> */
/* asize :: A handle to a new size object. */ /* asize :: A handle to a new size object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* You need to call @FT_Activate_Size in order to select the new size */ /* You need to call @FT_Activate_Size in order to select the new size */
/* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */ /* for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size, */
/* @FT_Load_Glyph, @FT_Load_Char, etc. */ /* @FT_Load_Glyph, @FT_Load_Char, etc. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_New_Size( FT_Face face, FT_New_Size( FT_Face face,
FT_Size* size ); FT_Size* size );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Done_Size */ /* FT_Done_Size */
/* */ /* */
/* <Description> */ /* <Description> */
/* Discard a given size object. Note that @FT_Done_Face */ /* Discard a given size object. Note that @FT_Done_Face */
/* automatically discards all size objects allocated with */ /* automatically discards all size objects allocated with */
/* @FT_New_Size. */ /* @FT_New_Size. */
/* */ /* */
/* <Input> */ /* <Input> */
/* size :: A handle to a target size object. */ /* size :: A handle to a target size object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Done_Size( FT_Size size ); FT_Done_Size( FT_Size size );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Activate_Size */ /* FT_Activate_Size */
/* */ /* */
/* <Description> */ /* <Description> */
/* Even though it is possible to create several size objects for a */ /* Even though it is possible to create several size objects for a */
/* given face (see @FT_New_Size for details), functions like */ /* given face (see @FT_New_Size for details), functions like */
/* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */ /* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */
/* activated last to determine the `current character pixel size'. */ /* activated last to determine the `current character pixel size'. */
/* */ /* */
/* This function can be used to `activate' a previously created size */ /* This function can be used to `activate' a previously created size */
/* object. */ /* object. */
/* */ /* */
/* <Input> */ /* <Input> */
/* size :: A handle to a target size object. */ /* size :: A handle to a target size object. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* If `face' is the size's parent face object, this function changes */ /* If `face' is the size's parent face object, this function changes */
/* the value of `face->size' to the input size handle. */ /* the value of `face->size' to the input size handle. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Activate_Size( FT_Size size ); FT_Activate_Size( FT_Size size );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTSIZES_H__ */ #endif /* __FTSIZES_H__ */
/* END */ /* END */

View file

@ -1,200 +1,200 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftsnames.h */ /* ftsnames.h */
/* */ /* */
/* Simple interface to access SFNT name tables (which are used */ /* Simple interface to access SFNT name tables (which are used */
/* to hold font names, copyright info, notices, etc.) (specification). */ /* to hold font names, copyright info, notices, etc.) (specification). */
/* */ /* */
/* This is _not_ used to retrieve glyph names! */ /* This is _not_ used to retrieve glyph names! */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FT_SFNT_NAMES_H__ #ifndef __FT_SFNT_NAMES_H__
#define __FT_SFNT_NAMES_H__ #define __FT_SFNT_NAMES_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* sfnt_names */ /* sfnt_names */
/* */ /* */
/* <Title> */ /* <Title> */
/* SFNT Names */ /* SFNT Names */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Access the names embedded in TrueType and OpenType files. */ /* Access the names embedded in TrueType and OpenType files. */
/* */ /* */
/* <Description> */ /* <Description> */
/* The TrueType and OpenType specifications allow the inclusion of */ /* The TrueType and OpenType specifications allow the inclusion of */
/* a special `names table' in font files. This table contains */ /* a special `names table' in font files. This table contains */
/* textual (and internationalized) information regarding the font, */ /* textual (and internationalized) information regarding the font, */
/* like family name, copyright, version, etc. */ /* like family name, copyright, version, etc. */
/* */ /* */
/* The definitions below are used to access them if available. */ /* The definitions below are used to access them if available. */
/* */ /* */
/* Note that this has nothing to do with glyph names! */ /* Note that this has nothing to do with glyph names! */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_SfntName */ /* FT_SfntName */
/* */ /* */
/* <Description> */ /* <Description> */
/* A structure used to model an SFNT `name' table entry. */ /* A structure used to model an SFNT `name' table entry. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* platform_id :: The platform ID for `string'. */ /* platform_id :: The platform ID for `string'. */
/* */ /* */
/* encoding_id :: The encoding ID for `string'. */ /* encoding_id :: The encoding ID for `string'. */
/* */ /* */
/* language_id :: The language ID for `string'. */ /* language_id :: The language ID for `string'. */
/* */ /* */
/* name_id :: An identifier for `string'. */ /* name_id :: An identifier for `string'. */
/* */ /* */
/* string :: The `name' string. Note that its format differs */ /* string :: The `name' string. Note that its format differs */
/* depending on the (platform,encoding) pair. It can */ /* depending on the (platform,encoding) pair. It can */
/* be a Pascal String, a UTF-16 one, etc. */ /* be a Pascal String, a UTF-16 one, etc. */
/* */ /* */
/* Generally speaking, the string is not */ /* Generally speaking, the string is not */
/* zero-terminated. Please refer to the TrueType */ /* zero-terminated. Please refer to the TrueType */
/* specification for details. */ /* specification for details. */
/* */ /* */
/* string_len :: The length of `string' in bytes. */ /* string_len :: The length of `string' in bytes. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Possible values for `platform_id', `encoding_id', `language_id', */ /* Possible values for `platform_id', `encoding_id', `language_id', */
/* and `name_id' are given in the file `ttnameid.h'. For details */ /* and `name_id' are given in the file `ttnameid.h'. For details */
/* please refer to the TrueType or OpenType specification. */ /* please refer to the TrueType or OpenType specification. */
/* */ /* */
/* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */ /* See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX, */
/* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */ /* @TT_ISO_ID_XXX, and @TT_MS_ID_XXX. */
/* */ /* */
typedef struct FT_SfntName_ typedef struct FT_SfntName_
{ {
FT_UShort platform_id; FT_UShort platform_id;
FT_UShort encoding_id; FT_UShort encoding_id;
FT_UShort language_id; FT_UShort language_id;
FT_UShort name_id; FT_UShort name_id;
FT_Byte* string; /* this string is *not* null-terminated! */ FT_Byte* string; /* this string is *not* null-terminated! */
FT_UInt string_len; /* in bytes */ FT_UInt string_len; /* in bytes */
} FT_SfntName; } FT_SfntName;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_Sfnt_Name_Count */ /* FT_Get_Sfnt_Name_Count */
/* */ /* */
/* <Description> */ /* <Description> */
/* Retrieve the number of name strings in the SFNT `name' table. */ /* Retrieve the number of name strings in the SFNT `name' table. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* <Return> */ /* <Return> */
/* The number of strings in the `name' table. */ /* The number of strings in the `name' table. */
/* */ /* */
FT_EXPORT( FT_UInt ) FT_EXPORT( FT_UInt )
FT_Get_Sfnt_Name_Count( FT_Face face ); FT_Get_Sfnt_Name_Count( FT_Face face );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_Sfnt_Name */ /* FT_Get_Sfnt_Name */
/* */ /* */
/* <Description> */ /* <Description> */
/* Retrieve a string of the SFNT `name' table for a given index. */ /* Retrieve a string of the SFNT `name' table for a given index. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: A handle to the source face. */ /* face :: A handle to the source face. */
/* */ /* */
/* idx :: The index of the `name' string. */ /* idx :: The index of the `name' string. */
/* */ /* */
/* <Output> */ /* <Output> */
/* aname :: The indexed @FT_SfntName structure. */ /* aname :: The indexed @FT_SfntName structure. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. 0~means success. */ /* FreeType error code. 0~means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* The `string' array returned in the `aname' structure is not */ /* The `string' array returned in the `aname' structure is not */
/* null-terminated. The application should deallocate it if it is no */ /* null-terminated. The application should deallocate it if it is no */
/* longer in use. */ /* longer in use. */
/* */ /* */
/* Use @FT_Get_Sfnt_Name_Count to get the total number of available */ /* Use @FT_Get_Sfnt_Name_Count to get the total number of available */
/* `name' table entries, then do a loop until you get the right */ /* `name' table entries, then do a loop until you get the right */
/* platform, encoding, and name ID. */ /* platform, encoding, and name ID. */
/* */ /* */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_Sfnt_Name( FT_Face face, FT_Get_Sfnt_Name( FT_Face face,
FT_UInt idx, FT_UInt idx,
FT_SfntName *aname ); FT_SfntName *aname );
/*************************************************************************** /***************************************************************************
* *
* @constant: * @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY * FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY
* *
* @description: * @description:
* A constant used as the tag of @FT_Parameter structures to make * A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred family subfamily names in `name' * FT_Open_Face() ignore preferred family subfamily names in `name'
* table since OpenType version 1.4. For backwards compatibility with * table since OpenType version 1.4. For backwards compatibility with
* legacy systems which has 4-face-per-family restriction. * legacy systems which has 4-face-per-family restriction.
* *
*/ */
#define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' )
/*************************************************************************** /***************************************************************************
* *
* @constant: * @constant:
* FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY * FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY
* *
* @description: * @description:
* A constant used as the tag of @FT_Parameter structures to make * A constant used as the tag of @FT_Parameter structures to make
* FT_Open_Face() ignore preferred subfamily names in `name' table since * FT_Open_Face() ignore preferred subfamily names in `name' table since
* OpenType version 1.4. For backwards compatibility with legacy * OpenType version 1.4. For backwards compatibility with legacy
* systems which has 4-face-per-family restriction. * systems which has 4-face-per-family restriction.
* *
*/ */
#define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' )
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FT_SFNT_NAMES_H__ */ #endif /* __FT_SFNT_NAMES_H__ */
/* END */ /* END */

File diff suppressed because it is too large Load diff

View file

@ -1,80 +1,80 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftsynth.h */ /* ftsynth.h */
/* */ /* */
/* FreeType synthesizing code for emboldening and slanting */ /* FreeType synthesizing code for emboldening and slanting */
/* (specification). */ /* (specification). */
/* */ /* */
/* Copyright 2000-2001, 2003, 2006, 2008 by */ /* Copyright 2000-2001, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/********* *********/ /********* *********/
/********* WARNING, THIS IS ALPHA CODE! THIS API *********/ /********* WARNING, THIS IS ALPHA CODE! THIS API *********/
/********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/ /********* IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE *********/
/********* FREETYPE DEVELOPMENT TEAM *********/ /********* FREETYPE DEVELOPMENT TEAM *********/
/********* *********/ /********* *********/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* Main reason for not lifting the functions in this module to a */ /* Main reason for not lifting the functions in this module to a */
/* `standard' API is that the used parameters for emboldening and */ /* `standard' API is that the used parameters for emboldening and */
/* slanting are not configurable. Consider the functions as a */ /* slanting are not configurable. Consider the functions as a */
/* code resource which should be copied into the application and */ /* code resource which should be copied into the application and */
/* adapted to the particular needs. */ /* adapted to the particular needs. */
#ifndef __FTSYNTH_H__ #ifndef __FTSYNTH_H__
#define __FTSYNTH_H__ #define __FTSYNTH_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* Embolden a glyph by a `reasonable' value (which is highly a matter of */ /* Embolden a glyph by a `reasonable' value (which is highly a matter of */
/* taste). This function is actually a convenience function, providing */ /* taste). This function is actually a convenience function, providing */
/* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */ /* a wrapper for @FT_Outline_Embolden and @FT_Bitmap_Embolden. */
/* */ /* */
/* For emboldened outlines the metrics are estimates only; if you need */ /* For emboldened outlines the metrics are estimates only; if you need */
/* precise values you should call @FT_Outline_Get_CBox. */ /* precise values you should call @FT_Outline_Get_CBox. */
FT_EXPORT( void ) FT_EXPORT( void )
FT_GlyphSlot_Embolden( FT_GlyphSlot slot ); FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
/* Slant an outline glyph to the right by about 12 degrees. */ /* Slant an outline glyph to the right by about 12 degrees. */
FT_EXPORT( void ) FT_EXPORT( void )
FT_GlyphSlot_Oblique( FT_GlyphSlot slot ); FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTSYNTH_H__ */ #endif /* __FTSYNTH_H__ */
/* END */ /* END */

View file

@ -1,347 +1,347 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftsystem.h */ /* ftsystem.h */
/* */ /* */
/* FreeType low-level system interface definition (specification). */ /* FreeType low-level system interface definition (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2005, 2010 by */ /* Copyright 1996-2001, 2002, 2005, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTSYSTEM_H__ #ifndef __FTSYSTEM_H__
#define __FTSYSTEM_H__ #define __FTSYSTEM_H__
#include <ft2build.h> #include <ft2build.h>
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* system_interface */ /* system_interface */
/* */ /* */
/* <Title> */ /* <Title> */
/* System Interface */ /* System Interface */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* How FreeType manages memory and i/o. */ /* How FreeType manages memory and i/o. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains various definitions related to memory */ /* This section contains various definitions related to memory */
/* management and i/o access. You need to understand this */ /* management and i/o access. You need to understand this */
/* information if you want to use a custom memory manager or you own */ /* information if you want to use a custom memory manager or you own */
/* i/o streams. */ /* i/o streams. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* M E M O R Y M A N A G E M E N T */ /* M E M O R Y M A N A G E M E N T */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/************************************************************************* /*************************************************************************
* *
* @type: * @type:
* FT_Memory * FT_Memory
* *
* @description: * @description:
* A handle to a given memory manager object, defined with an * A handle to a given memory manager object, defined with an
* @FT_MemoryRec structure. * @FT_MemoryRec structure.
* *
*/ */
typedef struct FT_MemoryRec_* FT_Memory; typedef struct FT_MemoryRec_* FT_Memory;
/************************************************************************* /*************************************************************************
* *
* @functype: * @functype:
* FT_Alloc_Func * FT_Alloc_Func
* *
* @description: * @description:
* A function used to allocate `size' bytes from `memory'. * A function used to allocate `size' bytes from `memory'.
* *
* @input: * @input:
* memory :: * memory ::
* A handle to the source memory manager. * A handle to the source memory manager.
* *
* size :: * size ::
* The size in bytes to allocate. * The size in bytes to allocate.
* *
* @return: * @return:
* Address of new memory block. 0~in case of failure. * Address of new memory block. 0~in case of failure.
* *
*/ */
typedef void* typedef void*
(*FT_Alloc_Func)( FT_Memory memory, (*FT_Alloc_Func)( FT_Memory memory,
long size ); long size );
/************************************************************************* /*************************************************************************
* *
* @functype: * @functype:
* FT_Free_Func * FT_Free_Func
* *
* @description: * @description:
* A function used to release a given block of memory. * A function used to release a given block of memory.
* *
* @input: * @input:
* memory :: * memory ::
* A handle to the source memory manager. * A handle to the source memory manager.
* *
* block :: * block ::
* The address of the target memory block. * The address of the target memory block.
* *
*/ */
typedef void typedef void
(*FT_Free_Func)( FT_Memory memory, (*FT_Free_Func)( FT_Memory memory,
void* block ); void* block );
/************************************************************************* /*************************************************************************
* *
* @functype: * @functype:
* FT_Realloc_Func * FT_Realloc_Func
* *
* @description: * @description:
* A function used to re-allocate a given block of memory. * A function used to re-allocate a given block of memory.
* *
* @input: * @input:
* memory :: * memory ::
* A handle to the source memory manager. * A handle to the source memory manager.
* *
* cur_size :: * cur_size ::
* The block's current size in bytes. * The block's current size in bytes.
* *
* new_size :: * new_size ::
* The block's requested new size. * The block's requested new size.
* *
* block :: * block ::
* The block's current address. * The block's current address.
* *
* @return: * @return:
* New block address. 0~in case of memory shortage. * New block address. 0~in case of memory shortage.
* *
* @note: * @note:
* In case of error, the old block must still be available. * In case of error, the old block must still be available.
* *
*/ */
typedef void* typedef void*
(*FT_Realloc_Func)( FT_Memory memory, (*FT_Realloc_Func)( FT_Memory memory,
long cur_size, long cur_size,
long new_size, long new_size,
void* block ); void* block );
/************************************************************************* /*************************************************************************
* *
* @struct: * @struct:
* FT_MemoryRec * FT_MemoryRec
* *
* @description: * @description:
* A structure used to describe a given memory manager to FreeType~2. * A structure used to describe a given memory manager to FreeType~2.
* *
* @fields: * @fields:
* user :: * user ::
* A generic typeless pointer for user data. * A generic typeless pointer for user data.
* *
* alloc :: * alloc ::
* A pointer type to an allocation function. * A pointer type to an allocation function.
* *
* free :: * free ::
* A pointer type to an memory freeing function. * A pointer type to an memory freeing function.
* *
* realloc :: * realloc ::
* A pointer type to a reallocation function. * A pointer type to a reallocation function.
* *
*/ */
struct FT_MemoryRec_ struct FT_MemoryRec_
{ {
void* user; void* user;
FT_Alloc_Func alloc; FT_Alloc_Func alloc;
FT_Free_Func free; FT_Free_Func free;
FT_Realloc_Func realloc; FT_Realloc_Func realloc;
}; };
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* I / O M A N A G E M E N T */ /* I / O M A N A G E M E N T */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/************************************************************************* /*************************************************************************
* *
* @type: * @type:
* FT_Stream * FT_Stream
* *
* @description: * @description:
* A handle to an input stream. * A handle to an input stream.
* *
*/ */
typedef struct FT_StreamRec_* FT_Stream; typedef struct FT_StreamRec_* FT_Stream;
/************************************************************************* /*************************************************************************
* *
* @struct: * @struct:
* FT_StreamDesc * FT_StreamDesc
* *
* @description: * @description:
* A union type used to store either a long or a pointer. This is used * A union type used to store either a long or a pointer. This is used
* to store a file descriptor or a `FILE*' in an input stream. * to store a file descriptor or a `FILE*' in an input stream.
* *
*/ */
typedef union FT_StreamDesc_ typedef union FT_StreamDesc_
{ {
long value; long value;
void* pointer; void* pointer;
} FT_StreamDesc; } FT_StreamDesc;
/************************************************************************* /*************************************************************************
* *
* @functype: * @functype:
* FT_Stream_IoFunc * FT_Stream_IoFunc
* *
* @description: * @description:
* A function used to seek and read data from a given input stream. * A function used to seek and read data from a given input stream.
* *
* @input: * @input:
* stream :: * stream ::
* A handle to the source stream. * A handle to the source stream.
* *
* offset :: * offset ::
* The offset of read in stream (always from start). * The offset of read in stream (always from start).
* *
* buffer :: * buffer ::
* The address of the read buffer. * The address of the read buffer.
* *
* count :: * count ::
* The number of bytes to read from the stream. * The number of bytes to read from the stream.
* *
* @return: * @return:
* The number of bytes effectively read by the stream. * The number of bytes effectively read by the stream.
* *
* @note: * @note:
* This function might be called to perform a seek or skip operation * This function might be called to perform a seek or skip operation
* with a `count' of~0. A non-zero return value then indicates an * with a `count' of~0. A non-zero return value then indicates an
* error. * error.
* *
*/ */
typedef unsigned long typedef unsigned long
(*FT_Stream_IoFunc)( FT_Stream stream, (*FT_Stream_IoFunc)( FT_Stream stream,
unsigned long offset, unsigned long offset,
unsigned char* buffer, unsigned char* buffer,
unsigned long count ); unsigned long count );
/************************************************************************* /*************************************************************************
* *
* @functype: * @functype:
* FT_Stream_CloseFunc * FT_Stream_CloseFunc
* *
* @description: * @description:
* A function used to close a given input stream. * A function used to close a given input stream.
* *
* @input: * @input:
* stream :: * stream ::
* A handle to the target stream. * A handle to the target stream.
* *
*/ */
typedef void typedef void
(*FT_Stream_CloseFunc)( FT_Stream stream ); (*FT_Stream_CloseFunc)( FT_Stream stream );
/************************************************************************* /*************************************************************************
* *
* @struct: * @struct:
* FT_StreamRec * FT_StreamRec
* *
* @description: * @description:
* A structure used to describe an input stream. * A structure used to describe an input stream.
* *
* @input: * @input:
* base :: * base ::
* For memory-based streams, this is the address of the first stream * For memory-based streams, this is the address of the first stream
* byte in memory. This field should always be set to NULL for * byte in memory. This field should always be set to NULL for
* disk-based streams. * disk-based streams.
* *
* size :: * size ::
* The stream size in bytes. * The stream size in bytes.
* *
* pos :: * pos ::
* The current position within the stream. * The current position within the stream.
* *
* descriptor :: * descriptor ::
* This field is a union that can hold an integer or a pointer. It is * This field is a union that can hold an integer or a pointer. It is
* used by stream implementations to store file descriptors or `FILE*' * used by stream implementations to store file descriptors or `FILE*'
* pointers. * pointers.
* *
* pathname :: * pathname ::
* This field is completely ignored by FreeType. However, it is often * This field is completely ignored by FreeType. However, it is often
* useful during debugging to use it to store the stream's filename * useful during debugging to use it to store the stream's filename
* (where available). * (where available).
* *
* read :: * read ::
* The stream's input function. * The stream's input function.
* *
* close :: * close ::
* The stream's close function. * The stream's close function.
* *
* memory :: * memory ::
* The memory manager to use to preload frames. This is set * The memory manager to use to preload frames. This is set
* internally by FreeType and shouldn't be touched by stream * internally by FreeType and shouldn't be touched by stream
* implementations. * implementations.
* *
* cursor :: * cursor ::
* This field is set and used internally by FreeType when parsing * This field is set and used internally by FreeType when parsing
* frames. * frames.
* *
* limit :: * limit ::
* This field is set and used internally by FreeType when parsing * This field is set and used internally by FreeType when parsing
* frames. * frames.
* *
*/ */
typedef struct FT_StreamRec_ typedef struct FT_StreamRec_
{ {
unsigned char* base; unsigned char* base;
unsigned long size; unsigned long size;
unsigned long pos; unsigned long pos;
FT_StreamDesc descriptor; FT_StreamDesc descriptor;
FT_StreamDesc pathname; FT_StreamDesc pathname;
FT_Stream_IoFunc read; FT_Stream_IoFunc read;
FT_Stream_CloseFunc close; FT_Stream_CloseFunc close;
FT_Memory memory; FT_Memory memory;
unsigned char* cursor; unsigned char* cursor;
unsigned char* limit; unsigned char* limit;
} FT_StreamRec; } FT_StreamRec;
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTSYSTEM_H__ */ #endif /* __FTSYSTEM_H__ */
/* END */ /* END */

View file

@ -1,350 +1,350 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* fttrigon.h */ /* fttrigon.h */
/* */ /* */
/* FreeType trigonometric functions (specification). */ /* FreeType trigonometric functions (specification). */
/* */ /* */
/* Copyright 2001, 2003, 2005, 2007 by */ /* Copyright 2001, 2003, 2005, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTTRIGON_H__ #ifndef __FTTRIGON_H__
#define __FTTRIGON_H__ #define __FTTRIGON_H__
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* computations */ /* computations */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/************************************************************************* /*************************************************************************
* *
* @type: * @type:
* FT_Angle * FT_Angle
* *
* @description: * @description:
* This type is used to model angle values in FreeType. Note that the * This type is used to model angle values in FreeType. Note that the
* angle is a 16.16 fixed float value expressed in degrees. * angle is a 16.16 fixed float value expressed in degrees.
* *
*/ */
typedef FT_Fixed FT_Angle; typedef FT_Fixed FT_Angle;
/************************************************************************* /*************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI * FT_ANGLE_PI
* *
* @description: * @description:
* The angle pi expressed in @FT_Angle units. * The angle pi expressed in @FT_Angle units.
* *
*/ */
#define FT_ANGLE_PI ( 180L << 16 ) #define FT_ANGLE_PI ( 180L << 16 )
/************************************************************************* /*************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_2PI * FT_ANGLE_2PI
* *
* @description: * @description:
* The angle 2*pi expressed in @FT_Angle units. * The angle 2*pi expressed in @FT_Angle units.
* *
*/ */
#define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) #define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 )
/************************************************************************* /*************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI2 * FT_ANGLE_PI2
* *
* @description: * @description:
* The angle pi/2 expressed in @FT_Angle units. * The angle pi/2 expressed in @FT_Angle units.
* *
*/ */
#define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) #define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 )
/************************************************************************* /*************************************************************************
* *
* @macro: * @macro:
* FT_ANGLE_PI4 * FT_ANGLE_PI4
* *
* @description: * @description:
* The angle pi/4 expressed in @FT_Angle units. * The angle pi/4 expressed in @FT_Angle units.
* *
*/ */
#define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) #define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 )
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Sin * FT_Sin
* *
* @description: * @description:
* Return the sinus of a given angle in fixed point format. * Return the sinus of a given angle in fixed point format.
* *
* @input: * @input:
* angle :: * angle ::
* The input angle. * The input angle.
* *
* @return: * @return:
* The sinus value. * The sinus value.
* *
* @note: * @note:
* If you need both the sinus and cosinus for a given angle, use the * If you need both the sinus and cosinus for a given angle, use the
* function @FT_Vector_Unit. * function @FT_Vector_Unit.
* *
*/ */
FT_EXPORT( FT_Fixed ) FT_EXPORT( FT_Fixed )
FT_Sin( FT_Angle angle ); FT_Sin( FT_Angle angle );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Cos * FT_Cos
* *
* @description: * @description:
* Return the cosinus of a given angle in fixed point format. * Return the cosinus of a given angle in fixed point format.
* *
* @input: * @input:
* angle :: * angle ::
* The input angle. * The input angle.
* *
* @return: * @return:
* The cosinus value. * The cosinus value.
* *
* @note: * @note:
* If you need both the sinus and cosinus for a given angle, use the * If you need both the sinus and cosinus for a given angle, use the
* function @FT_Vector_Unit. * function @FT_Vector_Unit.
* *
*/ */
FT_EXPORT( FT_Fixed ) FT_EXPORT( FT_Fixed )
FT_Cos( FT_Angle angle ); FT_Cos( FT_Angle angle );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Tan * FT_Tan
* *
* @description: * @description:
* Return the tangent of a given angle in fixed point format. * Return the tangent of a given angle in fixed point format.
* *
* @input: * @input:
* angle :: * angle ::
* The input angle. * The input angle.
* *
* @return: * @return:
* The tangent value. * The tangent value.
* *
*/ */
FT_EXPORT( FT_Fixed ) FT_EXPORT( FT_Fixed )
FT_Tan( FT_Angle angle ); FT_Tan( FT_Angle angle );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Atan2 * FT_Atan2
* *
* @description: * @description:
* Return the arc-tangent corresponding to a given vector (x,y) in * Return the arc-tangent corresponding to a given vector (x,y) in
* the 2d plane. * the 2d plane.
* *
* @input: * @input:
* x :: * x ::
* The horizontal vector coordinate. * The horizontal vector coordinate.
* *
* y :: * y ::
* The vertical vector coordinate. * The vertical vector coordinate.
* *
* @return: * @return:
* The arc-tangent value (i.e. angle). * The arc-tangent value (i.e. angle).
* *
*/ */
FT_EXPORT( FT_Angle ) FT_EXPORT( FT_Angle )
FT_Atan2( FT_Fixed x, FT_Atan2( FT_Fixed x,
FT_Fixed y ); FT_Fixed y );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Angle_Diff * FT_Angle_Diff
* *
* @description: * @description:
* Return the difference between two angles. The result is always * Return the difference between two angles. The result is always
* constrained to the ]-PI..PI] interval. * constrained to the ]-PI..PI] interval.
* *
* @input: * @input:
* angle1 :: * angle1 ::
* First angle. * First angle.
* *
* angle2 :: * angle2 ::
* Second angle. * Second angle.
* *
* @return: * @return:
* Constrained value of `value2-value1'. * Constrained value of `value2-value1'.
* *
*/ */
FT_EXPORT( FT_Angle ) FT_EXPORT( FT_Angle )
FT_Angle_Diff( FT_Angle angle1, FT_Angle_Diff( FT_Angle angle1,
FT_Angle angle2 ); FT_Angle angle2 );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Vector_Unit * FT_Vector_Unit
* *
* @description: * @description:
* Return the unit vector corresponding to a given angle. After the * Return the unit vector corresponding to a given angle. After the
* call, the value of `vec.x' will be `sin(angle)', and the value of * call, the value of `vec.x' will be `sin(angle)', and the value of
* `vec.y' will be `cos(angle)'. * `vec.y' will be `cos(angle)'.
* *
* This function is useful to retrieve both the sinus and cosinus of a * This function is useful to retrieve both the sinus and cosinus of a
* given angle quickly. * given angle quickly.
* *
* @output: * @output:
* vec :: * vec ::
* The address of target vector. * The address of target vector.
* *
* @input: * @input:
* angle :: * angle ::
* The address of angle. * The address of angle.
* *
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Vector_Unit( FT_Vector* vec, FT_Vector_Unit( FT_Vector* vec,
FT_Angle angle ); FT_Angle angle );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Vector_Rotate * FT_Vector_Rotate
* *
* @description: * @description:
* Rotate a vector by a given angle. * Rotate a vector by a given angle.
* *
* @inout: * @inout:
* vec :: * vec ::
* The address of target vector. * The address of target vector.
* *
* @input: * @input:
* angle :: * angle ::
* The address of angle. * The address of angle.
* *
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Vector_Rotate( FT_Vector* vec, FT_Vector_Rotate( FT_Vector* vec,
FT_Angle angle ); FT_Angle angle );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Vector_Length * FT_Vector_Length
* *
* @description: * @description:
* Return the length of a given vector. * Return the length of a given vector.
* *
* @input: * @input:
* vec :: * vec ::
* The address of target vector. * The address of target vector.
* *
* @return: * @return:
* The vector length, expressed in the same units that the original * The vector length, expressed in the same units that the original
* vector coordinates. * vector coordinates.
* *
*/ */
FT_EXPORT( FT_Fixed ) FT_EXPORT( FT_Fixed )
FT_Vector_Length( FT_Vector* vec ); FT_Vector_Length( FT_Vector* vec );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Vector_Polarize * FT_Vector_Polarize
* *
* @description: * @description:
* Compute both the length and angle of a given vector. * Compute both the length and angle of a given vector.
* *
* @input: * @input:
* vec :: * vec ::
* The address of source vector. * The address of source vector.
* *
* @output: * @output:
* length :: * length ::
* The vector length. * The vector length.
* *
* angle :: * angle ::
* The vector angle. * The vector angle.
* *
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Vector_Polarize( FT_Vector* vec, FT_Vector_Polarize( FT_Vector* vec,
FT_Fixed *length, FT_Fixed *length,
FT_Angle *angle ); FT_Angle *angle );
/************************************************************************* /*************************************************************************
* *
* @function: * @function:
* FT_Vector_From_Polar * FT_Vector_From_Polar
* *
* @description: * @description:
* Compute vector coordinates from a length and angle. * Compute vector coordinates from a length and angle.
* *
* @output: * @output:
* vec :: * vec ::
* The address of source vector. * The address of source vector.
* *
* @input: * @input:
* length :: * length ::
* The vector length. * The vector length.
* *
* angle :: * angle ::
* The vector angle. * The vector angle.
* *
*/ */
FT_EXPORT( void ) FT_EXPORT( void )
FT_Vector_From_Polar( FT_Vector* vec, FT_Vector_From_Polar( FT_Vector* vec,
FT_Fixed length, FT_Fixed length,
FT_Angle angle ); FT_Angle angle );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTTRIGON_H__ */ #endif /* __FTTRIGON_H__ */
/* END */ /* END */

File diff suppressed because it is too large Load diff

View file

@ -1,274 +1,274 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftwinfnt.h */ /* ftwinfnt.h */
/* */ /* */
/* FreeType API for accessing Windows fnt-specific data. */ /* FreeType API for accessing Windows fnt-specific data. */
/* */ /* */
/* Copyright 2003, 2004, 2008 by */ /* Copyright 2003, 2004, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTWINFNT_H__ #ifndef __FTWINFNT_H__
#define __FTWINFNT_H__ #define __FTWINFNT_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* winfnt_fonts */ /* winfnt_fonts */
/* */ /* */
/* <Title> */ /* <Title> */
/* Window FNT Files */ /* Window FNT Files */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Windows FNT specific API. */ /* Windows FNT specific API. */
/* */ /* */
/* <Description> */ /* <Description> */
/* This section contains the declaration of Windows FNT specific */ /* This section contains the declaration of Windows FNT specific */
/* functions. */ /* functions. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/************************************************************************* /*************************************************************************
* *
* @enum: * @enum:
* FT_WinFNT_ID_XXX * FT_WinFNT_ID_XXX
* *
* @description: * @description:
* A list of valid values for the `charset' byte in * A list of valid values for the `charset' byte in
* @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX
* encodings (except for cp1361) can be found at ftp://ftp.unicode.org * encodings (except for cp1361) can be found at ftp://ftp.unicode.org
* in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is
* roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.
* *
* @values: * @values:
* FT_WinFNT_ID_DEFAULT :: * FT_WinFNT_ID_DEFAULT ::
* This is used for font enumeration and font creation as a * This is used for font enumeration and font creation as a
* `don't care' value. Valid font files don't contain this value. * `don't care' value. Valid font files don't contain this value.
* When querying for information about the character set of the font * When querying for information about the character set of the font
* that is currently selected into a specified device context, this * that is currently selected into a specified device context, this
* return value (of the related Windows API) simply denotes failure. * return value (of the related Windows API) simply denotes failure.
* *
* FT_WinFNT_ID_SYMBOL :: * FT_WinFNT_ID_SYMBOL ::
* There is no known mapping table available. * There is no known mapping table available.
* *
* FT_WinFNT_ID_MAC :: * FT_WinFNT_ID_MAC ::
* Mac Roman encoding. * Mac Roman encoding.
* *
* FT_WinFNT_ID_OEM :: * FT_WinFNT_ID_OEM ::
* From Michael Pöttgen <michael@poettgen.de>: * From Michael Pöttgen <michael@poettgen.de>:
* *
* The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM * The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM
* is used for the charset of vector fonts, like `modern.fon', * is used for the charset of vector fonts, like `modern.fon',
* `roman.fon', and `script.fon' on Windows. * `roman.fon', and `script.fon' on Windows.
* *
* The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value * The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value
* specifies a character set that is operating-system dependent. * specifies a character set that is operating-system dependent.
* *
* The `IFIMETRICS' documentation from the `Windows Driver * The `IFIMETRICS' documentation from the `Windows Driver
* Development Kit' says: This font supports an OEM-specific * Development Kit' says: This font supports an OEM-specific
* character set. The OEM character set is system dependent. * character set. The OEM character set is system dependent.
* *
* In general OEM, as opposed to ANSI (i.e., cp1252), denotes the * In general OEM, as opposed to ANSI (i.e., cp1252), denotes the
* second default codepage that most international versions of * second default codepage that most international versions of
* Windows have. It is one of the OEM codepages from * Windows have. It is one of the OEM codepages from
* *
* http://www.microsoft.com/globaldev/reference/cphome.mspx, * http://www.microsoft.com/globaldev/reference/cphome.mspx,
* *
* and is used for the `DOS boxes', to support legacy applications. * and is used for the `DOS boxes', to support legacy applications.
* A German Windows version for example usually uses ANSI codepage * A German Windows version for example usually uses ANSI codepage
* 1252 and OEM codepage 850. * 1252 and OEM codepage 850.
* *
* FT_WinFNT_ID_CP874 :: * FT_WinFNT_ID_CP874 ::
* A superset of Thai TIS 620 and ISO 8859-11. * A superset of Thai TIS 620 and ISO 8859-11.
* *
* FT_WinFNT_ID_CP932 :: * FT_WinFNT_ID_CP932 ::
* A superset of Japanese Shift-JIS (with minor deviations). * A superset of Japanese Shift-JIS (with minor deviations).
* *
* FT_WinFNT_ID_CP936 :: * FT_WinFNT_ID_CP936 ::
* A superset of simplified Chinese GB 2312-1980 (with different * A superset of simplified Chinese GB 2312-1980 (with different
* ordering and minor deviations). * ordering and minor deviations).
* *
* FT_WinFNT_ID_CP949 :: * FT_WinFNT_ID_CP949 ::
* A superset of Korean Hangul KS~C 5601-1987 (with different * A superset of Korean Hangul KS~C 5601-1987 (with different
* ordering and minor deviations). * ordering and minor deviations).
* *
* FT_WinFNT_ID_CP950 :: * FT_WinFNT_ID_CP950 ::
* A superset of traditional Chinese Big~5 ETen (with different * A superset of traditional Chinese Big~5 ETen (with different
* ordering and minor deviations). * ordering and minor deviations).
* *
* FT_WinFNT_ID_CP1250 :: * FT_WinFNT_ID_CP1250 ::
* A superset of East European ISO 8859-2 (with slightly different * A superset of East European ISO 8859-2 (with slightly different
* ordering). * ordering).
* *
* FT_WinFNT_ID_CP1251 :: * FT_WinFNT_ID_CP1251 ::
* A superset of Russian ISO 8859-5 (with different ordering). * A superset of Russian ISO 8859-5 (with different ordering).
* *
* FT_WinFNT_ID_CP1252 :: * FT_WinFNT_ID_CP1252 ::
* ANSI encoding. A superset of ISO 8859-1. * ANSI encoding. A superset of ISO 8859-1.
* *
* FT_WinFNT_ID_CP1253 :: * FT_WinFNT_ID_CP1253 ::
* A superset of Greek ISO 8859-7 (with minor modifications). * A superset of Greek ISO 8859-7 (with minor modifications).
* *
* FT_WinFNT_ID_CP1254 :: * FT_WinFNT_ID_CP1254 ::
* A superset of Turkish ISO 8859-9. * A superset of Turkish ISO 8859-9.
* *
* FT_WinFNT_ID_CP1255 :: * FT_WinFNT_ID_CP1255 ::
* A superset of Hebrew ISO 8859-8 (with some modifications). * A superset of Hebrew ISO 8859-8 (with some modifications).
* *
* FT_WinFNT_ID_CP1256 :: * FT_WinFNT_ID_CP1256 ::
* A superset of Arabic ISO 8859-6 (with different ordering). * A superset of Arabic ISO 8859-6 (with different ordering).
* *
* FT_WinFNT_ID_CP1257 :: * FT_WinFNT_ID_CP1257 ::
* A superset of Baltic ISO 8859-13 (with some deviations). * A superset of Baltic ISO 8859-13 (with some deviations).
* *
* FT_WinFNT_ID_CP1258 :: * FT_WinFNT_ID_CP1258 ::
* For Vietnamese. This encoding doesn't cover all necessary * For Vietnamese. This encoding doesn't cover all necessary
* characters. * characters.
* *
* FT_WinFNT_ID_CP1361 :: * FT_WinFNT_ID_CP1361 ::
* Korean (Johab). * Korean (Johab).
*/ */
#define FT_WinFNT_ID_CP1252 0 #define FT_WinFNT_ID_CP1252 0
#define FT_WinFNT_ID_DEFAULT 1 #define FT_WinFNT_ID_DEFAULT 1
#define FT_WinFNT_ID_SYMBOL 2 #define FT_WinFNT_ID_SYMBOL 2
#define FT_WinFNT_ID_MAC 77 #define FT_WinFNT_ID_MAC 77
#define FT_WinFNT_ID_CP932 128 #define FT_WinFNT_ID_CP932 128
#define FT_WinFNT_ID_CP949 129 #define FT_WinFNT_ID_CP949 129
#define FT_WinFNT_ID_CP1361 130 #define FT_WinFNT_ID_CP1361 130
#define FT_WinFNT_ID_CP936 134 #define FT_WinFNT_ID_CP936 134
#define FT_WinFNT_ID_CP950 136 #define FT_WinFNT_ID_CP950 136
#define FT_WinFNT_ID_CP1253 161 #define FT_WinFNT_ID_CP1253 161
#define FT_WinFNT_ID_CP1254 162 #define FT_WinFNT_ID_CP1254 162
#define FT_WinFNT_ID_CP1258 163 #define FT_WinFNT_ID_CP1258 163
#define FT_WinFNT_ID_CP1255 177 #define FT_WinFNT_ID_CP1255 177
#define FT_WinFNT_ID_CP1256 178 #define FT_WinFNT_ID_CP1256 178
#define FT_WinFNT_ID_CP1257 186 #define FT_WinFNT_ID_CP1257 186
#define FT_WinFNT_ID_CP1251 204 #define FT_WinFNT_ID_CP1251 204
#define FT_WinFNT_ID_CP874 222 #define FT_WinFNT_ID_CP874 222
#define FT_WinFNT_ID_CP1250 238 #define FT_WinFNT_ID_CP1250 238
#define FT_WinFNT_ID_OEM 255 #define FT_WinFNT_ID_OEM 255
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_WinFNT_HeaderRec */ /* FT_WinFNT_HeaderRec */
/* */ /* */
/* <Description> */ /* <Description> */
/* Windows FNT Header info. */ /* Windows FNT Header info. */
/* */ /* */
typedef struct FT_WinFNT_HeaderRec_ typedef struct FT_WinFNT_HeaderRec_
{ {
FT_UShort version; FT_UShort version;
FT_ULong file_size; FT_ULong file_size;
FT_Byte copyright[60]; FT_Byte copyright[60];
FT_UShort file_type; FT_UShort file_type;
FT_UShort nominal_point_size; FT_UShort nominal_point_size;
FT_UShort vertical_resolution; FT_UShort vertical_resolution;
FT_UShort horizontal_resolution; FT_UShort horizontal_resolution;
FT_UShort ascent; FT_UShort ascent;
FT_UShort internal_leading; FT_UShort internal_leading;
FT_UShort external_leading; FT_UShort external_leading;
FT_Byte italic; FT_Byte italic;
FT_Byte underline; FT_Byte underline;
FT_Byte strike_out; FT_Byte strike_out;
FT_UShort weight; FT_UShort weight;
FT_Byte charset; FT_Byte charset;
FT_UShort pixel_width; FT_UShort pixel_width;
FT_UShort pixel_height; FT_UShort pixel_height;
FT_Byte pitch_and_family; FT_Byte pitch_and_family;
FT_UShort avg_width; FT_UShort avg_width;
FT_UShort max_width; FT_UShort max_width;
FT_Byte first_char; FT_Byte first_char;
FT_Byte last_char; FT_Byte last_char;
FT_Byte default_char; FT_Byte default_char;
FT_Byte break_char; FT_Byte break_char;
FT_UShort bytes_per_row; FT_UShort bytes_per_row;
FT_ULong device_offset; FT_ULong device_offset;
FT_ULong face_name_offset; FT_ULong face_name_offset;
FT_ULong bits_pointer; FT_ULong bits_pointer;
FT_ULong bits_offset; FT_ULong bits_offset;
FT_Byte reserved; FT_Byte reserved;
FT_ULong flags; FT_ULong flags;
FT_UShort A_space; FT_UShort A_space;
FT_UShort B_space; FT_UShort B_space;
FT_UShort C_space; FT_UShort C_space;
FT_UShort color_table_offset; FT_UShort color_table_offset;
FT_ULong reserved1[4]; FT_ULong reserved1[4];
} FT_WinFNT_HeaderRec; } FT_WinFNT_HeaderRec;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_WinFNT_Header */ /* FT_WinFNT_Header */
/* */ /* */
/* <Description> */ /* <Description> */
/* A handle to an @FT_WinFNT_HeaderRec structure. */ /* A handle to an @FT_WinFNT_HeaderRec structure. */
/* */ /* */
typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header; typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header;
/********************************************************************** /**********************************************************************
* *
* @function: * @function:
* FT_Get_WinFNT_Header * FT_Get_WinFNT_Header
* *
* @description: * @description:
* Retrieve a Windows FNT font info header. * Retrieve a Windows FNT font info header.
* *
* @input: * @input:
* face :: A handle to the input face. * face :: A handle to the input face.
* *
* @output: * @output:
* aheader :: The WinFNT header. * aheader :: The WinFNT header.
* *
* @return: * @return:
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This function only works with Windows FNT faces, returning an error * This function only works with Windows FNT faces, returning an error
* otherwise. * otherwise.
*/ */
FT_EXPORT( FT_Error ) FT_EXPORT( FT_Error )
FT_Get_WinFNT_Header( FT_Face face, FT_Get_WinFNT_Header( FT_Face face,
FT_WinFNT_HeaderRec *aheader ); FT_WinFNT_HeaderRec *aheader );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTWINFNT_H__ */ #endif /* __FTWINFNT_H__ */
/* END */ /* END */
/* Local Variables: */ /* Local Variables: */
/* coding: utf-8 */ /* coding: utf-8 */
/* End: */ /* End: */

View file

@ -1,83 +1,83 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftxf86.h */ /* ftxf86.h */
/* */ /* */
/* Support functions for X11. */ /* Support functions for X11. */
/* */ /* */
/* Copyright 2002, 2003, 2004, 2006, 2007 by */ /* Copyright 2002, 2003, 2004, 2006, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTXF86_H__ #ifndef __FTXF86_H__
#define __FTXF86_H__ #define __FTXF86_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Section> */ /* <Section> */
/* font_formats */ /* font_formats */
/* */ /* */
/* <Title> */ /* <Title> */
/* Font Formats */ /* Font Formats */
/* */ /* */
/* <Abstract> */ /* <Abstract> */
/* Getting the font format. */ /* Getting the font format. */
/* */ /* */
/* <Description> */ /* <Description> */
/* The single function in this section can be used to get the font */ /* The single function in this section can be used to get the font */
/* format. Note that this information is not needed normally; */ /* format. Note that this information is not needed normally; */
/* however, there are special cases (like in PDF devices) where it is */ /* however, there are special cases (like in PDF devices) where it is */
/* important to differentiate, in spite of FreeType's uniform API. */ /* important to differentiate, in spite of FreeType's uniform API. */
/* */ /* */
/* This function is in the X11/xf86 namespace for historical reasons */ /* This function is in the X11/xf86 namespace for historical reasons */
/* and in no way depends on that windowing system. */ /* and in no way depends on that windowing system. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Get_X11_Font_Format */ /* FT_Get_X11_Font_Format */
/* */ /* */
/* <Description> */ /* <Description> */
/* Return a string describing the format of a given face, using values */ /* Return a string describing the format of a given face, using values */
/* which can be used as an X11 FONT_PROPERTY. Possible values are */ /* which can be used as an X11 FONT_PROPERTY. Possible values are */
/* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */ /* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */
/* `PFR', and `Windows~FNT'. */ /* `PFR', and `Windows~FNT'. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: */ /* face :: */
/* Input face handle. */ /* Input face handle. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Font format string. NULL in case of error. */ /* Font format string. NULL in case of error. */
/* */ /* */
FT_EXPORT( const char* ) FT_EXPORT( const char* )
FT_Get_X11_Font_Format( FT_Face face ); FT_Get_X11_Font_Format( FT_Face face );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTXF86_H__ */ #endif /* __FTXF86_H__ */

View file

@ -1,231 +1,231 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* autohint.h */ /* autohint.h */
/* */ /* */
/* High-level `autohint' module-specific interface (specification). */ /* High-level `autohint' module-specific interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2007 by */ /* Copyright 1996-2001, 2002, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* The auto-hinter is used to load and automatically hint glyphs if a */ /* The auto-hinter is used to load and automatically hint glyphs if a */
/* format-specific hinter isn't available. */ /* format-specific hinter isn't available. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __AUTOHINT_H__ #ifndef __AUTOHINT_H__
#define __AUTOHINT_H__ #define __AUTOHINT_H__
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* A small technical note regarding automatic hinting in order to */ /* A small technical note regarding automatic hinting in order to */
/* clarify this module interface. */ /* clarify this module interface. */
/* */ /* */
/* An automatic hinter might compute two kinds of data for a given face: */ /* An automatic hinter might compute two kinds of data for a given face: */
/* */ /* */
/* - global hints: Usually some metrics that describe global properties */ /* - global hints: Usually some metrics that describe global properties */
/* of the face. It is computed by scanning more or less */ /* of the face. It is computed by scanning more or less */
/* aggressively the glyphs in the face, and thus can be */ /* aggressively the glyphs in the face, and thus can be */
/* very slow to compute (even if the size of global */ /* very slow to compute (even if the size of global */
/* hints is really small). */ /* hints is really small). */
/* */ /* */
/* - glyph hints: These describe some important features of the glyph */ /* - glyph hints: These describe some important features of the glyph */
/* outline, as well as how to align them. They are */ /* outline, as well as how to align them. They are */
/* generally much faster to compute than global hints. */ /* generally much faster to compute than global hints. */
/* */ /* */
/* The current FreeType auto-hinter does a pretty good job while */ /* The current FreeType auto-hinter does a pretty good job while */
/* performing fast computations for both global and glyph hints. */ /* performing fast computations for both global and glyph hints. */
/* However, we might be interested in introducing more complex and */ /* However, we might be interested in introducing more complex and */
/* powerful algorithms in the future, like the one described in the John */ /* powerful algorithms in the future, like the one described in the John */
/* D. Hobby paper, which unfortunately requires a lot more horsepower. */ /* D. Hobby paper, which unfortunately requires a lot more horsepower. */
/* */ /* */
/* Because a sufficiently sophisticated font management system would */ /* Because a sufficiently sophisticated font management system would */
/* typically implement an LRU cache of opened face objects to reduce */ /* typically implement an LRU cache of opened face objects to reduce */
/* memory usage, it is a good idea to be able to avoid recomputing */ /* memory usage, it is a good idea to be able to avoid recomputing */
/* global hints every time the same face is re-opened. */ /* global hints every time the same face is re-opened. */
/* */ /* */
/* We thus provide the ability to cache global hints outside of the face */ /* We thus provide the ability to cache global hints outside of the face */
/* object, in order to speed up font re-opening time. Of course, this */ /* object, in order to speed up font re-opening time. Of course, this */
/* feature is purely optional, so most client programs won't even notice */ /* feature is purely optional, so most client programs won't even notice */
/* it. */ /* it. */
/* */ /* */
/* I initially thought that it would be a good idea to cache the glyph */ /* I initially thought that it would be a good idea to cache the glyph */
/* hints too. However, my general idea now is that if you really need */ /* hints too. However, my general idea now is that if you really need */
/* to cache these too, you are simply in need of a new font format, */ /* to cache these too, you are simply in need of a new font format, */
/* where all this information could be stored within the font file and */ /* where all this information could be stored within the font file and */
/* decoded on the fly. */ /* decoded on the fly. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
typedef struct FT_AutoHinterRec_ *FT_AutoHinter; typedef struct FT_AutoHinterRec_ *FT_AutoHinter;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_AutoHinter_GlobalGetFunc */ /* FT_AutoHinter_GlobalGetFunc */
/* */ /* */
/* <Description> */ /* <Description> */
/* Retrieves the global hints computed for a given face object the */ /* Retrieves the global hints computed for a given face object the */
/* resulting data is dissociated from the face and will survive a */ /* resulting data is dissociated from the face and will survive a */
/* call to FT_Done_Face(). It must be discarded through the API */ /* call to FT_Done_Face(). It must be discarded through the API */
/* FT_AutoHinter_GlobalDoneFunc(). */ /* FT_AutoHinter_GlobalDoneFunc(). */
/* */ /* */
/* <Input> */ /* <Input> */
/* hinter :: A handle to the source auto-hinter. */ /* hinter :: A handle to the source auto-hinter. */
/* */ /* */
/* face :: A handle to the source face object. */ /* face :: A handle to the source face object. */
/* */ /* */
/* <Output> */ /* <Output> */
/* global_hints :: A typeless pointer to the global hints. */ /* global_hints :: A typeless pointer to the global hints. */
/* */ /* */
/* global_len :: The size in bytes of the global hints. */ /* global_len :: The size in bytes of the global hints. */
/* */ /* */
typedef void typedef void
(*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter, (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter hinter,
FT_Face face, FT_Face face,
void** global_hints, void** global_hints,
long* global_len ); long* global_len );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_AutoHinter_GlobalDoneFunc */ /* FT_AutoHinter_GlobalDoneFunc */
/* */ /* */
/* <Description> */ /* <Description> */
/* Discards the global hints retrieved through */ /* Discards the global hints retrieved through */
/* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */ /* FT_AutoHinter_GlobalGetFunc(). This is the only way these hints */
/* are freed from memory. */ /* are freed from memory. */
/* */ /* */
/* <Input> */ /* <Input> */
/* hinter :: A handle to the auto-hinter module. */ /* hinter :: A handle to the auto-hinter module. */
/* */ /* */
/* global :: A pointer to retrieved global hints to discard. */ /* global :: A pointer to retrieved global hints to discard. */
/* */ /* */
typedef void typedef void
(*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter, (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter hinter,
void* global ); void* global );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_AutoHinter_GlobalResetFunc */ /* FT_AutoHinter_GlobalResetFunc */
/* */ /* */
/* <Description> */ /* <Description> */
/* This function is used to recompute the global metrics in a given */ /* This function is used to recompute the global metrics in a given */
/* font. This is useful when global font data changes (e.g. Multiple */ /* font. This is useful when global font data changes (e.g. Multiple */
/* Masters fonts where blend coordinates change). */ /* Masters fonts where blend coordinates change). */
/* */ /* */
/* <Input> */ /* <Input> */
/* hinter :: A handle to the source auto-hinter. */ /* hinter :: A handle to the source auto-hinter. */
/* */ /* */
/* face :: A handle to the face. */ /* face :: A handle to the face. */
/* */ /* */
typedef void typedef void
(*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter, (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter hinter,
FT_Face face ); FT_Face face );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <FuncType> */ /* <FuncType> */
/* FT_AutoHinter_GlyphLoadFunc */ /* FT_AutoHinter_GlyphLoadFunc */
/* */ /* */
/* <Description> */ /* <Description> */
/* This function is used to load, scale, and automatically hint a */ /* This function is used to load, scale, and automatically hint a */
/* glyph from a given face. */ /* glyph from a given face. */
/* */ /* */
/* <Input> */ /* <Input> */
/* face :: A handle to the face. */ /* face :: A handle to the face. */
/* */ /* */
/* glyph_index :: The glyph index. */ /* glyph_index :: The glyph index. */
/* */ /* */
/* load_flags :: The load flags. */ /* load_flags :: The load flags. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This function is capable of loading composite glyphs by hinting */ /* This function is capable of loading composite glyphs by hinting */
/* each sub-glyph independently (which improves quality). */ /* each sub-glyph independently (which improves quality). */
/* */ /* */
/* It will call the font driver with FT_Load_Glyph(), with */ /* It will call the font driver with FT_Load_Glyph(), with */
/* FT_LOAD_NO_SCALE set. */ /* FT_LOAD_NO_SCALE set. */
/* */ /* */
typedef FT_Error typedef FT_Error
(*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter, (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter hinter,
FT_GlyphSlot slot, FT_GlyphSlot slot,
FT_Size size, FT_Size size,
FT_UInt glyph_index, FT_UInt glyph_index,
FT_Int32 load_flags ); FT_Int32 load_flags );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_AutoHinter_ServiceRec */ /* FT_AutoHinter_ServiceRec */
/* */ /* */
/* <Description> */ /* <Description> */
/* The auto-hinter module's interface. */ /* The auto-hinter module's interface. */
/* */ /* */
typedef struct FT_AutoHinter_ServiceRec_ typedef struct FT_AutoHinter_ServiceRec_
{ {
FT_AutoHinter_GlobalResetFunc reset_face; FT_AutoHinter_GlobalResetFunc reset_face;
FT_AutoHinter_GlobalGetFunc get_global_hints; FT_AutoHinter_GlobalGetFunc get_global_hints;
FT_AutoHinter_GlobalDoneFunc done_global_hints; FT_AutoHinter_GlobalDoneFunc done_global_hints;
FT_AutoHinter_GlyphLoadFunc load_glyph; FT_AutoHinter_GlyphLoadFunc load_glyph;
} FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service; } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service;
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \ #define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \
done_global_hints_, load_glyph_) \ done_global_hints_, load_glyph_) \
FT_CALLBACK_TABLE_DEF \ FT_CALLBACK_TABLE_DEF \
const FT_AutoHinter_ServiceRec class_ = \ const FT_AutoHinter_ServiceRec class_ = \
{ \ { \
reset_face_, get_global_hints_, done_global_hints_, load_glyph_ \ reset_face_, get_global_hints_, done_global_hints_, load_glyph_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \ #define FT_DEFINE_AUTOHINTER_SERVICE(class_, reset_face_, get_global_hints_, \
done_global_hints_, load_glyph_) \ done_global_hints_, load_glyph_) \
void \ void \
FT_Init_Class_##class_( FT_Library library, \ FT_Init_Class_##class_( FT_Library library, \
FT_AutoHinter_ServiceRec* clazz) \ FT_AutoHinter_ServiceRec* clazz) \
{ \ { \
FT_UNUSED(library); \ FT_UNUSED(library); \
clazz->reset_face = reset_face_; \ clazz->reset_face = reset_face_; \
clazz->get_global_hints = get_global_hints_; \ clazz->get_global_hints = get_global_hints_; \
clazz->done_global_hints = done_global_hints_; \ clazz->done_global_hints = done_global_hints_; \
clazz->load_glyph = load_glyph_; \ clazz->load_glyph = load_glyph_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER FT_END_HEADER
#endif /* __AUTOHINT_H__ */ #endif /* __AUTOHINT_H__ */
/* END */ /* END */

View file

@ -1,179 +1,179 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftcalc.h */ /* ftcalc.h */
/* */ /* */
/* Arithmetic computations (specification). */ /* Arithmetic computations (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTCALC_H__ #ifndef __FTCALC_H__
#define __FTCALC_H__ #define __FTCALC_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_FixedSqrt */ /* FT_FixedSqrt */
/* */ /* */
/* <Description> */ /* <Description> */
/* Computes the square root of a 16.16 fixed point value. */ /* Computes the square root of a 16.16 fixed point value. */
/* */ /* */
/* <Input> */ /* <Input> */
/* x :: The value to compute the root for. */ /* x :: The value to compute the root for. */
/* */ /* */
/* <Return> */ /* <Return> */
/* The result of `sqrt(x)'. */ /* The result of `sqrt(x)'. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This function is not very fast. */ /* This function is not very fast. */
/* */ /* */
FT_BASE( FT_Int32 ) FT_BASE( FT_Int32 )
FT_SqrtFixed( FT_Int32 x ); FT_SqrtFixed( FT_Int32 x );
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Sqrt32 */ /* FT_Sqrt32 */
/* */ /* */
/* <Description> */ /* <Description> */
/* Computes the square root of an Int32 integer (which will be */ /* Computes the square root of an Int32 integer (which will be */
/* handled as an unsigned long value). */ /* handled as an unsigned long value). */
/* */ /* */
/* <Input> */ /* <Input> */
/* x :: The value to compute the root for. */ /* x :: The value to compute the root for. */
/* */ /* */
/* <Return> */ /* <Return> */
/* The result of `sqrt(x)'. */ /* The result of `sqrt(x)'. */
/* */ /* */
FT_EXPORT( FT_Int32 ) FT_EXPORT( FT_Int32 )
FT_Sqrt32( FT_Int32 x ); FT_Sqrt32( FT_Int32 x );
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */ /* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifdef TT_USE_BYTECODE_INTERPRETER #ifdef TT_USE_BYTECODE_INTERPRETER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_MulDiv_No_Round */ /* FT_MulDiv_No_Round */
/* */ /* */
/* <Description> */ /* <Description> */
/* A very simple function used to perform the computation `(a*b)/c' */ /* A very simple function used to perform the computation `(a*b)/c' */
/* (without rounding) with maximal accuracy (it uses a 64-bit */ /* (without rounding) with maximal accuracy (it uses a 64-bit */
/* intermediate integer whenever necessary). */ /* intermediate integer whenever necessary). */
/* */ /* */
/* This function isn't necessarily as fast as some processor specific */ /* This function isn't necessarily as fast as some processor specific */
/* operations, but is at least completely portable. */ /* operations, but is at least completely portable. */
/* */ /* */
/* <Input> */ /* <Input> */
/* a :: The first multiplier. */ /* a :: The first multiplier. */
/* b :: The second multiplier. */ /* b :: The second multiplier. */
/* c :: The divisor. */ /* c :: The divisor. */
/* */ /* */
/* <Return> */ /* <Return> */
/* The result of `(a*b)/c'. This function never traps when trying to */ /* The result of `(a*b)/c'. This function never traps when trying to */
/* divide by zero; it simply returns `MaxInt' or `MinInt' depending */ /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
/* on the signs of `a' and `b'. */ /* on the signs of `a' and `b'. */
/* */ /* */
FT_BASE( FT_Long ) FT_BASE( FT_Long )
FT_MulDiv_No_Round( FT_Long a, FT_MulDiv_No_Round( FT_Long a,
FT_Long b, FT_Long b,
FT_Long c ); FT_Long c );
#endif /* TT_USE_BYTECODE_INTERPRETER */ #endif /* TT_USE_BYTECODE_INTERPRETER */
/* /*
* A variant of FT_Matrix_Multiply which scales its result afterwards. * A variant of FT_Matrix_Multiply which scales its result afterwards.
* The idea is that both `a' and `b' are scaled by factors of 10 so that * The idea is that both `a' and `b' are scaled by factors of 10 so that
* the values are as precise as possible to get a correct result during * the values are as precise as possible to get a correct result during
* the 64bit multiplication. Let `sa' and `sb' be the scaling factors of * the 64bit multiplication. Let `sa' and `sb' be the scaling factors of
* `a' and `b', respectively, then the scaling factor of the result is * `a' and `b', respectively, then the scaling factor of the result is
* `sa*sb'. * `sa*sb'.
*/ */
FT_BASE( void ) FT_BASE( void )
FT_Matrix_Multiply_Scaled( const FT_Matrix* a, FT_Matrix_Multiply_Scaled( const FT_Matrix* a,
FT_Matrix *b, FT_Matrix *b,
FT_Long scaling ); FT_Long scaling );
/* /*
* A variant of FT_Vector_Transform. See comments for * A variant of FT_Vector_Transform. See comments for
* FT_Matrix_Multiply_Scaled. * FT_Matrix_Multiply_Scaled.
*/ */
FT_BASE( void ) FT_BASE( void )
FT_Vector_Transform_Scaled( FT_Vector* vector, FT_Vector_Transform_Scaled( FT_Vector* vector,
const FT_Matrix* matrix, const FT_Matrix* matrix,
FT_Long scaling ); FT_Long scaling );
/* /*
* Return -1, 0, or +1, depending on the orientation of a given corner. * Return -1, 0, or +1, depending on the orientation of a given corner.
* We use the Cartesian coordinate system, with positive vertical values * We use the Cartesian coordinate system, with positive vertical values
* going upwards. The function returns +1 if the corner turns to the * going upwards. The function returns +1 if the corner turns to the
* left, -1 to the right, and 0 for undecidable cases. * left, -1 to the right, and 0 for undecidable cases.
*/ */
FT_BASE( FT_Int ) FT_BASE( FT_Int )
ft_corner_orientation( FT_Pos in_x, ft_corner_orientation( FT_Pos in_x,
FT_Pos in_y, FT_Pos in_y,
FT_Pos out_x, FT_Pos out_x,
FT_Pos out_y ); FT_Pos out_y );
/* /*
* Return TRUE if a corner is flat or nearly flat. This is equivalent to * Return TRUE if a corner is flat or nearly flat. This is equivalent to
* saying that the angle difference between the `in' and `out' vectors is * saying that the angle difference between the `in' and `out' vectors is
* very small. * very small.
*/ */
FT_BASE( FT_Int ) FT_BASE( FT_Int )
ft_corner_is_flat( FT_Pos in_x, ft_corner_is_flat( FT_Pos in_x,
FT_Pos in_y, FT_Pos in_y,
FT_Pos out_x, FT_Pos out_x,
FT_Pos out_y ); FT_Pos out_y );
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 ) #define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
#define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 ) #define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
#define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 ) #define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
#define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 ) #define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 )
#define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) ) #define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) )
#define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 ) #define FIXED_TO_INT( x ) ( FT_RoundFix( x ) >> 16 )
#define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \ #define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
: ( -( ( 32 - (x) ) & -64 ) ) ) : ( -( ( 32 - (x) ) & -64 ) ) )
FT_END_HEADER FT_END_HEADER
#endif /* __FTCALC_H__ */ #endif /* __FTCALC_H__ */
/* END */ /* END */

View file

@ -1,250 +1,250 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftdebug.h */ /* ftdebug.h */
/* */ /* */
/* Debugging and logging component (specification). */ /* Debugging and logging component (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008, 2009 by */ /* Copyright 1996-2001, 2002, 2004, 2006, 2007, 2008, 2009 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/* */ /* */
/* IMPORTANT: A description of FreeType's debugging support can be */ /* IMPORTANT: A description of FreeType's debugging support can be */
/* found in `docs/DEBUG.TXT'. Read it if you need to use or */ /* found in `docs/DEBUG.TXT'. Read it if you need to use or */
/* understand this code. */ /* understand this code. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTDEBUG_H__ #ifndef __FTDEBUG_H__
#define __FTDEBUG_H__ #define __FTDEBUG_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_CONFIG_CONFIG_H #include FT_CONFIG_CONFIG_H
#include FT_FREETYPE_H #include FT_FREETYPE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */ /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
/* is already defined; this simplifies the following #ifdefs */ /* is already defined; this simplifies the following #ifdefs */
/* */ /* */
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
#undef FT_DEBUG_LEVEL_ERROR #undef FT_DEBUG_LEVEL_ERROR
#define FT_DEBUG_LEVEL_ERROR #define FT_DEBUG_LEVEL_ERROR
#endif #endif
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Define the trace enums as well as the trace levels array when they */ /* Define the trace enums as well as the trace levels array when they */
/* are needed. */ /* are needed. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
#define FT_TRACE_DEF( x ) trace_ ## x , #define FT_TRACE_DEF( x ) trace_ ## x ,
/* defining the enumeration */ /* defining the enumeration */
typedef enum FT_Trace_ typedef enum FT_Trace_
{ {
#include FT_INTERNAL_TRACE_H #include FT_INTERNAL_TRACE_H
trace_count trace_count
} FT_Trace; } FT_Trace;
/* defining the array of trace levels, provided by `src/base/ftdebug.c' */ /* defining the array of trace levels, provided by `src/base/ftdebug.c' */
extern int ft_trace_levels[trace_count]; extern int ft_trace_levels[trace_count];
#undef FT_TRACE_DEF #undef FT_TRACE_DEF
#endif /* FT_DEBUG_LEVEL_TRACE */ #endif /* FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Define the FT_TRACE macro */ /* Define the FT_TRACE macro */
/* */ /* */
/* IMPORTANT! */ /* IMPORTANT! */
/* */ /* */
/* Each component must define the macro FT_COMPONENT to a valid FT_Trace */ /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */
/* value before using any TRACE macro. */ /* value before using any TRACE macro. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifdef FT_DEBUG_LEVEL_TRACE #ifdef FT_DEBUG_LEVEL_TRACE
#define FT_TRACE( level, varformat ) \ #define FT_TRACE( level, varformat ) \
do \ do \
{ \ { \
if ( ft_trace_levels[FT_COMPONENT] >= level ) \ if ( ft_trace_levels[FT_COMPONENT] >= level ) \
FT_Message varformat; \ FT_Message varformat; \
} while ( 0 ) } while ( 0 )
#else /* !FT_DEBUG_LEVEL_TRACE */ #else /* !FT_DEBUG_LEVEL_TRACE */
#define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */ #define FT_TRACE( level, varformat ) do { } while ( 0 ) /* nothing */
#endif /* !FT_DEBUG_LEVEL_TRACE */ #endif /* !FT_DEBUG_LEVEL_TRACE */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Trace_Get_Count */ /* FT_Trace_Get_Count */
/* */ /* */
/* <Description> */ /* <Description> */
/* Return the number of available trace components. */ /* Return the number of available trace components. */
/* */ /* */
/* <Return> */ /* <Return> */
/* The number of trace components. 0 if FreeType 2 is not built with */ /* The number of trace components. 0 if FreeType 2 is not built with */
/* FT_DEBUG_LEVEL_TRACE definition. */ /* FT_DEBUG_LEVEL_TRACE definition. */
/* */ /* */
/* <Note> */ /* <Note> */
/* This function may be useful if you want to access elements of */ /* This function may be useful if you want to access elements of */
/* the internal `ft_trace_levels' array by an index. */ /* the internal `ft_trace_levels' array by an index. */
/* */ /* */
FT_BASE( FT_Int ) FT_BASE( FT_Int )
FT_Trace_Get_Count( void ); FT_Trace_Get_Count( void );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Trace_Get_Name */ /* FT_Trace_Get_Name */
/* */ /* */
/* <Description> */ /* <Description> */
/* Return the name of a trace component. */ /* Return the name of a trace component. */
/* */ /* */
/* <Input> */ /* <Input> */
/* The index of the trace component. */ /* The index of the trace component. */
/* */ /* */
/* <Return> */ /* <Return> */
/* The name of the trace component. This is a statically allocated */ /* The name of the trace component. This is a statically allocated */
/* C string, so do not free it after use. NULL if FreeType 2 is not */ /* C string, so do not free it after use. NULL if FreeType 2 is not */
/* built with FT_DEBUG_LEVEL_TRACE definition. */ /* built with FT_DEBUG_LEVEL_TRACE definition. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Use @FT_Trace_Get_Count to get the number of available trace */ /* Use @FT_Trace_Get_Count to get the number of available trace */
/* components. */ /* components. */
/* */ /* */
/* This function may be useful if you want to control FreeType 2's */ /* This function may be useful if you want to control FreeType 2's */
/* debug level in your application. */ /* debug level in your application. */
/* */ /* */
FT_BASE( const char * ) FT_BASE( const char * )
FT_Trace_Get_Name( FT_Int idx ); FT_Trace_Get_Name( FT_Int idx );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* You need two opening and closing parentheses! */ /* You need two opening and closing parentheses! */
/* */ /* */
/* Example: FT_TRACE0(( "Value is %i", foo )) */ /* Example: FT_TRACE0(( "Value is %i", foo )) */
/* */ /* */
/* Output of the FT_TRACEX macros is sent to stderr. */ /* Output of the FT_TRACEX macros is sent to stderr. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#define FT_TRACE0( varformat ) FT_TRACE( 0, varformat ) #define FT_TRACE0( varformat ) FT_TRACE( 0, varformat )
#define FT_TRACE1( varformat ) FT_TRACE( 1, varformat ) #define FT_TRACE1( varformat ) FT_TRACE( 1, varformat )
#define FT_TRACE2( varformat ) FT_TRACE( 2, varformat ) #define FT_TRACE2( varformat ) FT_TRACE( 2, varformat )
#define FT_TRACE3( varformat ) FT_TRACE( 3, varformat ) #define FT_TRACE3( varformat ) FT_TRACE( 3, varformat )
#define FT_TRACE4( varformat ) FT_TRACE( 4, varformat ) #define FT_TRACE4( varformat ) FT_TRACE( 4, varformat )
#define FT_TRACE5( varformat ) FT_TRACE( 5, varformat ) #define FT_TRACE5( varformat ) FT_TRACE( 5, varformat )
#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat ) #define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat ) #define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Define the FT_ERROR macro. */ /* Define the FT_ERROR macro. */
/* */ /* */
/* Output of this macro is sent to stderr. */ /* Output of this macro is sent to stderr. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifdef FT_DEBUG_LEVEL_ERROR #ifdef FT_DEBUG_LEVEL_ERROR
#define FT_ERROR( varformat ) FT_Message varformat #define FT_ERROR( varformat ) FT_Message varformat
#else /* !FT_DEBUG_LEVEL_ERROR */ #else /* !FT_DEBUG_LEVEL_ERROR */
#define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */ #define FT_ERROR( varformat ) do { } while ( 0 ) /* nothing */
#endif /* !FT_DEBUG_LEVEL_ERROR */ #endif /* !FT_DEBUG_LEVEL_ERROR */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Define the FT_ASSERT macro. */ /* Define the FT_ASSERT macro. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifdef FT_DEBUG_LEVEL_ERROR #ifdef FT_DEBUG_LEVEL_ERROR
#define FT_ASSERT( condition ) \ #define FT_ASSERT( condition ) \
do \ do \
{ \ { \
if ( !( condition ) ) \ if ( !( condition ) ) \
FT_Panic( "assertion failed on line %d of file %s\n", \ FT_Panic( "assertion failed on line %d of file %s\n", \
__LINE__, __FILE__ ); \ __LINE__, __FILE__ ); \
} while ( 0 ) } while ( 0 )
#else /* !FT_DEBUG_LEVEL_ERROR */ #else /* !FT_DEBUG_LEVEL_ERROR */
#define FT_ASSERT( condition ) do { } while ( 0 ) #define FT_ASSERT( condition ) do { } while ( 0 )
#endif /* !FT_DEBUG_LEVEL_ERROR */ #endif /* !FT_DEBUG_LEVEL_ERROR */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Define `FT_Message' and `FT_Panic' when needed. */ /* Define `FT_Message' and `FT_Panic' when needed. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifdef FT_DEBUG_LEVEL_ERROR #ifdef FT_DEBUG_LEVEL_ERROR
#include "stdio.h" /* for vfprintf() */ #include "stdio.h" /* for vfprintf() */
/* print a message */ /* print a message */
FT_BASE( void ) FT_BASE( void )
FT_Message( const char* fmt, FT_Message( const char* fmt,
... ); ... );
/* print a message and exit */ /* print a message and exit */
FT_BASE( void ) FT_BASE( void )
FT_Panic( const char* fmt, FT_Panic( const char* fmt,
... ); ... );
#endif /* FT_DEBUG_LEVEL_ERROR */ #endif /* FT_DEBUG_LEVEL_ERROR */
FT_BASE( void ) FT_BASE( void )
ft_debug_init( void ); ft_debug_init( void );
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* We disable the warning `conditional expression is constant' here */ /* We disable the warning `conditional expression is constant' here */
/* in order to compile cleanly with the maximum level of warnings. */ /* in order to compile cleanly with the maximum level of warnings. */
#pragma warning( disable : 4127 ) #pragma warning( disable : 4127 )
#endif /* _MSC_VER */ #endif /* _MSC_VER */
FT_END_HEADER FT_END_HEADER
#endif /* __FTDEBUG_H__ */ #endif /* __FTDEBUG_H__ */
/* END */ /* END */

View file

@ -1,422 +1,422 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftdriver.h */ /* ftdriver.h */
/* */ /* */
/* FreeType font driver interface (specification). */ /* FreeType font driver interface (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */ /* Copyright 1996-2001, 2002, 2003, 2006, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTDRIVER_H__ #ifndef __FTDRIVER_H__
#define __FTDRIVER_H__ #define __FTDRIVER_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_MODULE_H #include FT_MODULE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
typedef FT_Error typedef FT_Error
(*FT_Face_InitFunc)( FT_Stream stream, (*FT_Face_InitFunc)( FT_Stream stream,
FT_Face face, FT_Face face,
FT_Int typeface_index, FT_Int typeface_index,
FT_Int num_params, FT_Int num_params,
FT_Parameter* parameters ); FT_Parameter* parameters );
typedef void typedef void
(*FT_Face_DoneFunc)( FT_Face face ); (*FT_Face_DoneFunc)( FT_Face face );
typedef FT_Error typedef FT_Error
(*FT_Size_InitFunc)( FT_Size size ); (*FT_Size_InitFunc)( FT_Size size );
typedef void typedef void
(*FT_Size_DoneFunc)( FT_Size size ); (*FT_Size_DoneFunc)( FT_Size size );
typedef FT_Error typedef FT_Error
(*FT_Slot_InitFunc)( FT_GlyphSlot slot ); (*FT_Slot_InitFunc)( FT_GlyphSlot slot );
typedef void typedef void
(*FT_Slot_DoneFunc)( FT_GlyphSlot slot ); (*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
typedef FT_Error typedef FT_Error
(*FT_Size_RequestFunc)( FT_Size size, (*FT_Size_RequestFunc)( FT_Size size,
FT_Size_Request req ); FT_Size_Request req );
typedef FT_Error typedef FT_Error
(*FT_Size_SelectFunc)( FT_Size size, (*FT_Size_SelectFunc)( FT_Size size,
FT_ULong size_index ); FT_ULong size_index );
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
typedef FT_Error typedef FT_Error
(*FT_Size_ResetPointsFunc)( FT_Size size, (*FT_Size_ResetPointsFunc)( FT_Size size,
FT_F26Dot6 char_width, FT_F26Dot6 char_width,
FT_F26Dot6 char_height, FT_F26Dot6 char_height,
FT_UInt horz_resolution, FT_UInt horz_resolution,
FT_UInt vert_resolution ); FT_UInt vert_resolution );
typedef FT_Error typedef FT_Error
(*FT_Size_ResetPixelsFunc)( FT_Size size, (*FT_Size_ResetPixelsFunc)( FT_Size size,
FT_UInt pixel_width, FT_UInt pixel_width,
FT_UInt pixel_height ); FT_UInt pixel_height );
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
typedef FT_Error typedef FT_Error
(*FT_Slot_LoadFunc)( FT_GlyphSlot slot, (*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
FT_Size size, FT_Size size,
FT_UInt glyph_index, FT_UInt glyph_index,
FT_Int32 load_flags ); FT_Int32 load_flags );
typedef FT_UInt typedef FT_UInt
(*FT_CharMap_CharIndexFunc)( FT_CharMap charmap, (*FT_CharMap_CharIndexFunc)( FT_CharMap charmap,
FT_Long charcode ); FT_Long charcode );
typedef FT_Long typedef FT_Long
(*FT_CharMap_CharNextFunc)( FT_CharMap charmap, (*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
FT_Long charcode ); FT_Long charcode );
typedef FT_Error typedef FT_Error
(*FT_Face_GetKerningFunc)( FT_Face face, (*FT_Face_GetKerningFunc)( FT_Face face,
FT_UInt left_glyph, FT_UInt left_glyph,
FT_UInt right_glyph, FT_UInt right_glyph,
FT_Vector* kerning ); FT_Vector* kerning );
typedef FT_Error typedef FT_Error
(*FT_Face_AttachFunc)( FT_Face face, (*FT_Face_AttachFunc)( FT_Face face,
FT_Stream stream ); FT_Stream stream );
typedef FT_Error typedef FT_Error
(*FT_Face_GetAdvancesFunc)( FT_Face face, (*FT_Face_GetAdvancesFunc)( FT_Face face,
FT_UInt first, FT_UInt first,
FT_UInt count, FT_UInt count,
FT_Int32 flags, FT_Int32 flags,
FT_Fixed* advances ); FT_Fixed* advances );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_Driver_ClassRec */ /* FT_Driver_ClassRec */
/* */ /* */
/* <Description> */ /* <Description> */
/* The font driver class. This structure mostly contains pointers to */ /* The font driver class. This structure mostly contains pointers to */
/* driver methods. */ /* driver methods. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* root :: The parent module. */ /* root :: The parent module. */
/* */ /* */
/* face_object_size :: The size of a face object in bytes. */ /* face_object_size :: The size of a face object in bytes. */
/* */ /* */
/* size_object_size :: The size of a size object in bytes. */ /* size_object_size :: The size of a size object in bytes. */
/* */ /* */
/* slot_object_size :: The size of a glyph object in bytes. */ /* slot_object_size :: The size of a glyph object in bytes. */
/* */ /* */
/* init_face :: The format-specific face constructor. */ /* init_face :: The format-specific face constructor. */
/* */ /* */
/* done_face :: The format-specific face destructor. */ /* done_face :: The format-specific face destructor. */
/* */ /* */
/* init_size :: The format-specific size constructor. */ /* init_size :: The format-specific size constructor. */
/* */ /* */
/* done_size :: The format-specific size destructor. */ /* done_size :: The format-specific size destructor. */
/* */ /* */
/* init_slot :: The format-specific slot constructor. */ /* init_slot :: The format-specific slot constructor. */
/* */ /* */
/* done_slot :: The format-specific slot destructor. */ /* done_slot :: The format-specific slot destructor. */
/* */ /* */
/* */ /* */
/* load_glyph :: A function handle to load a glyph to a slot. */ /* load_glyph :: A function handle to load a glyph to a slot. */
/* This field is mandatory! */ /* This field is mandatory! */
/* */ /* */
/* get_kerning :: A function handle to return the unscaled */ /* get_kerning :: A function handle to return the unscaled */
/* kerning for a given pair of glyphs. Can be */ /* kerning for a given pair of glyphs. Can be */
/* set to 0 if the format doesn't support */ /* set to 0 if the format doesn't support */
/* kerning. */ /* kerning. */
/* */ /* */
/* attach_file :: This function handle is used to read */ /* attach_file :: This function handle is used to read */
/* additional data for a face from another */ /* additional data for a face from another */
/* file/stream. For example, this can be used to */ /* file/stream. For example, this can be used to */
/* add data from AFM or PFM files on a Type 1 */ /* add data from AFM or PFM files on a Type 1 */
/* face, or a CIDMap on a CID-keyed face. */ /* face, or a CIDMap on a CID-keyed face. */
/* */ /* */
/* get_advances :: A function handle used to return advance */ /* get_advances :: A function handle used to return advance */
/* widths of `count' glyphs (in font units), */ /* widths of `count' glyphs (in font units), */
/* starting at `first'. The `vertical' flag must */ /* starting at `first'. The `vertical' flag must */
/* be set to get vertical advance heights. The */ /* be set to get vertical advance heights. The */
/* `advances' buffer is caller-allocated. */ /* `advances' buffer is caller-allocated. */
/* Currently not implemented. The idea of this */ /* Currently not implemented. The idea of this */
/* function is to be able to perform */ /* function is to be able to perform */
/* device-independent text layout without loading */ /* device-independent text layout without loading */
/* a single glyph image. */ /* a single glyph image. */
/* */ /* */
/* request_size :: A handle to a function used to request the new */ /* request_size :: A handle to a function used to request the new */
/* character size. Can be set to 0 if the */ /* character size. Can be set to 0 if the */
/* scaling done in the base layer suffices. */ /* scaling done in the base layer suffices. */
/* */ /* */
/* select_size :: A handle to a function used to select a new */ /* select_size :: A handle to a function used to select a new */
/* fixed size. It is used only if */ /* fixed size. It is used only if */
/* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */ /* @FT_FACE_FLAG_FIXED_SIZES is set. Can be set */
/* to 0 if the scaling done in the base layer */ /* to 0 if the scaling done in the base layer */
/* suffices. */ /* suffices. */
/* <Note> */ /* <Note> */
/* Most function pointers, with the exception of `load_glyph', can be */ /* Most function pointers, with the exception of `load_glyph', can be */
/* set to 0 to indicate a default behaviour. */ /* set to 0 to indicate a default behaviour. */
/* */ /* */
typedef struct FT_Driver_ClassRec_ typedef struct FT_Driver_ClassRec_
{ {
FT_Module_Class root; FT_Module_Class root;
FT_Long face_object_size; FT_Long face_object_size;
FT_Long size_object_size; FT_Long size_object_size;
FT_Long slot_object_size; FT_Long slot_object_size;
FT_Face_InitFunc init_face; FT_Face_InitFunc init_face;
FT_Face_DoneFunc done_face; FT_Face_DoneFunc done_face;
FT_Size_InitFunc init_size; FT_Size_InitFunc init_size;
FT_Size_DoneFunc done_size; FT_Size_DoneFunc done_size;
FT_Slot_InitFunc init_slot; FT_Slot_InitFunc init_slot;
FT_Slot_DoneFunc done_slot; FT_Slot_DoneFunc done_slot;
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_Size_ResetPointsFunc set_char_sizes; FT_Size_ResetPointsFunc set_char_sizes;
FT_Size_ResetPixelsFunc set_pixel_sizes; FT_Size_ResetPixelsFunc set_pixel_sizes;
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
FT_Slot_LoadFunc load_glyph; FT_Slot_LoadFunc load_glyph;
FT_Face_GetKerningFunc get_kerning; FT_Face_GetKerningFunc get_kerning;
FT_Face_AttachFunc attach_file; FT_Face_AttachFunc attach_file;
FT_Face_GetAdvancesFunc get_advances; FT_Face_GetAdvancesFunc get_advances;
/* since version 2.2 */ /* since version 2.2 */
FT_Size_RequestFunc request_size; FT_Size_RequestFunc request_size;
FT_Size_SelectFunc select_size; FT_Size_SelectFunc select_size;
} FT_Driver_ClassRec, *FT_Driver_Class; } FT_Driver_ClassRec, *FT_Driver_Class;
/* /*
* The following functions are used as stubs for `set_char_sizes' and * The following functions are used as stubs for `set_char_sizes' and
* `set_pixel_sizes'; the code uses `request_size' and `select_size' * `set_pixel_sizes'; the code uses `request_size' and `select_size'
* functions instead. * functions instead.
* *
* Implementation is in `src/base/ftobjs.c'. * Implementation is in `src/base/ftobjs.c'.
*/ */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_BASE( FT_Error ) FT_BASE( FT_Error )
ft_stub_set_char_sizes( FT_Size size, ft_stub_set_char_sizes( FT_Size size,
FT_F26Dot6 width, FT_F26Dot6 width,
FT_F26Dot6 height, FT_F26Dot6 height,
FT_UInt horz_res, FT_UInt horz_res,
FT_UInt vert_res ); FT_UInt vert_res );
FT_BASE( FT_Error ) FT_BASE( FT_Error )
ft_stub_set_pixel_sizes( FT_Size size, ft_stub_set_pixel_sizes( FT_Size size,
FT_UInt width, FT_UInt width,
FT_UInt height ); FT_UInt height );
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Macro> */ /* <Macro> */
/* FT_DECLARE_DRIVER */ /* FT_DECLARE_DRIVER */
/* */ /* */
/* <Description> */ /* <Description> */
/* Used to create a forward declaration of a */ /* Used to create a forward declaration of a */
/* FT_Driver_ClassRec stract instance. */ /* FT_Driver_ClassRec stract instance. */
/* */ /* */
/* <Macro> */ /* <Macro> */
/* FT_DEFINE_DRIVER */ /* FT_DEFINE_DRIVER */
/* */ /* */
/* <Description> */ /* <Description> */
/* Used to initialize an instance of FT_Driver_ClassRec struct. */ /* Used to initialize an instance of FT_Driver_ClassRec struct. */
/* */ /* */
/* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */ /* When FT_CONFIG_OPTION_PIC is defined a Create funtion will need */
/* to called with a pointer where the allocated stracture is returned.*/ /* to called with a pointer where the allocated stracture is returned.*/
/* And when it is no longer needed a Destroy function needs */ /* And when it is no longer needed a Destroy function needs */
/* to be called to release that allocation. */ /* to be called to release that allocation. */
/* fcinit.c (ft_create_default_module_classes) already contains */ /* fcinit.c (ft_create_default_module_classes) already contains */
/* a mechanism to call these functions for the default modules */ /* a mechanism to call these functions for the default modules */
/* described in ftmodule.h */ /* described in ftmodule.h */
/* */ /* */
/* Notice that the created Create and Destroy functions call */ /* Notice that the created Create and Destroy functions call */
/* pic_init and pic_free function to allow you to manually allocate */ /* pic_init and pic_free function to allow you to manually allocate */
/* and initialize any additional global data, like module specific */ /* and initialize any additional global data, like module specific */
/* interface, and put them in the global pic container defined in */ /* interface, and put them in the global pic container defined in */
/* ftpic.h. if you don't need them just implement the functions as */ /* ftpic.h. if you don't need them just implement the functions as */
/* empty to resolve the link error. */ /* empty to resolve the link error. */
/* */ /* */
/* When FT_CONFIG_OPTION_PIC is not defined the struct will be */ /* When FT_CONFIG_OPTION_PIC is not defined the struct will be */
/* allocated in the global scope (or the scope where the macro */ /* allocated in the global scope (or the scope where the macro */
/* is used). */ /* is used). */
/* */ /* */
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \ #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \
a_, b_, a_, b_,
#else #else
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_)
#endif #endif
#define FT_DECLARE_DRIVER(class_) \ #define FT_DECLARE_DRIVER(class_) \
FT_CALLBACK_TABLE \ FT_CALLBACK_TABLE \
const FT_Driver_ClassRec class_; const FT_Driver_ClassRec class_;
#define FT_DEFINE_DRIVER(class_, \ #define FT_DEFINE_DRIVER(class_, \
flags_, size_, name_, version_, requires_, \ flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_, \ interface_, init_, done_, get_interface_, \
face_object_size_, size_object_size_, \ face_object_size_, size_object_size_, \
slot_object_size_, init_face_, done_face_, \ slot_object_size_, init_face_, done_face_, \
init_size_, done_size_, init_slot_, done_slot_, \ init_size_, done_size_, init_slot_, done_slot_, \
old_set_char_sizes_, old_set_pixel_sizes_, \ old_set_char_sizes_, old_set_pixel_sizes_, \
load_glyph_, get_kerning_, attach_file_, \ load_glyph_, get_kerning_, attach_file_, \
get_advances_, request_size_, select_size_ ) \ get_advances_, request_size_, select_size_ ) \
FT_CALLBACK_TABLE_DEF \ FT_CALLBACK_TABLE_DEF \
const FT_Driver_ClassRec class_ = \ const FT_Driver_ClassRec class_ = \
{ \ { \
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \ FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \
init_,done_,get_interface_) \ init_,done_,get_interface_) \
\ \
face_object_size_, \ face_object_size_, \
size_object_size_, \ size_object_size_, \
slot_object_size_, \ slot_object_size_, \
\ \
init_face_, \ init_face_, \
done_face_, \ done_face_, \
\ \
init_size_, \ init_size_, \
done_size_, \ done_size_, \
\ \
init_slot_, \ init_slot_, \
done_slot_, \ done_slot_, \
\ \
FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \ FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \
\ \
load_glyph_, \ load_glyph_, \
\ \
get_kerning_, \ get_kerning_, \
attach_file_, \ attach_file_, \
get_advances_, \ get_advances_, \
\ \
request_size_, \ request_size_, \
select_size_ \ select_size_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \ #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) \
clazz->set_char_sizes = a_; \ clazz->set_char_sizes = a_; \
clazz->set_pixel_sizes = b_; clazz->set_pixel_sizes = b_;
#else #else
#define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_) #define FT_DEFINE_DRIVERS_OLD_INTERNALS(a_,b_)
#endif #endif
#define FT_DECLARE_DRIVER(class_) FT_DECLARE_MODULE(class_) #define FT_DECLARE_DRIVER(class_) FT_DECLARE_MODULE(class_)
#define FT_DEFINE_DRIVER(class_, \ #define FT_DEFINE_DRIVER(class_, \
flags_, size_, name_, version_, requires_, \ flags_, size_, name_, version_, requires_, \
interface_, init_, done_, get_interface_, \ interface_, init_, done_, get_interface_, \
face_object_size_, size_object_size_, \ face_object_size_, size_object_size_, \
slot_object_size_, init_face_, done_face_, \ slot_object_size_, init_face_, done_face_, \
init_size_, done_size_, init_slot_, done_slot_, \ init_size_, done_size_, init_slot_, done_slot_, \
old_set_char_sizes_, old_set_pixel_sizes_, \ old_set_char_sizes_, old_set_pixel_sizes_, \
load_glyph_, get_kerning_, attach_file_, \ load_glyph_, get_kerning_, attach_file_, \
get_advances_, request_size_, select_size_ ) \ get_advances_, request_size_, select_size_ ) \
void class_##_pic_free( FT_Library library ); \ void class_##_pic_free( FT_Library library ); \
FT_Error class_##_pic_init( FT_Library library ); \ FT_Error class_##_pic_init( FT_Library library ); \
\ \
void \ void \
FT_Destroy_Class_##class_( FT_Library library, \ FT_Destroy_Class_##class_( FT_Library library, \
FT_Module_Class* clazz ) \ FT_Module_Class* clazz ) \
{ \ { \
FT_Memory memory = library->memory; \ FT_Memory memory = library->memory; \
FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \ FT_Driver_Class dclazz = (FT_Driver_Class)clazz; \
class_##_pic_free( library ); \ class_##_pic_free( library ); \
if ( dclazz ) \ if ( dclazz ) \
FT_FREE( dclazz ); \ FT_FREE( dclazz ); \
} \ } \
\ \
FT_Error \ FT_Error \
FT_Create_Class_##class_( FT_Library library, \ FT_Create_Class_##class_( FT_Library library, \
FT_Module_Class** output_class ) \ FT_Module_Class** output_class ) \
{ \ { \
FT_Driver_Class clazz; \ FT_Driver_Class clazz; \
FT_Error error; \ FT_Error error; \
FT_Memory memory = library->memory; \ FT_Memory memory = library->memory; \
\ \
if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \ if ( FT_ALLOC( clazz, sizeof(*clazz) ) ) \
return error; \ return error; \
\ \
error = class_##_pic_init( library ); \ error = class_##_pic_init( library ); \
if(error) \ if(error) \
{ \ { \
FT_FREE( clazz ); \ FT_FREE( clazz ); \
return error; \ return error; \
} \ } \
\ \
FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \ FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,interface_, \
init_,done_,get_interface_) \ init_,done_,get_interface_) \
\ \
clazz->face_object_size = face_object_size_; \ clazz->face_object_size = face_object_size_; \
clazz->size_object_size = size_object_size_; \ clazz->size_object_size = size_object_size_; \
clazz->slot_object_size = slot_object_size_; \ clazz->slot_object_size = slot_object_size_; \
\ \
clazz->init_face = init_face_; \ clazz->init_face = init_face_; \
clazz->done_face = done_face_; \ clazz->done_face = done_face_; \
\ \
clazz->init_size = init_size_; \ clazz->init_size = init_size_; \
clazz->done_size = done_size_; \ clazz->done_size = done_size_; \
\ \
clazz->init_slot = init_slot_; \ clazz->init_slot = init_slot_; \
clazz->done_slot = done_slot_; \ clazz->done_slot = done_slot_; \
\ \
FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \ FT_DEFINE_DRIVERS_OLD_INTERNALS(old_set_char_sizes_, old_set_pixel_sizes_) \
\ \
clazz->load_glyph = load_glyph_; \ clazz->load_glyph = load_glyph_; \
\ \
clazz->get_kerning = get_kerning_; \ clazz->get_kerning = get_kerning_; \
clazz->attach_file = attach_file_; \ clazz->attach_file = attach_file_; \
clazz->get_advances = get_advances_; \ clazz->get_advances = get_advances_; \
\ \
clazz->request_size = request_size_; \ clazz->request_size = request_size_; \
clazz->select_size = select_size_; \ clazz->select_size = select_size_; \
\ \
*output_class = (FT_Module_Class*)clazz; \ *output_class = (FT_Module_Class*)clazz; \
return FT_Err_Ok; \ return FT_Err_Ok; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
FT_END_HEADER FT_END_HEADER
#endif /* __FTDRIVER_H__ */ #endif /* __FTDRIVER_H__ */
/* END */ /* END */

View file

@ -1,168 +1,168 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftgloadr.h */ /* ftgloadr.h */
/* */ /* */
/* The FreeType glyph loader (specification). */ /* The FreeType glyph loader (specification). */
/* */ /* */
/* Copyright 2002, 2003, 2005, 2006 by */ /* Copyright 2002, 2003, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */ /* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTGLOADR_H__ #ifndef __FTGLOADR_H__
#define __FTGLOADR_H__ #define __FTGLOADR_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* FT_GlyphLoader */ /* FT_GlyphLoader */
/* */ /* */
/* <Description> */ /* <Description> */
/* The glyph loader is an internal object used to load several glyphs */ /* The glyph loader is an internal object used to load several glyphs */
/* together (for example, in the case of composites). */ /* together (for example, in the case of composites). */
/* */ /* */
/* <Note> */ /* <Note> */
/* The glyph loader implementation is not part of the high-level API, */ /* The glyph loader implementation is not part of the high-level API, */
/* hence the forward structure declaration. */ /* hence the forward structure declaration. */
/* */ /* */
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ; typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
#if 0 /* moved to freetype.h in version 2.2 */ #if 0 /* moved to freetype.h in version 2.2 */
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
#define FT_SUBGLYPH_FLAG_SCALE 8 #define FT_SUBGLYPH_FLAG_SCALE 8
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
#define FT_SUBGLYPH_FLAG_2X2 0x80 #define FT_SUBGLYPH_FLAG_2X2 0x80
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
#endif #endif
typedef struct FT_SubGlyphRec_ typedef struct FT_SubGlyphRec_
{ {
FT_Int index; FT_Int index;
FT_UShort flags; FT_UShort flags;
FT_Int arg1; FT_Int arg1;
FT_Int arg2; FT_Int arg2;
FT_Matrix transform; FT_Matrix transform;
} FT_SubGlyphRec; } FT_SubGlyphRec;
typedef struct FT_GlyphLoadRec_ typedef struct FT_GlyphLoadRec_
{ {
FT_Outline outline; /* outline */ FT_Outline outline; /* outline */
FT_Vector* extra_points; /* extra points table */ FT_Vector* extra_points; /* extra points table */
FT_Vector* extra_points2; /* second extra points table */ FT_Vector* extra_points2; /* second extra points table */
FT_UInt num_subglyphs; /* number of subglyphs */ FT_UInt num_subglyphs; /* number of subglyphs */
FT_SubGlyph subglyphs; /* subglyphs */ FT_SubGlyph subglyphs; /* subglyphs */
} FT_GlyphLoadRec, *FT_GlyphLoad; } FT_GlyphLoadRec, *FT_GlyphLoad;
typedef struct FT_GlyphLoaderRec_ typedef struct FT_GlyphLoaderRec_
{ {
FT_Memory memory; FT_Memory memory;
FT_UInt max_points; FT_UInt max_points;
FT_UInt max_contours; FT_UInt max_contours;
FT_UInt max_subglyphs; FT_UInt max_subglyphs;
FT_Bool use_extra; FT_Bool use_extra;
FT_GlyphLoadRec base; FT_GlyphLoadRec base;
FT_GlyphLoadRec current; FT_GlyphLoadRec current;
void* other; /* for possible future extension? */ void* other; /* for possible future extension? */
} FT_GlyphLoaderRec; } FT_GlyphLoaderRec;
/* create new empty glyph loader */ /* create new empty glyph loader */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_GlyphLoader_New( FT_Memory memory, FT_GlyphLoader_New( FT_Memory memory,
FT_GlyphLoader *aloader ); FT_GlyphLoader *aloader );
/* add an extra points table to a glyph loader */ /* add an extra points table to a glyph loader */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader ); FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader );
/* destroy a glyph loader */ /* destroy a glyph loader */
FT_BASE( void ) FT_BASE( void )
FT_GlyphLoader_Done( FT_GlyphLoader loader ); FT_GlyphLoader_Done( FT_GlyphLoader loader );
/* reset a glyph loader (frees everything int it) */ /* reset a glyph loader (frees everything int it) */
FT_BASE( void ) FT_BASE( void )
FT_GlyphLoader_Reset( FT_GlyphLoader loader ); FT_GlyphLoader_Reset( FT_GlyphLoader loader );
/* rewind a glyph loader */ /* rewind a glyph loader */
FT_BASE( void ) FT_BASE( void )
FT_GlyphLoader_Rewind( FT_GlyphLoader loader ); FT_GlyphLoader_Rewind( FT_GlyphLoader loader );
/* check that there is enough space to add `n_points' and `n_contours' */ /* check that there is enough space to add `n_points' and `n_contours' */
/* to the glyph loader */ /* to the glyph loader */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader, FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
FT_UInt n_points, FT_UInt n_points,
FT_UInt n_contours ); FT_UInt n_contours );
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \ #define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
( (_count) == 0 || ((_loader)->base.outline.n_points + \ ( (_count) == 0 || ((_loader)->base.outline.n_points + \
(_loader)->current.outline.n_points + \ (_loader)->current.outline.n_points + \
(unsigned long)(_count)) <= (_loader)->max_points ) (unsigned long)(_count)) <= (_loader)->max_points )
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \ #define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
( (_count) == 0 || ((_loader)->base.outline.n_contours + \ ( (_count) == 0 || ((_loader)->base.outline.n_contours + \
(_loader)->current.outline.n_contours + \ (_loader)->current.outline.n_contours + \
(unsigned long)(_count)) <= (_loader)->max_contours ) (unsigned long)(_count)) <= (_loader)->max_contours )
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \ #define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \ ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \ FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
? 0 \ ? 0 \
: FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) ) : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
/* check that there is enough space to add `n_subs' sub-glyphs to */ /* check that there is enough space to add `n_subs' sub-glyphs to */
/* a glyph loader */ /* a glyph loader */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader, FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
FT_UInt n_subs ); FT_UInt n_subs );
/* prepare a glyph loader, i.e. empty the current glyph */ /* prepare a glyph loader, i.e. empty the current glyph */
FT_BASE( void ) FT_BASE( void )
FT_GlyphLoader_Prepare( FT_GlyphLoader loader ); FT_GlyphLoader_Prepare( FT_GlyphLoader loader );
/* add the current glyph to the base glyph */ /* add the current glyph to the base glyph */
FT_BASE( void ) FT_BASE( void )
FT_GlyphLoader_Add( FT_GlyphLoader loader ); FT_GlyphLoader_Add( FT_GlyphLoader loader );
/* copy points from one glyph loader to another */ /* copy points from one glyph loader to another */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_GlyphLoader_CopyPoints( FT_GlyphLoader target, FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
FT_GlyphLoader source ); FT_GlyphLoader source );
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTGLOADR_H__ */ #endif /* __FTGLOADR_H__ */
/* END */ /* END */

View file

@ -1,380 +1,380 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftmemory.h */ /* ftmemory.h */
/* */ /* */
/* The FreeType memory management macros (specification). */ /* The FreeType memory management macros (specification). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */ /* Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */ /* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTMEMORY_H__ #ifndef __FTMEMORY_H__
#define __FTMEMORY_H__ #define __FTMEMORY_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_CONFIG_CONFIG_H #include FT_CONFIG_CONFIG_H
#include FT_TYPES_H #include FT_TYPES_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Macro> */ /* <Macro> */
/* FT_SET_ERROR */ /* FT_SET_ERROR */
/* */ /* */
/* <Description> */ /* <Description> */
/* This macro is used to set an implicit `error' variable to a given */ /* This macro is used to set an implicit `error' variable to a given */
/* expression's value (usually a function call), and convert it to a */ /* expression's value (usually a function call), and convert it to a */
/* boolean which is set whenever the value is != 0. */ /* boolean which is set whenever the value is != 0. */
/* */ /* */
#undef FT_SET_ERROR #undef FT_SET_ERROR
#define FT_SET_ERROR( expression ) \ #define FT_SET_ERROR( expression ) \
( ( error = (expression) ) != 0 ) ( ( error = (expression) ) != 0 )
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/**** ****/ /**** ****/
/**** ****/ /**** ****/
/**** M E M O R Y ****/ /**** M E M O R Y ****/
/**** ****/ /**** ****/
/**** ****/ /**** ****/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* /*
* C++ refuses to handle statements like p = (void*)anything, with `p' a * C++ refuses to handle statements like p = (void*)anything, with `p' a
* typed pointer. Since we don't have a `typeof' operator in standard * typed pointer. Since we don't have a `typeof' operator in standard
* C++, we have to use a template to emulate it. * C++, we have to use a template to emulate it.
*/ */
#ifdef __cplusplus #ifdef __cplusplus
extern "C++" extern "C++"
template <typename T> inline T* template <typename T> inline T*
cplusplus_typeof( T*, cplusplus_typeof( T*,
void *v ) void *v )
{ {
return static_cast <T*> ( v ); return static_cast <T*> ( v );
} }
#define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) ) #define FT_ASSIGNP( p, val ) (p) = cplusplus_typeof( (p), (val) )
#else #else
#define FT_ASSIGNP( p, val ) (p) = (val) #define FT_ASSIGNP( p, val ) (p) = (val)
#endif #endif
#ifdef FT_DEBUG_MEMORY #ifdef FT_DEBUG_MEMORY
FT_BASE( const char* ) _ft_debug_file; FT_BASE( const char* ) _ft_debug_file;
FT_BASE( long ) _ft_debug_lineno; FT_BASE( long ) _ft_debug_lineno;
#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \ #define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
_ft_debug_lineno = __LINE__, \ _ft_debug_lineno = __LINE__, \
(exp) ) (exp) )
#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \ #define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
_ft_debug_lineno = __LINE__, \ _ft_debug_lineno = __LINE__, \
FT_ASSIGNP( p, exp ) ) FT_ASSIGNP( p, exp ) )
#else /* !FT_DEBUG_MEMORY */ #else /* !FT_DEBUG_MEMORY */
#define FT_DEBUG_INNER( exp ) (exp) #define FT_DEBUG_INNER( exp ) (exp)
#define FT_ASSIGNP_INNER( p, exp ) FT_ASSIGNP( p, exp ) #define FT_ASSIGNP_INNER( p, exp ) FT_ASSIGNP( p, exp )
#endif /* !FT_DEBUG_MEMORY */ #endif /* !FT_DEBUG_MEMORY */
/* /*
* The allocation functions return a pointer, and the error code * The allocation functions return a pointer, and the error code
* is written to through the `p_error' parameter. See below for * is written to through the `p_error' parameter. See below for
* for documentation. * for documentation.
*/ */
FT_BASE( FT_Pointer ) FT_BASE( FT_Pointer )
ft_mem_alloc( FT_Memory memory, ft_mem_alloc( FT_Memory memory,
FT_Long size, FT_Long size,
FT_Error *p_error ); FT_Error *p_error );
FT_BASE( FT_Pointer ) FT_BASE( FT_Pointer )
ft_mem_qalloc( FT_Memory memory, ft_mem_qalloc( FT_Memory memory,
FT_Long size, FT_Long size,
FT_Error *p_error ); FT_Error *p_error );
FT_BASE( FT_Pointer ) FT_BASE( FT_Pointer )
ft_mem_realloc( FT_Memory memory, ft_mem_realloc( FT_Memory memory,
FT_Long item_size, FT_Long item_size,
FT_Long cur_count, FT_Long cur_count,
FT_Long new_count, FT_Long new_count,
void* block, void* block,
FT_Error *p_error ); FT_Error *p_error );
FT_BASE( FT_Pointer ) FT_BASE( FT_Pointer )
ft_mem_qrealloc( FT_Memory memory, ft_mem_qrealloc( FT_Memory memory,
FT_Long item_size, FT_Long item_size,
FT_Long cur_count, FT_Long cur_count,
FT_Long new_count, FT_Long new_count,
void* block, void* block,
FT_Error *p_error ); FT_Error *p_error );
FT_BASE( void ) FT_BASE( void )
ft_mem_free( FT_Memory memory, ft_mem_free( FT_Memory memory,
const void* P ); const void* P );
#define FT_MEM_ALLOC( ptr, size ) \ #define FT_MEM_ALLOC( ptr, size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) ) FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )
#define FT_MEM_FREE( ptr ) \ #define FT_MEM_FREE( ptr ) \
FT_BEGIN_STMNT \ FT_BEGIN_STMNT \
ft_mem_free( memory, (ptr) ); \ ft_mem_free( memory, (ptr) ); \
(ptr) = NULL; \ (ptr) = NULL; \
FT_END_STMNT FT_END_STMNT
#define FT_MEM_NEW( ptr ) \ #define FT_MEM_NEW( ptr ) \
FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) ) FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )
#define FT_MEM_REALLOC( ptr, cursz, newsz ) \ #define FT_MEM_REALLOC( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1, \ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1, \
(cursz), (newsz), \ (cursz), (newsz), \
(ptr), &error ) ) (ptr), &error ) )
#define FT_MEM_QALLOC( ptr, size ) \ #define FT_MEM_QALLOC( ptr, size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) ) FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) )
#define FT_MEM_QNEW( ptr ) \ #define FT_MEM_QNEW( ptr ) \
FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) ) FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )
#define FT_MEM_QREALLOC( ptr, cursz, newsz ) \ #define FT_MEM_QREALLOC( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1, \ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1, \
(cursz), (newsz), \ (cursz), (newsz), \
(ptr), &error ) ) (ptr), &error ) )
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \ #define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
(cursz), (newsz), \ (cursz), (newsz), \
(ptr), &error ) ) (ptr), &error ) )
#define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \ #define FT_MEM_ALLOC_MULT( ptr, count, item_size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \
0, (count), \ 0, (count), \
NULL, &error ) ) NULL, &error ) )
#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \ #define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz), \ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz), \
(oldcnt), (newcnt), \ (oldcnt), (newcnt), \
(ptr), &error ) ) (ptr), &error ) )
#define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \ #define FT_MEM_QALLOC_MULT( ptr, count, item_size ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \
0, (count), \ 0, (count), \
NULL, &error ) ) NULL, &error ) )
#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \ #define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz), \ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz), \
(oldcnt), (newcnt), \ (oldcnt), (newcnt), \
(ptr), &error ) ) (ptr), &error ) )
#define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 ) #define FT_MEM_SET_ERROR( cond ) ( (cond), error != 0 )
#define FT_MEM_SET( dest, byte, count ) ft_memset( dest, byte, count ) #define FT_MEM_SET( dest, byte, count ) ft_memset( dest, byte, count )
#define FT_MEM_COPY( dest, source, count ) ft_memcpy( dest, source, count ) #define FT_MEM_COPY( dest, source, count ) ft_memcpy( dest, source, count )
#define FT_MEM_MOVE( dest, source, count ) ft_memmove( dest, source, count ) #define FT_MEM_MOVE( dest, source, count ) ft_memmove( dest, source, count )
#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count ) #define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
#define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) ) #define FT_ZERO( p ) FT_MEM_ZERO( p, sizeof ( *(p) ) )
#define FT_ARRAY_ZERO( dest, count ) \ #define FT_ARRAY_ZERO( dest, count ) \
FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) ) FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )
#define FT_ARRAY_COPY( dest, source, count ) \ #define FT_ARRAY_COPY( dest, source, count ) \
FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) ) FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )
#define FT_ARRAY_MOVE( dest, source, count ) \ #define FT_ARRAY_MOVE( dest, source, count ) \
FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) ) FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )
/* /*
* Return the maximum number of addressable elements in an array. * Return the maximum number of addressable elements in an array.
* We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid * We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid
* any problems. * any problems.
*/ */
#define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) ) #define FT_ARRAY_MAX( ptr ) ( FT_INT_MAX / sizeof ( *(ptr) ) )
#define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) ) #define FT_ARRAY_CHECK( ptr, count ) ( (count) <= FT_ARRAY_MAX( ptr ) )
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* The following functions macros expect that their pointer argument is */ /* The following functions macros expect that their pointer argument is */
/* _typed_ in order to automatically compute array element sizes. */ /* _typed_ in order to automatically compute array element sizes. */
/* */ /* */
#define FT_MEM_NEW_ARRAY( ptr, count ) \ #define FT_MEM_NEW_ARRAY( ptr, count ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
0, (count), \ 0, (count), \
NULL, &error ) ) NULL, &error ) )
#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \ #define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \ FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \
(cursz), (newsz), \ (cursz), (newsz), \
(ptr), &error ) ) (ptr), &error ) )
#define FT_MEM_QNEW_ARRAY( ptr, count ) \ #define FT_MEM_QNEW_ARRAY( ptr, count ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
0, (count), \ 0, (count), \
NULL, &error ) ) NULL, &error ) )
#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \ #define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz ) \
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \ FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \
(cursz), (newsz), \ (cursz), (newsz), \
(ptr), &error ) ) (ptr), &error ) )
#define FT_ALLOC( ptr, size ) \ #define FT_ALLOC( ptr, size ) \
FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) ) FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )
#define FT_REALLOC( ptr, cursz, newsz ) \ #define FT_REALLOC( ptr, cursz, newsz ) \
FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) ) FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )
#define FT_ALLOC_MULT( ptr, count, item_size ) \ #define FT_ALLOC_MULT( ptr, count, item_size ) \
FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) ) FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )
#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \ #define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \ FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \
newcnt, itmsz ) ) newcnt, itmsz ) )
#define FT_QALLOC( ptr, size ) \ #define FT_QALLOC( ptr, size ) \
FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) ) FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )
#define FT_QREALLOC( ptr, cursz, newsz ) \ #define FT_QREALLOC( ptr, cursz, newsz ) \
FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) ) FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )
#define FT_QALLOC_MULT( ptr, count, item_size ) \ #define FT_QALLOC_MULT( ptr, count, item_size ) \
FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) ) FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )
#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \ #define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz ) \
FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \ FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \
newcnt, itmsz ) ) newcnt, itmsz ) )
#define FT_FREE( ptr ) FT_MEM_FREE( ptr ) #define FT_FREE( ptr ) FT_MEM_FREE( ptr )
#define FT_NEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) ) #define FT_NEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )
#define FT_NEW_ARRAY( ptr, count ) \ #define FT_NEW_ARRAY( ptr, count ) \
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) ) FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \ #define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) ) FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
#define FT_QNEW( ptr ) \ #define FT_QNEW( ptr ) \
FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) ) FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
#define FT_QNEW_ARRAY( ptr, count ) \ #define FT_QNEW_ARRAY( ptr, count ) \
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) ) FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \ #define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) ) FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS #ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_Alloc( FT_Memory memory, FT_Alloc( FT_Memory memory,
FT_Long size, FT_Long size,
void* *P ); void* *P );
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_QAlloc( FT_Memory memory, FT_QAlloc( FT_Memory memory,
FT_Long size, FT_Long size,
void* *p ); void* *p );
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_Realloc( FT_Memory memory, FT_Realloc( FT_Memory memory,
FT_Long current, FT_Long current,
FT_Long size, FT_Long size,
void* *P ); void* *P );
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_QRealloc( FT_Memory memory, FT_QRealloc( FT_Memory memory,
FT_Long current, FT_Long current,
FT_Long size, FT_Long size,
void* *p ); void* *p );
FT_BASE( void ) FT_BASE( void )
FT_Free( FT_Memory memory, FT_Free( FT_Memory memory,
void* *P ); void* *P );
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */ #endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
FT_BASE( FT_Pointer ) FT_BASE( FT_Pointer )
ft_mem_strdup( FT_Memory memory, ft_mem_strdup( FT_Memory memory,
const char* str, const char* str,
FT_Error *p_error ); FT_Error *p_error );
FT_BASE( FT_Pointer ) FT_BASE( FT_Pointer )
ft_mem_dup( FT_Memory memory, ft_mem_dup( FT_Memory memory,
const void* address, const void* address,
FT_ULong size, FT_ULong size,
FT_Error *p_error ); FT_Error *p_error );
#define FT_MEM_STRDUP( dst, str ) \ #define FT_MEM_STRDUP( dst, str ) \
(dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error ) (dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )
#define FT_STRDUP( dst, str ) \ #define FT_STRDUP( dst, str ) \
FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) ) FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
#define FT_MEM_DUP( dst, address, size ) \ #define FT_MEM_DUP( dst, address, size ) \
(dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error ) (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
#define FT_DUP( dst, address, size ) \ #define FT_DUP( dst, address, size ) \
FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) ) FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
/* Return >= 1 if a truncation occurs. */ /* Return >= 1 if a truncation occurs. */
/* Return 0 if the source string fits the buffer. */ /* Return 0 if the source string fits the buffer. */
/* This is *not* the same as strlcpy(). */ /* This is *not* the same as strlcpy(). */
FT_BASE( FT_Int ) FT_BASE( FT_Int )
ft_mem_strcpyn( char* dst, ft_mem_strcpyn( char* dst,
const char* src, const char* src,
FT_ULong size ); FT_ULong size );
#define FT_STRCPYN( dst, src, size ) \ #define FT_STRCPYN( dst, src, size ) \
ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) ) ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTMEMORY_H__ */ #endif /* __FTMEMORY_H__ */
/* END */ /* END */

File diff suppressed because it is too large Load diff

View file

@ -1,67 +1,67 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftpic.h */ /* ftpic.h */
/* */ /* */
/* The FreeType position independent code services (declaration). */ /* The FreeType position independent code services (declaration). */
/* */ /* */
/* Copyright 2009 by */ /* Copyright 2009 by */
/* Oran Agra and Mickey Gabel. */ /* Oran Agra and Mickey Gabel. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* Modules that ordinarily have const global data that need address */ /* Modules that ordinarily have const global data that need address */
/* can instead define pointers here. */ /* can instead define pointers here. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FTPIC_H__ #ifndef __FTPIC_H__
#define __FTPIC_H__ #define __FTPIC_H__
FT_BEGIN_HEADER FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_PIC #ifdef FT_CONFIG_OPTION_PIC
typedef struct FT_PIC_Container_ typedef struct FT_PIC_Container_
{ {
/* pic containers for base */ /* pic containers for base */
void* base; void* base;
/* pic containers for modules */ /* pic containers for modules */
void* autofit; void* autofit;
void* cff; void* cff;
void* pshinter; void* pshinter;
void* psnames; void* psnames;
void* raster; void* raster;
void* sfnt; void* sfnt;
void* smooth; void* smooth;
void* truetype; void* truetype;
} FT_PIC_Container; } FT_PIC_Container;
/* Initialize the various function tables, structs, etc. stored in the container. */ /* Initialize the various function tables, structs, etc. stored in the container. */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
ft_pic_container_init( FT_Library library ); ft_pic_container_init( FT_Library library );
/* Destroy the contents of the container. */ /* Destroy the contents of the container. */
FT_BASE( void ) FT_BASE( void )
ft_pic_container_destroy( FT_Library library ); ft_pic_container_destroy( FT_Library library );
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __FTPIC_H__ */ #endif /* __FTPIC_H__ */
/* END */ /* END */

View file

@ -1,196 +1,196 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftrfork.h */ /* ftrfork.h */
/* */ /* */
/* Embedded resource forks accessor (specification). */ /* Embedded resource forks accessor (specification). */
/* */ /* */
/* Copyright 2004, 2006, 2007 by */ /* Copyright 2004, 2006, 2007 by */
/* Masatake YAMATO and Redhat K.K. */ /* Masatake YAMATO and Redhat K.K. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* Development of the code in this file is support of */ /* Development of the code in this file is support of */
/* Information-technology Promotion Agency, Japan. */ /* Information-technology Promotion Agency, Japan. */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTRFORK_H__ #ifndef __FTRFORK_H__
#define __FTRFORK_H__ #define __FTRFORK_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_OBJECTS_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* Number of guessing rules supported in `FT_Raccess_Guess'. */ /* Number of guessing rules supported in `FT_Raccess_Guess'. */
/* Don't forget to increment the number if you add a new guessing rule. */ /* Don't forget to increment the number if you add a new guessing rule. */
#define FT_RACCESS_N_RULES 9 #define FT_RACCESS_N_RULES 9
/* A structure to describe a reference in a resource by its resource ID */ /* A structure to describe a reference in a resource by its resource ID */
/* and internal offset. The `POST' resource expects to be concatenated */ /* and internal offset. The `POST' resource expects to be concatenated */
/* by the order of resource IDs instead of its appearance in the file. */ /* by the order of resource IDs instead of its appearance in the file. */
typedef struct FT_RFork_Ref_ typedef struct FT_RFork_Ref_
{ {
FT_UShort res_id; FT_UShort res_id;
FT_ULong offset; FT_ULong offset;
} FT_RFork_Ref; } FT_RFork_Ref;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Raccess_Guess */ /* FT_Raccess_Guess */
/* */ /* */
/* <Description> */ /* <Description> */
/* Guess a file name and offset where the actual resource fork is */ /* Guess a file name and offset where the actual resource fork is */
/* stored. The macro FT_RACCESS_N_RULES holds the number of */ /* stored. The macro FT_RACCESS_N_RULES holds the number of */
/* guessing rules; the guessed result for the Nth rule is */ /* guessing rules; the guessed result for the Nth rule is */
/* represented as a triplet: a new file name (new_names[N]), a file */ /* represented as a triplet: a new file name (new_names[N]), a file */
/* offset (offsets[N]), and an error code (errors[N]). */ /* offset (offsets[N]), and an error code (errors[N]). */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: */ /* library :: */
/* A FreeType library instance. */ /* A FreeType library instance. */
/* */ /* */
/* stream :: */ /* stream :: */
/* A file stream containing the resource fork. */ /* A file stream containing the resource fork. */
/* */ /* */
/* base_name :: */ /* base_name :: */
/* The (base) file name of the resource fork used for some */ /* The (base) file name of the resource fork used for some */
/* guessing rules. */ /* guessing rules. */
/* */ /* */
/* <Output> */ /* <Output> */
/* new_names :: */ /* new_names :: */
/* An array of guessed file names in which the resource forks may */ /* An array of guessed file names in which the resource forks may */
/* exist. If `new_names[N]' is NULL, the guessed file name is */ /* exist. If `new_names[N]' is NULL, the guessed file name is */
/* equal to `base_name'. */ /* equal to `base_name'. */
/* */ /* */
/* offsets :: */ /* offsets :: */
/* An array of guessed file offsets. `offsets[N]' holds the file */ /* An array of guessed file offsets. `offsets[N]' holds the file */
/* offset of the possible start of the resource fork in file */ /* offset of the possible start of the resource fork in file */
/* `new_names[N]'. */ /* `new_names[N]'. */
/* */ /* */
/* errors :: */ /* errors :: */
/* An array of FreeType error codes. `errors[N]' is the error */ /* An array of FreeType error codes. `errors[N]' is the error */
/* code of Nth guessing rule function. If `errors[N]' is not */ /* code of Nth guessing rule function. If `errors[N]' is not */
/* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */ /* FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless. */
/* */ /* */
FT_BASE( void ) FT_BASE( void )
FT_Raccess_Guess( FT_Library library, FT_Raccess_Guess( FT_Library library,
FT_Stream stream, FT_Stream stream,
char* base_name, char* base_name,
char** new_names, char** new_names,
FT_Long* offsets, FT_Long* offsets,
FT_Error* errors ); FT_Error* errors );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Raccess_Get_HeaderInfo */ /* FT_Raccess_Get_HeaderInfo */
/* */ /* */
/* <Description> */ /* <Description> */
/* Get the information from the header of resource fork. The */ /* Get the information from the header of resource fork. The */
/* information includes the file offset where the resource map */ /* information includes the file offset where the resource map */
/* starts, and the file offset where the resource data starts. */ /* starts, and the file offset where the resource data starts. */
/* `FT_Raccess_Get_DataOffsets' requires these two data. */ /* `FT_Raccess_Get_DataOffsets' requires these two data. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: */ /* library :: */
/* A FreeType library instance. */ /* A FreeType library instance. */
/* */ /* */
/* stream :: */ /* stream :: */
/* A file stream containing the resource fork. */ /* A file stream containing the resource fork. */
/* */ /* */
/* rfork_offset :: */ /* rfork_offset :: */
/* The file offset where the resource fork starts. */ /* The file offset where the resource fork starts. */
/* */ /* */
/* <Output> */ /* <Output> */
/* map_offset :: */ /* map_offset :: */
/* The file offset where the resource map starts. */ /* The file offset where the resource map starts. */
/* */ /* */
/* rdata_pos :: */ /* rdata_pos :: */
/* The file offset where the resource data starts. */ /* The file offset where the resource data starts. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. FT_Err_Ok means success. */ /* FreeType error code. FT_Err_Ok means success. */
/* */ /* */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_Raccess_Get_HeaderInfo( FT_Library library, FT_Raccess_Get_HeaderInfo( FT_Library library,
FT_Stream stream, FT_Stream stream,
FT_Long rfork_offset, FT_Long rfork_offset,
FT_Long *map_offset, FT_Long *map_offset,
FT_Long *rdata_pos ); FT_Long *rdata_pos );
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Function> */ /* <Function> */
/* FT_Raccess_Get_DataOffsets */ /* FT_Raccess_Get_DataOffsets */
/* */ /* */
/* <Description> */ /* <Description> */
/* Get the data offsets for a tag in a resource fork. Offsets are */ /* Get the data offsets for a tag in a resource fork. Offsets are */
/* stored in an array because, in some cases, resources in a resource */ /* stored in an array because, in some cases, resources in a resource */
/* fork have the same tag. */ /* fork have the same tag. */
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: */ /* library :: */
/* A FreeType library instance. */ /* A FreeType library instance. */
/* */ /* */
/* stream :: */ /* stream :: */
/* A file stream containing the resource fork. */ /* A file stream containing the resource fork. */
/* */ /* */
/* map_offset :: */ /* map_offset :: */
/* The file offset where the resource map starts. */ /* The file offset where the resource map starts. */
/* */ /* */
/* rdata_pos :: */ /* rdata_pos :: */
/* The file offset where the resource data starts. */ /* The file offset where the resource data starts. */
/* */ /* */
/* tag :: */ /* tag :: */
/* The resource tag. */ /* The resource tag. */
/* */ /* */
/* <Output> */ /* <Output> */
/* offsets :: */ /* offsets :: */
/* The stream offsets for the resource data specified by `tag'. */ /* The stream offsets for the resource data specified by `tag'. */
/* This array is allocated by the function, so you have to call */ /* This array is allocated by the function, so you have to call */
/* @ft_mem_free after use. */ /* @ft_mem_free after use. */
/* */ /* */
/* count :: */ /* count :: */
/* The length of offsets array. */ /* The length of offsets array. */
/* */ /* */
/* <Return> */ /* <Return> */
/* FreeType error code. FT_Err_Ok means success. */ /* FreeType error code. FT_Err_Ok means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */ /* Normally you should use `FT_Raccess_Get_HeaderInfo' to get the */
/* value for `map_offset' and `rdata_pos'. */ /* value for `map_offset' and `rdata_pos'. */
/* */ /* */
FT_BASE( FT_Error ) FT_BASE( FT_Error )
FT_Raccess_Get_DataOffsets( FT_Library library, FT_Raccess_Get_DataOffsets( FT_Library library,
FT_Stream stream, FT_Stream stream,
FT_Long map_offset, FT_Long map_offset,
FT_Long rdata_pos, FT_Long rdata_pos,
FT_Long tag, FT_Long tag,
FT_Long **offsets, FT_Long **offsets,
FT_Long *count ); FT_Long *count );
FT_END_HEADER FT_END_HEADER
#endif /* __FTRFORK_H__ */ #endif /* __FTRFORK_H__ */
/* END */ /* END */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,139 +1,144 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* fttrace.h */ /* fttrace.h */
/* */ /* */
/* Tracing handling (specification only). */ /* Tracing handling (specification only). */
/* */ /* */
/* Copyright 2002, 2004, 2005, 2006, 2007 by */ /* Copyright 2002, 2004-2007, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/* definitions of trace levels for FreeType 2 */ /* definitions of trace levels for FreeType 2 */
/* the first level must always be `trace_any' */ /* the first level must always be `trace_any' */
FT_TRACE_DEF( any ) FT_TRACE_DEF( any )
/* base components */ /* base components */
FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */ FT_TRACE_DEF( calc ) /* calculations (ftcalc.c) */
FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */ FT_TRACE_DEF( memory ) /* memory manager (ftobjs.c) */
FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */ FT_TRACE_DEF( stream ) /* stream manager (ftstream.c) */
FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */ FT_TRACE_DEF( io ) /* i/o interface (ftsystem.c) */
FT_TRACE_DEF( list ) /* list management (ftlist.c) */ FT_TRACE_DEF( list ) /* list management (ftlist.c) */
FT_TRACE_DEF( init ) /* initialization (ftinit.c) */ FT_TRACE_DEF( init ) /* initialization (ftinit.c) */
FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */ FT_TRACE_DEF( objs ) /* base objects (ftobjs.c) */
FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */ FT_TRACE_DEF( outline ) /* outline management (ftoutln.c) */
FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */ FT_TRACE_DEF( glyph ) /* glyph management (ftglyph.c) */
FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */ FT_TRACE_DEF( gloader ) /* glyph loader (ftgloadr.c) */
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */ FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */ FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */ FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */ FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */ FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
/* Cache sub-system */ /* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */ FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
/* SFNT driver components */ /* SFNT driver components */
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */ FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */ FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */ FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */ FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */ FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */ FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */ FT_TRACE_DEF( ttpost ) /* PS table processing (ttpost.c) */
FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */ FT_TRACE_DEF( ttsbit ) /* TrueType sbit handling (ttsbit.c) */
FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */ FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
/* TrueType driver components */ /* TrueType driver components */
FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */ FT_TRACE_DEF( ttdriver ) /* TT font driver (ttdriver.c) */
FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */ FT_TRACE_DEF( ttgload ) /* TT glyph loader (ttgload.c) */
FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */ FT_TRACE_DEF( ttinterp ) /* bytecode interpreter (ttinterp.c) */
FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */ FT_TRACE_DEF( ttobjs ) /* TT objects manager (ttobjs.c) */
FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */ FT_TRACE_DEF( ttpload ) /* TT data/program loader (ttpload.c) */
FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */ FT_TRACE_DEF( ttgxvar ) /* TrueType GX var handler (ttgxvar.c) */
/* Type 1 driver components */ /* Type 1 driver components */
FT_TRACE_DEF( t1afm ) FT_TRACE_DEF( t1afm )
FT_TRACE_DEF( t1driver ) FT_TRACE_DEF( t1driver )
FT_TRACE_DEF( t1gload ) FT_TRACE_DEF( t1gload )
FT_TRACE_DEF( t1hint ) FT_TRACE_DEF( t1hint )
FT_TRACE_DEF( t1load ) FT_TRACE_DEF( t1load )
FT_TRACE_DEF( t1objs ) FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse ) FT_TRACE_DEF( t1parse )
/* PostScript helper module `psaux' */ /* PostScript helper module `psaux' */
FT_TRACE_DEF( t1decode ) FT_TRACE_DEF( t1decode )
FT_TRACE_DEF( psobjs ) FT_TRACE_DEF( psobjs )
/* PostScript hinting module `pshinter' */ /* PostScript hinting module `pshinter' */
FT_TRACE_DEF( pshrec ) FT_TRACE_DEF( pshrec )
FT_TRACE_DEF( pshalgo1 ) FT_TRACE_DEF( pshalgo1 )
FT_TRACE_DEF( pshalgo2 ) FT_TRACE_DEF( pshalgo2 )
/* Type 2 driver components */ /* Type 2 driver components */
FT_TRACE_DEF( cffdriver ) FT_TRACE_DEF( cffdriver )
FT_TRACE_DEF( cffgload ) FT_TRACE_DEF( cffgload )
FT_TRACE_DEF( cffload ) FT_TRACE_DEF( cffload )
FT_TRACE_DEF( cffobjs ) FT_TRACE_DEF( cffobjs )
FT_TRACE_DEF( cffparse ) FT_TRACE_DEF( cffparse )
/* Type 42 driver component */ /* Type 42 driver component */
FT_TRACE_DEF( t42 ) FT_TRACE_DEF( t42 )
/* CID driver components */ /* CID driver components */
FT_TRACE_DEF( cidafm ) FT_TRACE_DEF( cidafm )
FT_TRACE_DEF( ciddriver ) FT_TRACE_DEF( ciddriver )
FT_TRACE_DEF( cidgload ) FT_TRACE_DEF( cidgload )
FT_TRACE_DEF( cidload ) FT_TRACE_DEF( cidload )
FT_TRACE_DEF( cidobjs ) FT_TRACE_DEF( cidobjs )
FT_TRACE_DEF( cidparse ) FT_TRACE_DEF( cidparse )
/* Windows font component */ /* Windows font component */
FT_TRACE_DEF( winfnt ) FT_TRACE_DEF( winfnt )
/* PCF font components */ /* PCF font components */
FT_TRACE_DEF( pcfdriver ) FT_TRACE_DEF( pcfdriver )
FT_TRACE_DEF( pcfread ) FT_TRACE_DEF( pcfread )
/* BDF font components */ /* BDF font components */
FT_TRACE_DEF( bdfdriver ) FT_TRACE_DEF( bdfdriver )
FT_TRACE_DEF( bdflib ) FT_TRACE_DEF( bdflib )
/* PFR font component */ /* PFR font component */
FT_TRACE_DEF( pfr ) FT_TRACE_DEF( pfr )
/* OpenType validation components */ /* OpenType validation components */
FT_TRACE_DEF( otvmodule ) FT_TRACE_DEF( otvmodule )
FT_TRACE_DEF( otvcommon ) FT_TRACE_DEF( otvcommon )
FT_TRACE_DEF( otvbase ) FT_TRACE_DEF( otvbase )
FT_TRACE_DEF( otvgdef ) FT_TRACE_DEF( otvgdef )
FT_TRACE_DEF( otvgpos ) FT_TRACE_DEF( otvgpos )
FT_TRACE_DEF( otvgsub ) FT_TRACE_DEF( otvgsub )
FT_TRACE_DEF( otvjstf ) FT_TRACE_DEF( otvjstf )
FT_TRACE_DEF( otvmath ) FT_TRACE_DEF( otvmath )
/* TrueTypeGX/AAT validation components */ /* TrueTypeGX/AAT validation components */
FT_TRACE_DEF( gxvmodule ) FT_TRACE_DEF( gxvmodule )
FT_TRACE_DEF( gxvcommon ) FT_TRACE_DEF( gxvcommon )
FT_TRACE_DEF( gxvfeat ) FT_TRACE_DEF( gxvfeat )
FT_TRACE_DEF( gxvmort ) FT_TRACE_DEF( gxvmort )
FT_TRACE_DEF( gxvmorx ) FT_TRACE_DEF( gxvmorx )
FT_TRACE_DEF( gxvbsln ) FT_TRACE_DEF( gxvbsln )
FT_TRACE_DEF( gxvjust ) FT_TRACE_DEF( gxvjust )
FT_TRACE_DEF( gxvkern ) FT_TRACE_DEF( gxvkern )
FT_TRACE_DEF( gxvopbd ) FT_TRACE_DEF( gxvopbd )
FT_TRACE_DEF( gxvtrak ) FT_TRACE_DEF( gxvtrak )
FT_TRACE_DEF( gxvprop ) FT_TRACE_DEF( gxvprop )
FT_TRACE_DEF( gxvlcar ) FT_TRACE_DEF( gxvlcar )
/* autofit components */
/* END */ FT_TRACE_DEF( afcjk )
FT_TRACE_DEF( aflatin )
FT_TRACE_DEF( aflatin2 )
FT_TRACE_DEF( afwarp )
/* END */

View file

@ -1,150 +1,150 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ftvalid.h */ /* ftvalid.h */
/* */ /* */
/* FreeType validation support (specification). */ /* FreeType validation support (specification). */
/* */ /* */
/* Copyright 2004 by */ /* Copyright 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __FTVALID_H__ #ifndef __FTVALID_H__
#define __FTVALID_H__ #define __FTVALID_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */ #include FT_CONFIG_STANDARD_LIBRARY_H /* for ft_setjmp and ft_longjmp */
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/**** ****/ /**** ****/
/**** ****/ /**** ****/
/**** V A L I D A T I O N ****/ /**** V A L I D A T I O N ****/
/**** ****/ /**** ****/
/**** ****/ /**** ****/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* handle to a validation object */ /* handle to a validation object */
typedef struct FT_ValidatorRec_ volatile* FT_Validator; typedef struct FT_ValidatorRec_ volatile* FT_Validator;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* There are three distinct validation levels defined here: */ /* There are three distinct validation levels defined here: */
/* */ /* */
/* FT_VALIDATE_DEFAULT :: */ /* FT_VALIDATE_DEFAULT :: */
/* A table that passes this validation level can be used reliably by */ /* A table that passes this validation level can be used reliably by */
/* FreeType. It generally means that all offsets have been checked to */ /* FreeType. It generally means that all offsets have been checked to */
/* prevent out-of-bound reads, that array counts are correct, etc. */ /* prevent out-of-bound reads, that array counts are correct, etc. */
/* */ /* */
/* FT_VALIDATE_TIGHT :: */ /* FT_VALIDATE_TIGHT :: */
/* A table that passes this validation level can be used reliably and */ /* A table that passes this validation level can be used reliably and */
/* doesn't contain invalid data. For example, a charmap table that */ /* doesn't contain invalid data. For example, a charmap table that */
/* returns invalid glyph indices will not pass, even though it can */ /* returns invalid glyph indices will not pass, even though it can */
/* be used with FreeType in default mode (the library will simply */ /* be used with FreeType in default mode (the library will simply */
/* return an error later when trying to load the glyph). */ /* return an error later when trying to load the glyph). */
/* */ /* */
/* It also checks that fields which must be a multiple of 2, 4, or 8, */ /* It also checks that fields which must be a multiple of 2, 4, or 8, */
/* don't have incorrect values, etc. */ /* don't have incorrect values, etc. */
/* */ /* */
/* FT_VALIDATE_PARANOID :: */ /* FT_VALIDATE_PARANOID :: */
/* Only for font debugging. Checks that a table follows the */ /* Only for font debugging. Checks that a table follows the */
/* specification by 100%. Very few fonts will be able to pass this */ /* specification by 100%. Very few fonts will be able to pass this */
/* level anyway but it can be useful for certain tools like font */ /* level anyway but it can be useful for certain tools like font */
/* editors/converters. */ /* editors/converters. */
/* */ /* */
typedef enum FT_ValidationLevel_ typedef enum FT_ValidationLevel_
{ {
FT_VALIDATE_DEFAULT = 0, FT_VALIDATE_DEFAULT = 0,
FT_VALIDATE_TIGHT, FT_VALIDATE_TIGHT,
FT_VALIDATE_PARANOID FT_VALIDATE_PARANOID
} FT_ValidationLevel; } FT_ValidationLevel;
/* validator structure */ /* validator structure */
typedef struct FT_ValidatorRec_ typedef struct FT_ValidatorRec_
{ {
const FT_Byte* base; /* address of table in memory */ const FT_Byte* base; /* address of table in memory */
const FT_Byte* limit; /* `base' + sizeof(table) in memory */ const FT_Byte* limit; /* `base' + sizeof(table) in memory */
FT_ValidationLevel level; /* validation level */ FT_ValidationLevel level; /* validation level */
FT_Error error; /* error returned. 0 means success */ FT_Error error; /* error returned. 0 means success */
ft_jmp_buf jump_buffer; /* used for exception handling */ ft_jmp_buf jump_buffer; /* used for exception handling */
} FT_ValidatorRec; } FT_ValidatorRec;
#define FT_VALIDATOR( x ) ((FT_Validator)( x )) #define FT_VALIDATOR( x ) ((FT_Validator)( x ))
FT_BASE( void ) FT_BASE( void )
ft_validator_init( FT_Validator valid, ft_validator_init( FT_Validator valid,
const FT_Byte* base, const FT_Byte* base,
const FT_Byte* limit, const FT_Byte* limit,
FT_ValidationLevel level ); FT_ValidationLevel level );
/* Do not use this. It's broken and will cause your validator to crash */ /* Do not use this. It's broken and will cause your validator to crash */
/* if you run it on an invalid font. */ /* if you run it on an invalid font. */
FT_BASE( FT_Int ) FT_BASE( FT_Int )
ft_validator_run( FT_Validator valid ); ft_validator_run( FT_Validator valid );
/* Sets the error field in a validator, then calls `longjmp' to return */ /* Sets the error field in a validator, then calls `longjmp' to return */
/* to high-level caller. Using `setjmp/longjmp' avoids many stupid */ /* to high-level caller. Using `setjmp/longjmp' avoids many stupid */
/* error checks within the validation routines. */ /* error checks within the validation routines. */
/* */ /* */
FT_BASE( void ) FT_BASE( void )
ft_validator_error( FT_Validator valid, ft_validator_error( FT_Validator valid,
FT_Error error ); FT_Error error );
/* Calls ft_validate_error. Assumes that the `valid' local variable */ /* Calls ft_validate_error. Assumes that the `valid' local variable */
/* holds a pointer to the current validator object. */ /* holds a pointer to the current validator object. */
/* */ /* */
/* Use preprocessor prescan to pass FT_ERR_PREFIX. */ /* Use preprocessor prescan to pass FT_ERR_PREFIX. */
/* */ /* */
#define FT_INVALID( _prefix, _error ) FT_INVALID_( _prefix, _error ) #define FT_INVALID( _prefix, _error ) FT_INVALID_( _prefix, _error )
#define FT_INVALID_( _prefix, _error ) \ #define FT_INVALID_( _prefix, _error ) \
ft_validator_error( valid, _prefix ## _error ) ft_validator_error( valid, _prefix ## _error )
/* called when a broken table is detected */ /* called when a broken table is detected */
#define FT_INVALID_TOO_SHORT \ #define FT_INVALID_TOO_SHORT \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table ) FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
/* called when an invalid offset is detected */ /* called when an invalid offset is detected */
#define FT_INVALID_OFFSET \ #define FT_INVALID_OFFSET \
FT_INVALID( FT_ERR_PREFIX, Invalid_Offset ) FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )
/* called when an invalid format/value is detected */ /* called when an invalid format/value is detected */
#define FT_INVALID_FORMAT \ #define FT_INVALID_FORMAT \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table ) FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
/* called when an invalid glyph index is detected */ /* called when an invalid glyph index is detected */
#define FT_INVALID_GLYPH_ID \ #define FT_INVALID_GLYPH_ID \
FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index ) FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )
/* called when an invalid field value is detected */ /* called when an invalid field value is detected */
#define FT_INVALID_DATA \ #define FT_INVALID_DATA \
FT_INVALID( FT_ERR_PREFIX, Invalid_Table ) FT_INVALID( FT_ERR_PREFIX, Invalid_Table )
FT_END_HEADER FT_END_HEADER
#endif /* __FTVALID_H__ */ #endif /* __FTVALID_H__ */
/* END */ /* END */

View file

@ -1,51 +1,51 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* internal.h */ /* internal.h */
/* */ /* */
/* Internal header files (specification only). */ /* Internal header files (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004 by */ /* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This file is automatically included by `ft2build.h'. */ /* This file is automatically included by `ft2build.h'. */
/* Do not include it manually! */ /* Do not include it manually! */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h> #define FT_INTERNAL_OBJECTS_H <freetype/internal/ftobjs.h>
#define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h> #define FT_INTERNAL_PIC_H <freetype/internal/ftpic.h>
#define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h> #define FT_INTERNAL_STREAM_H <freetype/internal/ftstream.h>
#define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h> #define FT_INTERNAL_MEMORY_H <freetype/internal/ftmemory.h>
#define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h> #define FT_INTERNAL_DEBUG_H <freetype/internal/ftdebug.h>
#define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h> #define FT_INTERNAL_CALC_H <freetype/internal/ftcalc.h>
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h> #define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h> #define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h> #define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h> #define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
#define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h> #define FT_INTERNAL_SERVICE_H <freetype/internal/ftserv.h>
#define FT_INTERNAL_RFORK_H <freetype/internal/ftrfork.h> #define FT_INTERNAL_RFORK_H <freetype/internal/ftrfork.h>
#define FT_INTERNAL_VALIDATE_H <freetype/internal/ftvalid.h> #define FT_INTERNAL_VALIDATE_H <freetype/internal/ftvalid.h>
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h> #define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h> #define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h> #define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h> #define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>
#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h> #define FT_INTERNAL_POSTSCRIPT_GLOBALS_H <freetype/internal/psglobal.h>
#define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h> #define FT_INTERNAL_AUTOHINT_H <freetype/internal/autohint.h>
/* END */ /* END */

View file

@ -1,56 +0,0 @@
/* pcftypes.h
FreeType font driver for pcf fonts
Copyright (C) 2000, 2001, 2002 by
Francesco Zappa Nardelli
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef __PCFTYPES_H__
#define __PCFTYPES_H__
#include <ft2build.h>
#include FT_FREETYPE_H
FT_BEGIN_HEADER
typedef struct PCF_Public_FaceRec_
{
FT_FaceRec root;
FT_StreamRec gzip_stream;
FT_Stream gzip_source;
char* charset_encoding;
char* charset_registry;
} PCF_Public_FaceRec, *PCF_Public_Face;
FT_END_HEADER
#endif /* __PCFTYPES_H__ */
/* END */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,77 +1,77 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svbdf.h */ /* svbdf.h */
/* */ /* */
/* The FreeType BDF services (specification). */ /* The FreeType BDF services (specification). */
/* */ /* */
/* Copyright 2003 by */ /* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVBDF_H__ #ifndef __SVBDF_H__
#define __SVBDF_H__ #define __SVBDF_H__
#include FT_BDF_H #include FT_BDF_H
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_BDF "bdf" #define FT_SERVICE_ID_BDF "bdf"
typedef FT_Error typedef FT_Error
(*FT_BDF_GetCharsetIdFunc)( FT_Face face, (*FT_BDF_GetCharsetIdFunc)( FT_Face face,
const char* *acharset_encoding, const char* *acharset_encoding,
const char* *acharset_registry ); const char* *acharset_registry );
typedef FT_Error typedef FT_Error
(*FT_BDF_GetPropertyFunc)( FT_Face face, (*FT_BDF_GetPropertyFunc)( FT_Face face,
const char* prop_name, const char* prop_name,
BDF_PropertyRec *aproperty ); BDF_PropertyRec *aproperty );
FT_DEFINE_SERVICE( BDF ) FT_DEFINE_SERVICE( BDF )
{ {
FT_BDF_GetCharsetIdFunc get_charset_id; FT_BDF_GetCharsetIdFunc get_charset_id;
FT_BDF_GetPropertyFunc get_property; FT_BDF_GetPropertyFunc get_property;
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \ #define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \
static const FT_Service_BDFRec class_ = \ static const FT_Service_BDFRec class_ = \
{ \ { \
get_charset_id_, get_property_ \ get_charset_id_, get_property_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \ #define FT_DEFINE_SERVICE_BDFRec(class_, get_charset_id_, get_property_) \
void \ void \
FT_Init_Class_##class_( FT_Service_BDFRec* clazz ) \ FT_Init_Class_##class_( FT_Service_BDFRec* clazz ) \
{ \ { \
clazz->get_charset_id = get_charset_id_; \ clazz->get_charset_id = get_charset_id_; \
clazz->get_property = get_property_; \ clazz->get_property = get_property_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVBDF_H__ */ #endif /* __SVBDF_H__ */
/* END */ /* END */

View file

@ -1,83 +1,83 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svcid.h */ /* svcid.h */
/* */ /* */
/* The FreeType CID font services (specification). */ /* The FreeType CID font services (specification). */
/* */ /* */
/* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */ /* Copyright 2007, 2009 by Derek Clegg, Michael Toftdal. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVCID_H__ #ifndef __SVCID_H__
#define __SVCID_H__ #define __SVCID_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_CID "CID" #define FT_SERVICE_ID_CID "CID"
typedef FT_Error typedef FT_Error
(*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face, (*FT_CID_GetRegistryOrderingSupplementFunc)( FT_Face face,
const char* *registry, const char* *registry,
const char* *ordering, const char* *ordering,
FT_Int *supplement ); FT_Int *supplement );
typedef FT_Error typedef FT_Error
(*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face, (*FT_CID_GetIsInternallyCIDKeyedFunc)( FT_Face face,
FT_Bool *is_cid ); FT_Bool *is_cid );
typedef FT_Error typedef FT_Error
(*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face, (*FT_CID_GetCIDFromGlyphIndexFunc)( FT_Face face,
FT_UInt glyph_index, FT_UInt glyph_index,
FT_UInt *cid ); FT_UInt *cid );
FT_DEFINE_SERVICE( CID ) FT_DEFINE_SERVICE( CID )
{ {
FT_CID_GetRegistryOrderingSupplementFunc get_ros; FT_CID_GetRegistryOrderingSupplementFunc get_ros;
FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid; FT_CID_GetIsInternallyCIDKeyedFunc get_is_cid;
FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index; FT_CID_GetCIDFromGlyphIndexFunc get_cid_from_glyph_index;
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \ #define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \
get_is_cid_, get_cid_from_glyph_index_ ) \ get_is_cid_, get_cid_from_glyph_index_ ) \
static const FT_Service_CIDRec class_ = \ static const FT_Service_CIDRec class_ = \
{ \ { \
get_ros_, get_is_cid_, get_cid_from_glyph_index_ \ get_ros_, get_is_cid_, get_cid_from_glyph_index_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \ #define FT_DEFINE_SERVICE_CIDREC(class_, get_ros_, \
get_is_cid_, get_cid_from_glyph_index_ ) \ get_is_cid_, get_cid_from_glyph_index_ ) \
void \ void \
FT_Init_Class_##class_( FT_Library library, \ FT_Init_Class_##class_( FT_Library library, \
FT_Service_CIDRec* clazz) \ FT_Service_CIDRec* clazz) \
{ \ { \
FT_UNUSED(library); \ FT_UNUSED(library); \
clazz->get_ros = get_ros_; \ clazz->get_ros = get_ros_; \
clazz->get_is_cid = get_is_cid_; \ clazz->get_is_cid = get_is_cid_; \
clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \ clazz->get_cid_from_glyph_index = get_cid_from_glyph_index_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVCID_H__ */ #endif /* __SVCID_H__ */
/* END */ /* END */

View file

@ -1,82 +1,82 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svgldict.h */ /* svgldict.h */
/* */ /* */
/* The FreeType glyph dictionary services (specification). */ /* The FreeType glyph dictionary services (specification). */
/* */ /* */
/* Copyright 2003 by */ /* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVGLDICT_H__ #ifndef __SVGLDICT_H__
#define __SVGLDICT_H__ #define __SVGLDICT_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* /*
* A service used to retrieve glyph names, as well as to find the * A service used to retrieve glyph names, as well as to find the
* index of a given glyph name in a font. * index of a given glyph name in a font.
* *
*/ */
#define FT_SERVICE_ID_GLYPH_DICT "glyph-dict" #define FT_SERVICE_ID_GLYPH_DICT "glyph-dict"
typedef FT_Error typedef FT_Error
(*FT_GlyphDict_GetNameFunc)( FT_Face face, (*FT_GlyphDict_GetNameFunc)( FT_Face face,
FT_UInt glyph_index, FT_UInt glyph_index,
FT_Pointer buffer, FT_Pointer buffer,
FT_UInt buffer_max ); FT_UInt buffer_max );
typedef FT_UInt typedef FT_UInt
(*FT_GlyphDict_NameIndexFunc)( FT_Face face, (*FT_GlyphDict_NameIndexFunc)( FT_Face face,
FT_String* glyph_name ); FT_String* glyph_name );
FT_DEFINE_SERVICE( GlyphDict ) FT_DEFINE_SERVICE( GlyphDict )
{ {
FT_GlyphDict_GetNameFunc get_name; FT_GlyphDict_GetNameFunc get_name;
FT_GlyphDict_NameIndexFunc name_index; /* optional */ FT_GlyphDict_NameIndexFunc name_index; /* optional */
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \ #define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \
static const FT_Service_GlyphDictRec class_ = \ static const FT_Service_GlyphDictRec class_ = \
{ \ { \
get_name_, name_index_ \ get_name_, name_index_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \ #define FT_DEFINE_SERVICE_GLYPHDICTREC(class_, get_name_, name_index_) \
void \ void \
FT_Init_Class_##class_( FT_Library library, \ FT_Init_Class_##class_( FT_Library library, \
FT_Service_GlyphDictRec* clazz) \ FT_Service_GlyphDictRec* clazz) \
{ \ { \
FT_UNUSED(library); \ FT_UNUSED(library); \
clazz->get_name = get_name_; \ clazz->get_name = get_name_; \
clazz->name_index = name_index_; \ clazz->name_index = name_index_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVGLDICT_H__ */ #endif /* __SVGLDICT_H__ */

View file

@ -1,72 +1,72 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svgxval.h */ /* svgxval.h */
/* */ /* */
/* FreeType API for validating TrueTypeGX/AAT tables (specification). */ /* FreeType API for validating TrueTypeGX/AAT tables (specification). */
/* */ /* */
/* Copyright 2004, 2005 by */ /* Copyright 2004, 2005 by */
/* Masatake YAMATO, Red Hat K.K., */ /* Masatake YAMATO, Red Hat K.K., */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* gxvalid is derived from both gxlayout module and otvalid module. */ /* gxvalid is derived from both gxlayout module and otvalid module. */
/* Development of gxlayout is supported by the Information-technology */ /* Development of gxlayout is supported by the Information-technology */
/* Promotion Agency(IPA), Japan. */ /* Promotion Agency(IPA), Japan. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVGXVAL_H__ #ifndef __SVGXVAL_H__
#define __SVGXVAL_H__ #define __SVGXVAL_H__
#include FT_GX_VALIDATE_H #include FT_GX_VALIDATE_H
#include FT_INTERNAL_VALIDATE_H #include FT_INTERNAL_VALIDATE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate" #define FT_SERVICE_ID_GX_VALIDATE "truetypegx-validate"
#define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate" #define FT_SERVICE_ID_CLASSICKERN_VALIDATE "classickern-validate"
typedef FT_Error typedef FT_Error
(*gxv_validate_func)( FT_Face face, (*gxv_validate_func)( FT_Face face,
FT_UInt gx_flags, FT_UInt gx_flags,
FT_Bytes tables[FT_VALIDATE_GX_LENGTH], FT_Bytes tables[FT_VALIDATE_GX_LENGTH],
FT_UInt table_length ); FT_UInt table_length );
typedef FT_Error typedef FT_Error
(*ckern_validate_func)( FT_Face face, (*ckern_validate_func)( FT_Face face,
FT_UInt ckern_flags, FT_UInt ckern_flags,
FT_Bytes *ckern_table ); FT_Bytes *ckern_table );
FT_DEFINE_SERVICE( GXvalidate ) FT_DEFINE_SERVICE( GXvalidate )
{ {
gxv_validate_func validate; gxv_validate_func validate;
}; };
FT_DEFINE_SERVICE( CKERNvalidate ) FT_DEFINE_SERVICE( CKERNvalidate )
{ {
ckern_validate_func validate; ckern_validate_func validate;
}; };
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVGXVAL_H__ */ #endif /* __SVGXVAL_H__ */
/* END */ /* END */

View file

@ -1,51 +1,51 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svkern.h */ /* svkern.h */
/* */ /* */
/* The FreeType Kerning service (specification). */ /* The FreeType Kerning service (specification). */
/* */ /* */
/* Copyright 2006 by */ /* Copyright 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVKERN_H__ #ifndef __SVKERN_H__
#define __SVKERN_H__ #define __SVKERN_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H #include FT_TRUETYPE_TABLES_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_KERNING "kerning" #define FT_SERVICE_ID_KERNING "kerning"
typedef FT_Error typedef FT_Error
(*FT_Kerning_TrackGetFunc)( FT_Face face, (*FT_Kerning_TrackGetFunc)( FT_Face face,
FT_Fixed point_size, FT_Fixed point_size,
FT_Int degree, FT_Int degree,
FT_Fixed* akerning ); FT_Fixed* akerning );
FT_DEFINE_SERVICE( Kerning ) FT_DEFINE_SERVICE( Kerning )
{ {
FT_Kerning_TrackGetFunc get_track; FT_Kerning_TrackGetFunc get_track;
}; };
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVKERN_H__ */ #endif /* __SVKERN_H__ */
/* END */ /* END */

View file

@ -1,104 +1,104 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svmm.h */ /* svmm.h */
/* */ /* */
/* The FreeType Multiple Masters and GX var services (specification). */ /* The FreeType Multiple Masters and GX var services (specification). */
/* */ /* */
/* Copyright 2003, 2004 by */ /* Copyright 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVMM_H__ #ifndef __SVMM_H__
#define __SVMM_H__ #define __SVMM_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* /*
* A service used to manage multiple-masters data in a given face. * A service used to manage multiple-masters data in a given face.
* *
* See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H). * See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).
* *
*/ */
#define FT_SERVICE_ID_MULTI_MASTERS "multi-masters" #define FT_SERVICE_ID_MULTI_MASTERS "multi-masters"
typedef FT_Error typedef FT_Error
(*FT_Get_MM_Func)( FT_Face face, (*FT_Get_MM_Func)( FT_Face face,
FT_Multi_Master* master ); FT_Multi_Master* master );
typedef FT_Error typedef FT_Error
(*FT_Get_MM_Var_Func)( FT_Face face, (*FT_Get_MM_Var_Func)( FT_Face face,
FT_MM_Var* *master ); FT_MM_Var* *master );
typedef FT_Error typedef FT_Error
(*FT_Set_MM_Design_Func)( FT_Face face, (*FT_Set_MM_Design_Func)( FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Long* coords ); FT_Long* coords );
typedef FT_Error typedef FT_Error
(*FT_Set_Var_Design_Func)( FT_Face face, (*FT_Set_Var_Design_Func)( FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Fixed* coords ); FT_Fixed* coords );
typedef FT_Error typedef FT_Error
(*FT_Set_MM_Blend_Func)( FT_Face face, (*FT_Set_MM_Blend_Func)( FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Long* coords ); FT_Long* coords );
FT_DEFINE_SERVICE( MultiMasters ) FT_DEFINE_SERVICE( MultiMasters )
{ {
FT_Get_MM_Func get_mm; FT_Get_MM_Func get_mm;
FT_Set_MM_Design_Func set_mm_design; FT_Set_MM_Design_Func set_mm_design;
FT_Set_MM_Blend_Func set_mm_blend; FT_Set_MM_Blend_Func set_mm_blend;
FT_Get_MM_Var_Func get_mm_var; FT_Get_MM_Var_Func get_mm_var;
FT_Set_Var_Design_Func set_var_design; FT_Set_Var_Design_Func set_var_design;
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \ #define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \
set_mm_blend_, get_mm_var_, set_var_design_) \ set_mm_blend_, get_mm_var_, set_var_design_) \
static const FT_Service_MultiMastersRec class_ = \ static const FT_Service_MultiMastersRec class_ = \
{ \ { \
get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \ get_mm_, set_mm_design_, set_mm_blend_, get_mm_var_, set_var_design_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \ #define FT_DEFINE_SERVICE_MULTIMASTERSREC(class_, get_mm_, set_mm_design_, \
set_mm_blend_, get_mm_var_, set_var_design_) \ set_mm_blend_, get_mm_var_, set_var_design_) \
void \ void \
FT_Init_Class_##class_( FT_Service_MultiMastersRec* clazz ) \ FT_Init_Class_##class_( FT_Service_MultiMastersRec* clazz ) \
{ \ { \
clazz->get_mm = get_mm_; \ clazz->get_mm = get_mm_; \
clazz->set_mm_design = set_mm_design_; \ clazz->set_mm_design = set_mm_design_; \
clazz->set_mm_blend = set_mm_blend_; \ clazz->set_mm_blend = set_mm_blend_; \
clazz->get_mm_var = get_mm_var_; \ clazz->get_mm_var = get_mm_var_; \
clazz->set_var_design = set_var_design_; \ clazz->set_var_design = set_var_design_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVMM_H__ */ #endif /* __SVMM_H__ */
/* END */ /* END */

View file

@ -1,55 +1,55 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svotval.h */ /* svotval.h */
/* */ /* */
/* The FreeType OpenType validation service (specification). */ /* The FreeType OpenType validation service (specification). */
/* */ /* */
/* Copyright 2004, 2006 by */ /* Copyright 2004, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVOTVAL_H__ #ifndef __SVOTVAL_H__
#define __SVOTVAL_H__ #define __SVOTVAL_H__
#include FT_OPENTYPE_VALIDATE_H #include FT_OPENTYPE_VALIDATE_H
#include FT_INTERNAL_VALIDATE_H #include FT_INTERNAL_VALIDATE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate" #define FT_SERVICE_ID_OPENTYPE_VALIDATE "opentype-validate"
typedef FT_Error typedef FT_Error
(*otv_validate_func)( FT_Face volatile face, (*otv_validate_func)( FT_Face volatile face,
FT_UInt ot_flags, FT_UInt ot_flags,
FT_Bytes *base, FT_Bytes *base,
FT_Bytes *gdef, FT_Bytes *gdef,
FT_Bytes *gpos, FT_Bytes *gpos,
FT_Bytes *gsub, FT_Bytes *gsub,
FT_Bytes *jstf ); FT_Bytes *jstf );
FT_DEFINE_SERVICE( OTvalidate ) FT_DEFINE_SERVICE( OTvalidate )
{ {
otv_validate_func validate; otv_validate_func validate;
}; };
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVOTVAL_H__ */ #endif /* __SVOTVAL_H__ */
/* END */ /* END */

View file

@ -1,66 +1,66 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svpfr.h */ /* svpfr.h */
/* */ /* */
/* Internal PFR service functions (specification). */ /* Internal PFR service functions (specification). */
/* */ /* */
/* Copyright 2003, 2006 by */ /* Copyright 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVPFR_H__ #ifndef __SVPFR_H__
#define __SVPFR_H__ #define __SVPFR_H__
#include FT_PFR_H #include FT_PFR_H
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_PFR_METRICS "pfr-metrics" #define FT_SERVICE_ID_PFR_METRICS "pfr-metrics"
typedef FT_Error typedef FT_Error
(*FT_PFR_GetMetricsFunc)( FT_Face face, (*FT_PFR_GetMetricsFunc)( FT_Face face,
FT_UInt *aoutline, FT_UInt *aoutline,
FT_UInt *ametrics, FT_UInt *ametrics,
FT_Fixed *ax_scale, FT_Fixed *ax_scale,
FT_Fixed *ay_scale ); FT_Fixed *ay_scale );
typedef FT_Error typedef FT_Error
(*FT_PFR_GetKerningFunc)( FT_Face face, (*FT_PFR_GetKerningFunc)( FT_Face face,
FT_UInt left, FT_UInt left,
FT_UInt right, FT_UInt right,
FT_Vector *avector ); FT_Vector *avector );
typedef FT_Error typedef FT_Error
(*FT_PFR_GetAdvanceFunc)( FT_Face face, (*FT_PFR_GetAdvanceFunc)( FT_Face face,
FT_UInt gindex, FT_UInt gindex,
FT_Pos *aadvance ); FT_Pos *aadvance );
FT_DEFINE_SERVICE( PfrMetrics ) FT_DEFINE_SERVICE( PfrMetrics )
{ {
FT_PFR_GetMetricsFunc get_metrics; FT_PFR_GetMetricsFunc get_metrics;
FT_PFR_GetKerningFunc get_kerning; FT_PFR_GetKerningFunc get_kerning;
FT_PFR_GetAdvanceFunc get_advance; FT_PFR_GetAdvanceFunc get_advance;
}; };
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVPFR_H__ */ #endif /* __SVPFR_H__ */
/* END */ /* END */

View file

@ -1,79 +1,79 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svpostnm.h */ /* svpostnm.h */
/* */ /* */
/* The FreeType PostScript name services (specification). */ /* The FreeType PostScript name services (specification). */
/* */ /* */
/* Copyright 2003, 2007 by */ /* Copyright 2003, 2007 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVPOSTNM_H__ #ifndef __SVPOSTNM_H__
#define __SVPOSTNM_H__ #define __SVPOSTNM_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* /*
* A trivial service used to retrieve the PostScript name of a given * A trivial service used to retrieve the PostScript name of a given
* font when available. The `get_name' field should never be NULL. * font when available. The `get_name' field should never be NULL.
* *
* The corresponding function can return NULL to indicate that the * The corresponding function can return NULL to indicate that the
* PostScript name is not available. * PostScript name is not available.
* *
* The name is owned by the face and will be destroyed with it. * The name is owned by the face and will be destroyed with it.
*/ */
#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name" #define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME "postscript-font-name"
typedef const char* typedef const char*
(*FT_PsName_GetFunc)( FT_Face face ); (*FT_PsName_GetFunc)( FT_Face face );
FT_DEFINE_SERVICE( PsFontName ) FT_DEFINE_SERVICE( PsFontName )
{ {
FT_PsName_GetFunc get_ps_font_name; FT_PsName_GetFunc get_ps_font_name;
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \ #define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \
static const FT_Service_PsFontNameRec class_ = \ static const FT_Service_PsFontNameRec class_ = \
{ \ { \
get_ps_font_name_ \ get_ps_font_name_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \ #define FT_DEFINE_SERVICE_PSFONTNAMEREC(class_, get_ps_font_name_) \
void \ void \
FT_Init_Class_##class_( FT_Library library, \ FT_Init_Class_##class_( FT_Library library, \
FT_Service_PsFontNameRec* clazz) \ FT_Service_PsFontNameRec* clazz) \
{ \ { \
FT_UNUSED(library); \ FT_UNUSED(library); \
clazz->get_ps_font_name = get_ps_font_name_; \ clazz->get_ps_font_name = get_ps_font_name_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVPOSTNM_H__ */ #endif /* __SVPOSTNM_H__ */
/* END */ /* END */

View file

@ -1,164 +1,164 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svpscmap.h */ /* svpscmap.h */
/* */ /* */
/* The FreeType PostScript charmap service (specification). */ /* The FreeType PostScript charmap service (specification). */
/* */ /* */
/* Copyright 2003, 2006 by */ /* Copyright 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVPSCMAP_H__ #ifndef __SVPSCMAP_H__
#define __SVPSCMAP_H__ #define __SVPSCMAP_H__
#include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_OBJECTS_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps" #define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps"
/* /*
* Adobe glyph name to unicode value. * Adobe glyph name to unicode value.
*/ */
typedef FT_UInt32 typedef FT_UInt32
(*PS_Unicode_ValueFunc)( const char* glyph_name ); (*PS_Unicode_ValueFunc)( const char* glyph_name );
/* /*
* Macintosh name id to glyph name. NULL if invalid index. * Macintosh name id to glyph name. NULL if invalid index.
*/ */
typedef const char* typedef const char*
(*PS_Macintosh_NameFunc)( FT_UInt name_index ); (*PS_Macintosh_NameFunc)( FT_UInt name_index );
/* /*
* Adobe standard string ID to glyph name. NULL if invalid index. * Adobe standard string ID to glyph name. NULL if invalid index.
*/ */
typedef const char* typedef const char*
(*PS_Adobe_Std_StringsFunc)( FT_UInt string_index ); (*PS_Adobe_Std_StringsFunc)( FT_UInt string_index );
/* /*
* Simple unicode -> glyph index charmap built from font glyph names * Simple unicode -> glyph index charmap built from font glyph names
* table. * table.
*/ */
typedef struct PS_UniMap_ typedef struct PS_UniMap_
{ {
FT_UInt32 unicode; /* bit 31 set: is glyph variant */ FT_UInt32 unicode; /* bit 31 set: is glyph variant */
FT_UInt glyph_index; FT_UInt glyph_index;
} PS_UniMap; } PS_UniMap;
typedef struct PS_UnicodesRec_* PS_Unicodes; typedef struct PS_UnicodesRec_* PS_Unicodes;
typedef struct PS_UnicodesRec_ typedef struct PS_UnicodesRec_
{ {
FT_CMapRec cmap; FT_CMapRec cmap;
FT_UInt num_maps; FT_UInt num_maps;
PS_UniMap* maps; PS_UniMap* maps;
} PS_UnicodesRec; } PS_UnicodesRec;
/* /*
* A function which returns a glyph name for a given index. Returns * A function which returns a glyph name for a given index. Returns
* NULL if invalid index. * NULL if invalid index.
*/ */
typedef const char* typedef const char*
(*PS_GetGlyphNameFunc)( FT_Pointer data, (*PS_GetGlyphNameFunc)( FT_Pointer data,
FT_UInt string_index ); FT_UInt string_index );
/* /*
* A function used to release the glyph name returned by * A function used to release the glyph name returned by
* PS_GetGlyphNameFunc, when needed * PS_GetGlyphNameFunc, when needed
*/ */
typedef void typedef void
(*PS_FreeGlyphNameFunc)( FT_Pointer data, (*PS_FreeGlyphNameFunc)( FT_Pointer data,
const char* name ); const char* name );
typedef FT_Error typedef FT_Error
(*PS_Unicodes_InitFunc)( FT_Memory memory, (*PS_Unicodes_InitFunc)( FT_Memory memory,
PS_Unicodes unicodes, PS_Unicodes unicodes,
FT_UInt num_glyphs, FT_UInt num_glyphs,
PS_GetGlyphNameFunc get_glyph_name, PS_GetGlyphNameFunc get_glyph_name,
PS_FreeGlyphNameFunc free_glyph_name, PS_FreeGlyphNameFunc free_glyph_name,
FT_Pointer glyph_data ); FT_Pointer glyph_data );
typedef FT_UInt typedef FT_UInt
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes, (*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
FT_UInt32 unicode ); FT_UInt32 unicode );
typedef FT_UInt32 typedef FT_UInt32
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes, (*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
FT_UInt32 *unicode ); FT_UInt32 *unicode );
FT_DEFINE_SERVICE( PsCMaps ) FT_DEFINE_SERVICE( PsCMaps )
{ {
PS_Unicode_ValueFunc unicode_value; PS_Unicode_ValueFunc unicode_value;
PS_Unicodes_InitFunc unicodes_init; PS_Unicodes_InitFunc unicodes_init;
PS_Unicodes_CharIndexFunc unicodes_char_index; PS_Unicodes_CharIndexFunc unicodes_char_index;
PS_Unicodes_CharNextFunc unicodes_char_next; PS_Unicodes_CharNextFunc unicodes_char_next;
PS_Macintosh_NameFunc macintosh_name; PS_Macintosh_NameFunc macintosh_name;
PS_Adobe_Std_StringsFunc adobe_std_strings; PS_Adobe_Std_StringsFunc adobe_std_strings;
const unsigned short* adobe_std_encoding; const unsigned short* adobe_std_encoding;
const unsigned short* adobe_expert_encoding; const unsigned short* adobe_expert_encoding;
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \ #define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \ adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \
static const FT_Service_PsCMapsRec class_ = \ static const FT_Service_PsCMapsRec class_ = \
{ \ { \
unicode_value_, unicodes_init_, \ unicode_value_, unicodes_init_, \
unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \ adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \ #define FT_DEFINE_SERVICE_PSCMAPSREC(class_, unicode_value_, unicodes_init_, \
unicodes_char_index_, unicodes_char_next_, macintosh_name_, \ unicodes_char_index_, unicodes_char_next_, macintosh_name_, \
adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \ adobe_std_strings_, adobe_std_encoding_, adobe_expert_encoding_) \
void \ void \
FT_Init_Class_##class_( FT_Library library, \ FT_Init_Class_##class_( FT_Library library, \
FT_Service_PsCMapsRec* clazz) \ FT_Service_PsCMapsRec* clazz) \
{ \ { \
FT_UNUSED(library); \ FT_UNUSED(library); \
clazz->unicode_value = unicode_value_; \ clazz->unicode_value = unicode_value_; \
clazz->unicodes_init = unicodes_init_; \ clazz->unicodes_init = unicodes_init_; \
clazz->unicodes_char_index = unicodes_char_index_; \ clazz->unicodes_char_index = unicodes_char_index_; \
clazz->unicodes_char_next = unicodes_char_next_; \ clazz->unicodes_char_next = unicodes_char_next_; \
clazz->macintosh_name = macintosh_name_; \ clazz->macintosh_name = macintosh_name_; \
clazz->adobe_std_strings = adobe_std_strings_; \ clazz->adobe_std_strings = adobe_std_strings_; \
clazz->adobe_std_encoding = adobe_std_encoding_; \ clazz->adobe_std_encoding = adobe_std_encoding_; \
clazz->adobe_expert_encoding = adobe_expert_encoding_; \ clazz->adobe_expert_encoding = adobe_expert_encoding_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVPSCMAP_H__ */ #endif /* __SVPSCMAP_H__ */
/* END */ /* END */

View file

@ -1,92 +1,103 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svpsinfo.h */ /* svpsinfo.h */
/* */ /* */
/* The FreeType PostScript info service (specification). */ /* The FreeType PostScript info service (specification). */
/* */ /* */
/* Copyright 2003, 2004, 2009 by */ /* Copyright 2003, 2004, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVPSINFO_H__ #ifndef __SVPSINFO_H__
#define __SVPSINFO_H__ #define __SVPSINFO_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
#include FT_INTERNAL_TYPE1_TYPES_H #include FT_INTERNAL_TYPE1_TYPES_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info" #define FT_SERVICE_ID_POSTSCRIPT_INFO "postscript-info"
typedef FT_Error typedef FT_Error
(*PS_GetFontInfoFunc)( FT_Face face, (*PS_GetFontInfoFunc)( FT_Face face,
PS_FontInfoRec* afont_info ); PS_FontInfoRec* afont_info );
typedef FT_Error typedef FT_Error
(*PS_GetFontExtraFunc)( FT_Face face, (*PS_GetFontExtraFunc)( FT_Face face,
PS_FontExtraRec* afont_extra ); PS_FontExtraRec* afont_extra );
typedef FT_Int typedef FT_Int
(*PS_HasGlyphNamesFunc)( FT_Face face ); (*PS_HasGlyphNamesFunc)( FT_Face face );
typedef FT_Error typedef FT_Error
(*PS_GetFontPrivateFunc)( FT_Face face, (*PS_GetFontPrivateFunc)( FT_Face face,
PS_PrivateRec* afont_private ); PS_PrivateRec* afont_private );
typedef FT_Long
FT_DEFINE_SERVICE( PsInfo ) (*PS_GetFontValueFunc)( FT_Face face,
{ PS_Dict_Keys key,
PS_GetFontInfoFunc ps_get_font_info; FT_UInt idx,
PS_GetFontExtraFunc ps_get_font_extra; void *value,
PS_HasGlyphNamesFunc ps_has_glyph_names; FT_Long value_len );
PS_GetFontPrivateFunc ps_get_font_private;
};
FT_DEFINE_SERVICE( PsInfo )
#ifndef FT_CONFIG_OPTION_PIC {
PS_GetFontInfoFunc ps_get_font_info;
#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \ PS_GetFontExtraFunc ps_get_font_extra;
ps_get_font_extra_, has_glyph_names_, get_font_private_) \ PS_HasGlyphNamesFunc ps_has_glyph_names;
static const FT_Service_PsInfoRec class_ = \ PS_GetFontPrivateFunc ps_get_font_private;
{ \ PS_GetFontValueFunc ps_get_font_value;
get_font_info_, ps_get_font_extra_, has_glyph_names_, \ };
get_font_private_ \
}; #ifndef FT_CONFIG_OPTION_PIC
#else /* FT_CONFIG_OPTION_PIC */ #define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \
ps_get_font_extra_, has_glyph_names_, get_font_private_, \
#define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \ get_font_value_) \
ps_get_font_extra_, has_glyph_names_, get_font_private_) \ static const FT_Service_PsInfoRec class_ = \
void \ { \
FT_Init_Class_##class_( FT_Library library, \ get_font_info_, ps_get_font_extra_, has_glyph_names_, \
FT_Service_PsInfoRec* clazz) \ get_font_private_, get_font_value_ \
{ \ };
FT_UNUSED(library); \
clazz->ps_get_font_info = get_font_info_; \ #else /* FT_CONFIG_OPTION_PIC */
clazz->ps_get_font_extra = ps_get_font_extra_; \
clazz->ps_has_glyph_names = has_glyph_names_; \ #define FT_DEFINE_SERVICE_PSINFOREC(class_, get_font_info_, \
clazz->ps_get_font_private = get_font_private_; \ ps_get_font_extra_, has_glyph_names_, get_font_private_, \
} get_font_value_) \
void \
#endif /* FT_CONFIG_OPTION_PIC */ FT_Init_Class_##class_( FT_Library library, \
FT_Service_PsInfoRec* clazz) \
/* */ { \
FT_UNUSED(library); \
clazz->ps_get_font_info = get_font_info_; \
FT_END_HEADER clazz->ps_get_font_extra = ps_get_font_extra_; \
clazz->ps_has_glyph_names = has_glyph_names_; \
clazz->ps_get_font_private = get_font_private_; \
#endif /* __SVPSINFO_H__ */ clazz->ps_get_font_value = get_font_value_; \
}
/* END */ #endif /* FT_CONFIG_OPTION_PIC */
/* */
FT_END_HEADER
#endif /* __SVPSINFO_H__ */
/* END */

View file

@ -1,102 +1,102 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svsfnt.h */ /* svsfnt.h */
/* */ /* */
/* The FreeType SFNT table loading service (specification). */ /* The FreeType SFNT table loading service (specification). */
/* */ /* */
/* Copyright 2003, 2004 by */ /* Copyright 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVSFNT_H__ #ifndef __SVSFNT_H__
#define __SVSFNT_H__ #define __SVSFNT_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H #include FT_TRUETYPE_TABLES_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* /*
* SFNT table loading service. * SFNT table loading service.
*/ */
#define FT_SERVICE_ID_SFNT_TABLE "sfnt-table" #define FT_SERVICE_ID_SFNT_TABLE "sfnt-table"
/* /*
* Used to implement FT_Load_Sfnt_Table(). * Used to implement FT_Load_Sfnt_Table().
*/ */
typedef FT_Error typedef FT_Error
(*FT_SFNT_TableLoadFunc)( FT_Face face, (*FT_SFNT_TableLoadFunc)( FT_Face face,
FT_ULong tag, FT_ULong tag,
FT_Long offset, FT_Long offset,
FT_Byte* buffer, FT_Byte* buffer,
FT_ULong* length ); FT_ULong* length );
/* /*
* Used to implement FT_Get_Sfnt_Table(). * Used to implement FT_Get_Sfnt_Table().
*/ */
typedef void* typedef void*
(*FT_SFNT_TableGetFunc)( FT_Face face, (*FT_SFNT_TableGetFunc)( FT_Face face,
FT_Sfnt_Tag tag ); FT_Sfnt_Tag tag );
/* /*
* Used to implement FT_Sfnt_Table_Info(). * Used to implement FT_Sfnt_Table_Info().
*/ */
typedef FT_Error typedef FT_Error
(*FT_SFNT_TableInfoFunc)( FT_Face face, (*FT_SFNT_TableInfoFunc)( FT_Face face,
FT_UInt idx, FT_UInt idx,
FT_ULong *tag, FT_ULong *tag,
FT_ULong *offset, FT_ULong *offset,
FT_ULong *length ); FT_ULong *length );
FT_DEFINE_SERVICE( SFNT_Table ) FT_DEFINE_SERVICE( SFNT_Table )
{ {
FT_SFNT_TableLoadFunc load_table; FT_SFNT_TableLoadFunc load_table;
FT_SFNT_TableGetFunc get_table; FT_SFNT_TableGetFunc get_table;
FT_SFNT_TableInfoFunc table_info; FT_SFNT_TableInfoFunc table_info;
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \ #define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \
static const FT_Service_SFNT_TableRec class_ = \ static const FT_Service_SFNT_TableRec class_ = \
{ \ { \
load_, get_, info_ \ load_, get_, info_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \ #define FT_DEFINE_SERVICE_SFNT_TABLEREC(class_, load_, get_, info_) \
void \ void \
FT_Init_Class_##class_( FT_Service_SFNT_TableRec* clazz ) \ FT_Init_Class_##class_( FT_Service_SFNT_TableRec* clazz ) \
{ \ { \
clazz->load_table = load_; \ clazz->load_table = load_; \
clazz->get_table = get_; \ clazz->get_table = get_; \
clazz->table_info = info_; \ clazz->table_info = info_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVSFNT_H__ */ #endif /* __SVSFNT_H__ */
/* END */ /* END */

View file

@ -1,106 +1,106 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svttcmap.h */ /* svttcmap.h */
/* */ /* */
/* The FreeType TrueType/sfnt cmap extra information service. */ /* The FreeType TrueType/sfnt cmap extra information service. */
/* */ /* */
/* Copyright 2003 by */ /* Copyright 2003 by */
/* Masatake YAMATO, Redhat K.K. */ /* Masatake YAMATO, Redhat K.K. */
/* */ /* */
/* Copyright 2003, 2008 by */ /* Copyright 2003, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/* Development of this service is support of /* Development of this service is support of
Information-technology Promotion Agency, Japan. */ Information-technology Promotion Agency, Japan. */
#ifndef __SVTTCMAP_H__ #ifndef __SVTTCMAP_H__
#define __SVTTCMAP_H__ #define __SVTTCMAP_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H #include FT_TRUETYPE_TABLES_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_TT_CMAP "tt-cmaps" #define FT_SERVICE_ID_TT_CMAP "tt-cmaps"
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* TT_CMapInfo */ /* TT_CMapInfo */
/* */ /* */
/* <Description> */ /* <Description> */
/* A structure used to store TrueType/sfnt specific cmap information */ /* A structure used to store TrueType/sfnt specific cmap information */
/* which is not covered by the generic @FT_CharMap structure. This */ /* which is not covered by the generic @FT_CharMap structure. This */
/* structure can be accessed with the @FT_Get_TT_CMap_Info function. */ /* structure can be accessed with the @FT_Get_TT_CMap_Info function. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* language :: */ /* language :: */
/* The language ID used in Mac fonts. Definitions of values are in */ /* The language ID used in Mac fonts. Definitions of values are in */
/* freetype/ttnameid.h. */ /* freetype/ttnameid.h. */
/* */ /* */
/* format :: */ /* format :: */
/* The cmap format. OpenType 1.5 defines the formats 0 (byte */ /* The cmap format. OpenType 1.5 defines the formats 0 (byte */
/* encoding table), 2~(high-byte mapping through table), 4~(segment */ /* encoding table), 2~(high-byte mapping through table), 4~(segment */
/* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */ /* mapping to delta values), 6~(trimmed table mapping), 8~(mixed */
/* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */ /* 16-bit and 32-bit coverage), 10~(trimmed array), 12~(segmented */
/* coverage), and 14 (Unicode Variation Sequences). */ /* coverage), and 14 (Unicode Variation Sequences). */
/* */ /* */
typedef struct TT_CMapInfo_ typedef struct TT_CMapInfo_
{ {
FT_ULong language; FT_ULong language;
FT_Long format; FT_Long format;
} TT_CMapInfo; } TT_CMapInfo;
typedef FT_Error typedef FT_Error
(*TT_CMap_Info_GetFunc)( FT_CharMap charmap, (*TT_CMap_Info_GetFunc)( FT_CharMap charmap,
TT_CMapInfo *cmap_info ); TT_CMapInfo *cmap_info );
FT_DEFINE_SERVICE( TTCMaps ) FT_DEFINE_SERVICE( TTCMaps )
{ {
TT_CMap_Info_GetFunc get_cmap_info; TT_CMap_Info_GetFunc get_cmap_info;
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \ #define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \
static const FT_Service_TTCMapsRec class_ = \ static const FT_Service_TTCMapsRec class_ = \
{ \ { \
get_cmap_info_ \ get_cmap_info_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \ #define FT_DEFINE_SERVICE_TTCMAPSREC(class_, get_cmap_info_) \
void \ void \
FT_Init_Class_##class_( FT_Library library, \ FT_Init_Class_##class_( FT_Library library, \
FT_Service_TTCMapsRec* clazz) \ FT_Service_TTCMapsRec* clazz) \
{ \ { \
FT_UNUSED(library); \ FT_UNUSED(library); \
clazz->get_cmap_info = get_cmap_info_; \ clazz->get_cmap_info = get_cmap_info_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVTTCMAP_H__ */ #endif /* __SVTTCMAP_H__ */
/* END */ /* END */

View file

@ -1,53 +1,53 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svtteng.h */ /* svtteng.h */
/* */ /* */
/* The FreeType TrueType engine query service (specification). */ /* The FreeType TrueType engine query service (specification). */
/* */ /* */
/* Copyright 2006 by */ /* Copyright 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVTTENG_H__ #ifndef __SVTTENG_H__
#define __SVTTENG_H__ #define __SVTTENG_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
#include FT_MODULE_H #include FT_MODULE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* /*
* SFNT table loading service. * SFNT table loading service.
*/ */
#define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine" #define FT_SERVICE_ID_TRUETYPE_ENGINE "truetype-engine"
/* /*
* Used to implement FT_Get_TrueType_Engine_Type * Used to implement FT_Get_TrueType_Engine_Type
*/ */
FT_DEFINE_SERVICE( TrueTypeEngine ) FT_DEFINE_SERVICE( TrueTypeEngine )
{ {
FT_TrueTypeEngineType engine_type; FT_TrueTypeEngineType engine_type;
}; };
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVTTENG_H__ */ #endif /* __SVTTENG_H__ */
/* END */ /* END */

View file

@ -1,67 +1,67 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svttglyf.h */ /* svttglyf.h */
/* */ /* */
/* The FreeType TrueType glyph service. */ /* The FreeType TrueType glyph service. */
/* */ /* */
/* Copyright 2007 by David Turner. */ /* Copyright 2007 by David Turner. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVTTGLYF_H__ #ifndef __SVTTGLYF_H__
#define __SVTTGLYF_H__ #define __SVTTGLYF_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
#include FT_TRUETYPE_TABLES_H #include FT_TRUETYPE_TABLES_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_TT_GLYF "tt-glyf" #define FT_SERVICE_ID_TT_GLYF "tt-glyf"
typedef FT_ULong typedef FT_ULong
(*TT_Glyf_GetLocationFunc)( FT_Face face, (*TT_Glyf_GetLocationFunc)( FT_Face face,
FT_UInt gindex, FT_UInt gindex,
FT_ULong *psize ); FT_ULong *psize );
FT_DEFINE_SERVICE( TTGlyf ) FT_DEFINE_SERVICE( TTGlyf )
{ {
TT_Glyf_GetLocationFunc get_location; TT_Glyf_GetLocationFunc get_location;
}; };
#ifndef FT_CONFIG_OPTION_PIC #ifndef FT_CONFIG_OPTION_PIC
#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \ #define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \
static const FT_Service_TTGlyfRec class_ = \ static const FT_Service_TTGlyfRec class_ = \
{ \ { \
get_location_ \ get_location_ \
}; };
#else /* FT_CONFIG_OPTION_PIC */ #else /* FT_CONFIG_OPTION_PIC */
#define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \ #define FT_DEFINE_SERVICE_TTGLYFREC(class_, get_location_ ) \
void \ void \
FT_Init_Class_##class_( FT_Service_TTGlyfRec* clazz ) \ FT_Init_Class_##class_( FT_Service_TTGlyfRec* clazz ) \
{ \ { \
clazz->get_location = get_location_; \ clazz->get_location = get_location_; \
} }
#endif /* FT_CONFIG_OPTION_PIC */ #endif /* FT_CONFIG_OPTION_PIC */
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVTTGLYF_H__ */ #endif /* __SVTTGLYF_H__ */
/* END */ /* END */

View file

@ -1,50 +1,50 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svwinfnt.h */ /* svwinfnt.h */
/* */ /* */
/* The FreeType Windows FNT/FONT service (specification). */ /* The FreeType Windows FNT/FONT service (specification). */
/* */ /* */
/* Copyright 2003 by */ /* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVWINFNT_H__ #ifndef __SVWINFNT_H__
#define __SVWINFNT_H__ #define __SVWINFNT_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
#include FT_WINFONTS_H #include FT_WINFONTS_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define FT_SERVICE_ID_WINFNT "winfonts" #define FT_SERVICE_ID_WINFNT "winfonts"
typedef FT_Error typedef FT_Error
(*FT_WinFnt_GetHeaderFunc)( FT_Face face, (*FT_WinFnt_GetHeaderFunc)( FT_Face face,
FT_WinFNT_HeaderRec *aheader ); FT_WinFNT_HeaderRec *aheader );
FT_DEFINE_SERVICE( WinFnt ) FT_DEFINE_SERVICE( WinFnt )
{ {
FT_WinFnt_GetHeaderFunc get_header; FT_WinFnt_GetHeaderFunc get_header;
}; };
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVWINFNT_H__ */ #endif /* __SVWINFNT_H__ */
/* END */ /* END */

View file

@ -1,55 +1,55 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* svxf86nm.h */ /* svxf86nm.h */
/* */ /* */
/* The FreeType XFree86 services (specification only). */ /* The FreeType XFree86 services (specification only). */
/* */ /* */
/* Copyright 2003 by */ /* Copyright 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __SVXF86NM_H__ #ifndef __SVXF86NM_H__
#define __SVXF86NM_H__ #define __SVXF86NM_H__
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/* /*
* A trivial service used to return the name of a face's font driver, * A trivial service used to return the name of a face's font driver,
* according to the XFree86 nomenclature. Note that the service data * according to the XFree86 nomenclature. Note that the service data
* is a simple constant string pointer. * is a simple constant string pointer.
*/ */
#define FT_SERVICE_ID_XF86_NAME "xf86-driver-name" #define FT_SERVICE_ID_XF86_NAME "xf86-driver-name"
#define FT_XF86_FORMAT_TRUETYPE "TrueType" #define FT_XF86_FORMAT_TRUETYPE "TrueType"
#define FT_XF86_FORMAT_TYPE_1 "Type 1" #define FT_XF86_FORMAT_TYPE_1 "Type 1"
#define FT_XF86_FORMAT_BDF "BDF" #define FT_XF86_FORMAT_BDF "BDF"
#define FT_XF86_FORMAT_PCF "PCF" #define FT_XF86_FORMAT_PCF "PCF"
#define FT_XF86_FORMAT_TYPE_42 "Type 42" #define FT_XF86_FORMAT_TYPE_42 "Type 42"
#define FT_XF86_FORMAT_CID "CID Type 1" #define FT_XF86_FORMAT_CID "CID Type 1"
#define FT_XF86_FORMAT_CFF "CFF" #define FT_XF86_FORMAT_CFF "CFF"
#define FT_XF86_FORMAT_PFR "PFR" #define FT_XF86_FORMAT_PFR "PFR"
#define FT_XF86_FORMAT_WINFNT "Windows FNT" #define FT_XF86_FORMAT_WINFNT "Windows FNT"
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __SVXF86NM_H__ */ #endif /* __SVXF86NM_H__ */
/* END */ /* END */

File diff suppressed because it is too large Load diff

View file

@ -1,270 +1,259 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* t1types.h */ /* t1types.h */
/* */ /* */
/* Basic Type1/Type2 type definitions and interface (specification */ /* Basic Type1/Type2 type definitions and interface (specification */
/* only). */ /* only). */
/* */ /* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2006, 2008, 2009 by */ /* Copyright 1996-2004, 2006, 2008, 2009, 2011 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __T1TYPES_H__ #ifndef __T1TYPES_H__
#define __T1TYPES_H__ #define __T1TYPES_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_TYPE1_TABLES_H #include FT_TYPE1_TABLES_H
#include FT_INTERNAL_POSTSCRIPT_HINTS_H #include FT_INTERNAL_POSTSCRIPT_HINTS_H
#include FT_INTERNAL_SERVICE_H #include FT_INTERNAL_SERVICE_H
#include FT_SERVICE_POSTSCRIPT_CMAPS_H #include FT_SERVICE_POSTSCRIPT_CMAPS_H
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*** ***/ /*** ***/
/*** ***/ /*** ***/
/*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/ /*** REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS ***/
/*** ***/ /*** ***/
/*** ***/ /*** ***/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* <Struct> */ /* <Struct> */
/* T1_EncodingRec */ /* T1_EncodingRec */
/* */ /* */
/* <Description> */ /* <Description> */
/* A structure modeling a custom encoding. */ /* A structure modeling a custom encoding. */
/* */ /* */
/* <Fields> */ /* <Fields> */
/* num_chars :: The number of character codes in the encoding. */ /* num_chars :: The number of character codes in the encoding. */
/* Usually 256. */ /* Usually 256. */
/* */ /* */
/* code_first :: The lowest valid character code in the encoding. */ /* code_first :: The lowest valid character code in the encoding. */
/* */ /* */
/* code_last :: The highest valid character code in the encoding */ /* code_last :: The highest valid character code in the encoding */
/* + 1. When equal to code_first there are no valid */ /* + 1. When equal to code_first there are no valid */
/* character codes. */ /* character codes. */
/* */ /* */
/* char_index :: An array of corresponding glyph indices. */ /* char_index :: An array of corresponding glyph indices. */
/* */ /* */
/* char_name :: An array of corresponding glyph names. */ /* char_name :: An array of corresponding glyph names. */
/* */ /* */
typedef struct T1_EncodingRecRec_ typedef struct T1_EncodingRecRec_
{ {
FT_Int num_chars; FT_Int num_chars;
FT_Int code_first; FT_Int code_first;
FT_Int code_last; FT_Int code_last;
FT_UShort* char_index; FT_UShort* char_index;
FT_String** char_name; FT_String** char_name;
} T1_EncodingRec, *T1_Encoding; } T1_EncodingRec, *T1_Encoding;
typedef enum T1_EncodingType_ /* used to hold extra data of PS_FontInfoRec that
{ * cannot be stored in the publicly defined structure.
T1_ENCODING_TYPE_NONE = 0, *
T1_ENCODING_TYPE_ARRAY, * Note these can't be blended with multiple-masters.
T1_ENCODING_TYPE_STANDARD, */
T1_ENCODING_TYPE_ISOLATIN1, typedef struct PS_FontExtraRec_
T1_ENCODING_TYPE_EXPERT {
FT_UShort fs_type;
} T1_EncodingType;
} PS_FontExtraRec;
/* used to hold extra data of PS_FontInfoRec that
* cannot be stored in the publicly defined structure. typedef struct T1_FontRec_
* {
* Note these can't be blended with multiple-masters. PS_FontInfoRec font_info; /* font info dictionary */
*/ PS_FontExtraRec font_extra; /* font info extra fields */
typedef struct PS_FontExtraRec_ PS_PrivateRec private_dict; /* private dictionary */
{ FT_String* font_name; /* top-level dictionary */
FT_UShort fs_type;
T1_EncodingType encoding_type;
} PS_FontExtraRec; T1_EncodingRec encoding;
FT_Byte* subrs_block;
typedef struct T1_FontRec_ FT_Byte* charstrings_block;
{ FT_Byte* glyph_names_block;
PS_FontInfoRec font_info; /* font info dictionary */
PS_FontExtraRec font_extra; /* font info extra fields */ FT_Int num_subrs;
PS_PrivateRec private_dict; /* private dictionary */ FT_Byte** subrs;
FT_String* font_name; /* top-level dictionary */ FT_PtrDist* subrs_len;
T1_EncodingType encoding_type; FT_Int num_glyphs;
T1_EncodingRec encoding; FT_String** glyph_names; /* array of glyph names */
FT_Byte** charstrings; /* array of glyph charstrings */
FT_Byte* subrs_block; FT_PtrDist* charstrings_len;
FT_Byte* charstrings_block;
FT_Byte* glyph_names_block; FT_Byte paint_type;
FT_Byte font_type;
FT_Int num_subrs; FT_Matrix font_matrix;
FT_Byte** subrs; FT_Vector font_offset;
FT_PtrDist* subrs_len; FT_BBox font_bbox;
FT_Long font_id;
FT_Int num_glyphs;
FT_String** glyph_names; /* array of glyph names */ FT_Fixed stroke_width;
FT_Byte** charstrings; /* array of glyph charstrings */
FT_PtrDist* charstrings_len; } T1_FontRec, *T1_Font;
FT_Byte paint_type;
FT_Byte font_type; typedef struct CID_SubrsRec_
FT_Matrix font_matrix; {
FT_Vector font_offset; FT_UInt num_subrs;
FT_BBox font_bbox; FT_Byte** code;
FT_Long font_id;
} CID_SubrsRec, *CID_Subrs;
FT_Fixed stroke_width;
} T1_FontRec, *T1_Font; /*************************************************************************/
/*************************************************************************/
/*************************************************************************/
typedef struct CID_SubrsRec_ /*** ***/
{ /*** ***/
FT_UInt num_subrs; /*** AFM FONT INFORMATION STRUCTURES ***/
FT_Byte** code; /*** ***/
/*** ***/
} CID_SubrsRec, *CID_Subrs; /*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/ typedef struct AFM_TrackKernRec_
/*************************************************************************/ {
/*** ***/ FT_Int degree;
/*** ***/ FT_Fixed min_ptsize;
/*** AFM FONT INFORMATION STRUCTURES ***/ FT_Fixed min_kern;
/*** ***/ FT_Fixed max_ptsize;
/*** ***/ FT_Fixed max_kern;
/*************************************************************************/
/*************************************************************************/ } AFM_TrackKernRec, *AFM_TrackKern;
/*************************************************************************/
typedef struct AFM_KernPairRec_
typedef struct AFM_TrackKernRec_ {
{ FT_Int index1;
FT_Int degree; FT_Int index2;
FT_Fixed min_ptsize; FT_Int x;
FT_Fixed min_kern; FT_Int y;
FT_Fixed max_ptsize;
FT_Fixed max_kern; } AFM_KernPairRec, *AFM_KernPair;
} AFM_TrackKernRec, *AFM_TrackKern; typedef struct AFM_FontInfoRec_
{
typedef struct AFM_KernPairRec_ FT_Bool IsCIDFont;
{ FT_BBox FontBBox;
FT_Int index1; FT_Fixed Ascender;
FT_Int index2; FT_Fixed Descender;
FT_Int x; AFM_TrackKern TrackKerns; /* free if non-NULL */
FT_Int y; FT_Int NumTrackKern;
AFM_KernPair KernPairs; /* free if non-NULL */
} AFM_KernPairRec, *AFM_KernPair; FT_Int NumKernPair;
typedef struct AFM_FontInfoRec_ } AFM_FontInfoRec, *AFM_FontInfo;
{
FT_Bool IsCIDFont;
FT_BBox FontBBox; /*************************************************************************/
FT_Fixed Ascender; /*************************************************************************/
FT_Fixed Descender; /*************************************************************************/
AFM_TrackKern TrackKerns; /* free if non-NULL */ /*** ***/
FT_Int NumTrackKern; /*** ***/
AFM_KernPair KernPairs; /* free if non-NULL */ /*** ORIGINAL T1_FACE CLASS DEFINITION ***/
FT_Int NumKernPair; /*** ***/
/*** ***/
} AFM_FontInfoRec, *AFM_FontInfo; /*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/ typedef struct T1_FaceRec_* T1_Face;
/*** ***/ typedef struct CID_FaceRec_* CID_Face;
/*** ***/
/*** ORIGINAL T1_FACE CLASS DEFINITION ***/
/*** ***/ typedef struct T1_FaceRec_
/*** ***/ {
/*************************************************************************/ FT_FaceRec root;
/*************************************************************************/ T1_FontRec type1;
/*************************************************************************/ const void* psnames;
const void* psaux;
const void* afm_data;
typedef struct T1_FaceRec_* T1_Face; FT_CharMapRec charmaprecs[2];
typedef struct CID_FaceRec_* CID_Face; FT_CharMap charmaps[2];
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
typedef struct T1_FaceRec_ PS_Unicodes unicode_map;
{ #endif
FT_FaceRec root;
T1_FontRec type1; /* support for Multiple Masters fonts */
const void* psnames; PS_Blend blend;
const void* psaux;
const void* afm_data; /* undocumented, optional: indices of subroutines that express */
FT_CharMapRec charmaprecs[2]; /* the NormalizeDesignVector and the ConvertDesignVector procedure, */
FT_CharMap charmaps[2]; /* respectively, as Type 2 charstrings; -1 if keywords not present */
FT_Int ndv_idx;
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS FT_Int cdv_idx;
PS_Unicodes unicode_map;
#endif /* undocumented, optional: has the same meaning as len_buildchar */
/* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */
/* support for Multiple Masters fonts */ FT_UInt len_buildchar;
PS_Blend blend; FT_Long* buildchar;
/* undocumented, optional: indices of subroutines that express */ /* since version 2.1 - interface to PostScript hinter */
/* the NormalizeDesignVector and the ConvertDesignVector procedure, */ const void* pshinter;
/* respectively, as Type 2 charstrings; -1 if keywords not present */
FT_Int ndv_idx; } T1_FaceRec;
FT_Int cdv_idx;
/* undocumented, optional: has the same meaning as len_buildchar */ typedef struct CID_FaceRec_
/* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */ {
FT_UInt len_buildchar; FT_FaceRec root;
FT_Long* buildchar; void* psnames;
void* psaux;
/* since version 2.1 - interface to PostScript hinter */ CID_FaceInfoRec cid;
const void* pshinter; PS_FontExtraRec font_extra;
#if 0
} T1_FaceRec; void* afm_data;
#endif
CID_Subrs subrs;
typedef struct CID_FaceRec_
{ /* since version 2.1 - interface to PostScript hinter */
FT_FaceRec root; void* pshinter;
void* psnames;
void* psaux; /* since version 2.1.8, but was originally positioned after `afm_data' */
CID_FaceInfoRec cid; FT_Byte* binary_data; /* used if hex data has been converted */
PS_FontExtraRec font_extra; FT_Stream cid_stream;
#if 0
void* afm_data; } CID_FaceRec;
#endif
CID_Subrs subrs;
FT_END_HEADER
/* since version 2.1 - interface to PostScript hinter */
void* pshinter; #endif /* __T1TYPES_H__ */
/* since version 2.1.8, but was originally positioned after `afm_data' */
FT_Byte* binary_data; /* used if hex data has been converted */ /* END */
FT_Stream cid_stream;
} CID_FaceRec;
FT_END_HEADER
#endif /* __T1TYPES_H__ */
/* END */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,107 +1,107 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* tttags.h */ /* tttags.h */
/* */ /* */
/* Tags for TrueType and OpenType tables (specification only). */ /* Tags for TrueType and OpenType tables (specification only). */
/* */ /* */
/* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */ /* Copyright 1996-2001, 2004, 2005, 2007, 2008 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __TTAGS_H__ #ifndef __TTAGS_H__
#define __TTAGS_H__ #define __TTAGS_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
#define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' ) #define TTAG_avar FT_MAKE_TAG( 'a', 'v', 'a', 'r' )
#define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' ) #define TTAG_BASE FT_MAKE_TAG( 'B', 'A', 'S', 'E' )
#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' ) #define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' )
#define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' ) #define TTAG_BDF FT_MAKE_TAG( 'B', 'D', 'F', ' ' )
#define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' ) #define TTAG_bhed FT_MAKE_TAG( 'b', 'h', 'e', 'd' )
#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) #define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' )
#define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' ) #define TTAG_bsln FT_MAKE_TAG( 'b', 's', 'l', 'n' )
#define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' )
#define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' ) #define TTAG_CID FT_MAKE_TAG( 'C', 'I', 'D', ' ' )
#define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' ) #define TTAG_cmap FT_MAKE_TAG( 'c', 'm', 'a', 'p' )
#define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' ) #define TTAG_cvar FT_MAKE_TAG( 'c', 'v', 'a', 'r' )
#define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' )
#define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) #define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' )
#define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) #define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' )
#define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) #define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' )
#define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) #define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' )
#define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' ) #define TTAG_feat FT_MAKE_TAG( 'f', 'e', 'a', 't' )
#define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' ) #define TTAG_FOND FT_MAKE_TAG( 'F', 'O', 'N', 'D' )
#define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' ) #define TTAG_fpgm FT_MAKE_TAG( 'f', 'p', 'g', 'm' )
#define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' ) #define TTAG_fvar FT_MAKE_TAG( 'f', 'v', 'a', 'r' )
#define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' ) #define TTAG_gasp FT_MAKE_TAG( 'g', 'a', 's', 'p' )
#define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' ) #define TTAG_GDEF FT_MAKE_TAG( 'G', 'D', 'E', 'F' )
#define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' ) #define TTAG_glyf FT_MAKE_TAG( 'g', 'l', 'y', 'f' )
#define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' ) #define TTAG_GPOS FT_MAKE_TAG( 'G', 'P', 'O', 'S' )
#define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' ) #define TTAG_GSUB FT_MAKE_TAG( 'G', 'S', 'U', 'B' )
#define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' ) #define TTAG_gvar FT_MAKE_TAG( 'g', 'v', 'a', 'r' )
#define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' ) #define TTAG_hdmx FT_MAKE_TAG( 'h', 'd', 'm', 'x' )
#define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' ) #define TTAG_head FT_MAKE_TAG( 'h', 'e', 'a', 'd' )
#define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' ) #define TTAG_hhea FT_MAKE_TAG( 'h', 'h', 'e', 'a' )
#define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' ) #define TTAG_hmtx FT_MAKE_TAG( 'h', 'm', 't', 'x' )
#define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' ) #define TTAG_JSTF FT_MAKE_TAG( 'J', 'S', 'T', 'F' )
#define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' ) #define TTAG_just FT_MAKE_TAG( 'j', 'u', 's', 't' )
#define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' ) #define TTAG_kern FT_MAKE_TAG( 'k', 'e', 'r', 'n' )
#define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' ) #define TTAG_lcar FT_MAKE_TAG( 'l', 'c', 'a', 'r' )
#define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' ) #define TTAG_loca FT_MAKE_TAG( 'l', 'o', 'c', 'a' )
#define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' ) #define TTAG_LTSH FT_MAKE_TAG( 'L', 'T', 'S', 'H' )
#define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' ) #define TTAG_LWFN FT_MAKE_TAG( 'L', 'W', 'F', 'N' )
#define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' ) #define TTAG_MATH FT_MAKE_TAG( 'M', 'A', 'T', 'H' )
#define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' ) #define TTAG_maxp FT_MAKE_TAG( 'm', 'a', 'x', 'p' )
#define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' ) #define TTAG_META FT_MAKE_TAG( 'M', 'E', 'T', 'A' )
#define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' ) #define TTAG_MMFX FT_MAKE_TAG( 'M', 'M', 'F', 'X' )
#define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' ) #define TTAG_MMSD FT_MAKE_TAG( 'M', 'M', 'S', 'D' )
#define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' ) #define TTAG_mort FT_MAKE_TAG( 'm', 'o', 'r', 't' )
#define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' ) #define TTAG_morx FT_MAKE_TAG( 'm', 'o', 'r', 'x' )
#define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' ) #define TTAG_name FT_MAKE_TAG( 'n', 'a', 'm', 'e' )
#define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' ) #define TTAG_opbd FT_MAKE_TAG( 'o', 'p', 'b', 'd' )
#define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' ) #define TTAG_OS2 FT_MAKE_TAG( 'O', 'S', '/', '2' )
#define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' ) #define TTAG_OTTO FT_MAKE_TAG( 'O', 'T', 'T', 'O' )
#define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' ) #define TTAG_PCLT FT_MAKE_TAG( 'P', 'C', 'L', 'T' )
#define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' ) #define TTAG_POST FT_MAKE_TAG( 'P', 'O', 'S', 'T' )
#define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) #define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' )
#define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) #define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' )
#define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) #define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' )
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' ) #define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) #define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) #define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' ) #define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' ) #define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
#define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' ) #define TTAG_ttcf FT_MAKE_TAG( 't', 't', 'c', 'f' )
#define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' ) #define TTAG_TYP1 FT_MAKE_TAG( 'T', 'Y', 'P', '1' )
#define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' ) #define TTAG_typ1 FT_MAKE_TAG( 't', 'y', 'p', '1' )
#define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) #define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' )
#define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' )
#define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' )
FT_END_HEADER FT_END_HEADER
#endif /* __TTAGS_H__ */ #endif /* __TTAGS_H__ */
/* END */ /* END */

View file

@ -1,59 +1,59 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ttunpat.h */ /* ttunpat.h */
/* */ /* */
/* Definitions for the unpatented TrueType hinting system */ /* Definitions for the unpatented TrueType hinting system */
/* */ /* */
/* Copyright 2003, 2006 by */ /* Copyright 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* Written by Graham Asher <graham.asher@btinternet.com> */ /* Written by Graham Asher <graham.asher@btinternet.com> */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef __TTUNPAT_H__ #ifndef __TTUNPAT_H__
#define __TTUNPAT_H__ #define __TTUNPAT_H__
#include <ft2build.h> #include <ft2build.h>
#include FT_FREETYPE_H #include FT_FREETYPE_H
#ifdef FREETYPE_H #ifdef FREETYPE_H
#error "freetype.h of FreeType 1 has been loaded!" #error "freetype.h of FreeType 1 has been loaded!"
#error "Please fix the directory search order for header files" #error "Please fix the directory search order for header files"
#error "so that freetype.h of FreeType 2 is found first." #error "so that freetype.h of FreeType 2 is found first."
#endif #endif
FT_BEGIN_HEADER FT_BEGIN_HEADER
/*************************************************************************** /***************************************************************************
* *
* @constant: * @constant:
* FT_PARAM_TAG_UNPATENTED_HINTING * FT_PARAM_TAG_UNPATENTED_HINTING
* *
* @description: * @description:
* A constant used as the tag of an @FT_Parameter structure to indicate * A constant used as the tag of an @FT_Parameter structure to indicate
* that unpatented methods only should be used by the TrueType bytecode * that unpatented methods only should be used by the TrueType bytecode
* interpreter for a typeface opened by @FT_Open_Face. * interpreter for a typeface opened by @FT_Open_Face.
* *
*/ */
#define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' ) #define FT_PARAM_TAG_UNPATENTED_HINTING FT_MAKE_TAG( 'u', 'n', 'p', 'a' )
/* */ /* */
FT_END_HEADER FT_END_HEADER
#endif /* __TTUNPAT_H__ */ #endif /* __TTUNPAT_H__ */
/* END */ /* END */

View file

@ -1,39 +1,39 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* ft2build.h */ /* ft2build.h */
/* */ /* */
/* FreeType 2 build and setup macros. */ /* FreeType 2 build and setup macros. */
/* (Generic version) */ /* (Generic version) */
/* */ /* */
/* Copyright 1996-2001, 2006 by */ /* Copyright 1996-2001, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This file corresponds to the default `ft2build.h' file for */ /* This file corresponds to the default `ft2build.h' file for */
/* FreeType 2. It uses the `freetype' include root. */ /* FreeType 2. It uses the `freetype' include root. */
/* */ /* */
/* Note that specific platforms might use a different configuration. */ /* Note that specific platforms might use a different configuration. */
/* See builds/unix/ft2unix.h for an example. */ /* See builds/unix/ft2unix.h for an example. */
/* */ /* */
/*************************************************************************/ /*************************************************************************/
#ifndef __FT2_BUILD_GENERIC_H__ #ifndef __FT2_BUILD_GENERIC_H__
#define __FT2_BUILD_GENERIC_H__ #define __FT2_BUILD_GENERIC_H__
#include <freetype/config/ftheader.h> #include <freetype/config/ftheader.h>
#endif /* __FT2_BUILD_GENERIC_H__ */ #endif /* __FT2_BUILD_GENERIC_H__ */
/* END */ /* END */

Binary file not shown.

Binary file not shown.