2018-06-03 22:00:42 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* ftmodapi.h
|
|
|
|
*
|
|
|
|
* FreeType modules public interface (specification).
|
|
|
|
*
|
2019-02-23 10:07:09 +01:00
|
|
|
* Copyright (C) 1996-2019 by
|
2018-06-03 22:00:42 +02:00
|
|
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef FTMODAPI_H_
|
|
|
|
#define FTMODAPI_H_
|
2003-10-05 11:55:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
2003-11-04 08:44:19 +01:00
|
|
|
#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
|
|
|
|
|
2003-10-05 11:55:58 +02:00
|
|
|
|
|
|
|
FT_BEGIN_HEADER
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @section:
|
2018-06-03 22:00:42 +02:00
|
|
|
* module_management
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @title:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Module Management
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @abstract:
|
2018-06-03 22:00:42 +02:00
|
|
|
* How to add, upgrade, remove, and control modules from FreeType.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* The definitions below are used to manage modules within FreeType.
|
2018-08-24 18:52:30 +02:00
|
|
|
* Modules can be added, upgraded, and removed at runtime. Additionally,
|
|
|
|
* some module properties can be controlled also.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* Here is a list of possible values of the `module_name` field in the
|
|
|
|
* @FT_Module_Class structure.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
* autofitter
|
|
|
|
* bdf
|
|
|
|
* cff
|
|
|
|
* gxvalid
|
|
|
|
* otvalid
|
|
|
|
* pcf
|
|
|
|
* pfr
|
|
|
|
* psaux
|
|
|
|
* pshinter
|
|
|
|
* psnames
|
|
|
|
* raster1
|
|
|
|
* sfnt
|
|
|
|
* smooth, smooth-lcd, smooth-lcdv
|
|
|
|
* truetype
|
|
|
|
* type1
|
|
|
|
* type42
|
|
|
|
* t1cid
|
|
|
|
* winfonts
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* Note that the FreeType Cache sub-system is not a FreeType module.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @order:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Module
|
|
|
|
* FT_Module_Constructor
|
|
|
|
* FT_Module_Destructor
|
|
|
|
* FT_Module_Requester
|
|
|
|
* FT_Module_Class
|
|
|
|
*
|
|
|
|
* FT_Add_Module
|
|
|
|
* FT_Get_Module
|
|
|
|
* FT_Remove_Module
|
|
|
|
* FT_Add_Default_Modules
|
|
|
|
*
|
|
|
|
* FT_Property_Set
|
|
|
|
* FT_Property_Get
|
|
|
|
* FT_Set_Default_Properties
|
|
|
|
*
|
|
|
|
* FT_New_Library
|
|
|
|
* FT_Done_Library
|
|
|
|
* FT_Reference_Library
|
|
|
|
*
|
|
|
|
* FT_Renderer
|
|
|
|
* FT_Renderer_Class
|
|
|
|
*
|
|
|
|
* FT_Get_Renderer
|
|
|
|
* FT_Set_Renderer
|
|
|
|
*
|
|
|
|
* FT_Set_Debug_Hook
|
|
|
|
*
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* module bit flags */
|
|
|
|
#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_HINTER 4 /* this module is a glyph hinter */
|
|
|
|
#define FT_MODULE_STYLER 8 /* this module is a styler */
|
|
|
|
|
2015-11-10 22:33:45 +01:00
|
|
|
#define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */
|
2003-10-05 11:55:58 +02:00
|
|
|
/* scalable fonts */
|
2015-11-10 22:33:45 +01:00
|
|
|
#define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */
|
2003-10-05 11:55:58 +02:00
|
|
|
/* support vector outlines */
|
2015-11-10 22:33:45 +01:00
|
|
|
#define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */
|
2003-10-05 11:55:58 +02:00
|
|
|
/* own hinter */
|
2015-11-10 22:33:45 +01:00
|
|
|
#define FT_MODULE_DRIVER_HINTS_LIGHTLY 0x800 /* the driver's hinter */
|
|
|
|
/* produces LIGHT hints */
|
2003-10-05 11:55:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* deprecated values */
|
|
|
|
#define ft_module_font_driver FT_MODULE_FONT_DRIVER
|
|
|
|
#define ft_module_renderer FT_MODULE_RENDERER
|
|
|
|
#define ft_module_hinter FT_MODULE_HINTER
|
|
|
|
#define ft_module_styler FT_MODULE_STYLER
|
|
|
|
|
2015-11-10 22:33:45 +01:00
|
|
|
#define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE
|
|
|
|
#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_hints_lightly FT_MODULE_DRIVER_HINTS_LIGHTLY
|
2003-10-05 11:55:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
typedef FT_Pointer FT_Module_Interface;
|
|
|
|
|
2008-05-31 09:03:30 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @functype:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Module_Constructor
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A function used to initialize (not create) a new module object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* module ::
|
|
|
|
* The module to initialize.
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
typedef FT_Error
|
|
|
|
(*FT_Module_Constructor)( FT_Module module );
|
|
|
|
|
2008-05-31 09:03:30 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @functype:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Module_Destructor
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A function used to finalize (not destroy) a given module object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* module ::
|
|
|
|
* The module to finalize.
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
typedef void
|
|
|
|
(*FT_Module_Destructor)( FT_Module module );
|
|
|
|
|
2008-05-31 09:03:30 +02:00
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @functype:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Module_Requester
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A function used to query a given module for a specific interface.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* module ::
|
|
|
|
* The module to be searched.
|
|
|
|
*
|
|
|
|
* name ::
|
|
|
|
* The name of the interface in the module.
|
|
|
|
*/
|
2006-02-21 23:36:23 +01:00
|
|
|
typedef FT_Module_Interface
|
2003-10-05 11:55:58 +02:00
|
|
|
(*FT_Module_Requester)( FT_Module module,
|
|
|
|
const char* name );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @struct:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Module_Class
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* The module class descriptor. While being a public structure necessary
|
|
|
|
* for FreeType's module bookkeeping, most of the fields are essentially
|
|
|
|
* internal, not to be used directly by an application.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @fields:
|
2018-06-03 22:00:42 +02:00
|
|
|
* module_flags ::
|
|
|
|
* Bit flags describing the module.
|
|
|
|
*
|
|
|
|
* module_size ::
|
2018-07-26 07:22:18 +02:00
|
|
|
* The size of one module object/instance in bytes.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* module_name ::
|
|
|
|
* The name of the module.
|
|
|
|
*
|
|
|
|
* module_version ::
|
2018-07-26 07:22:18 +02:00
|
|
|
* The version, as a 16.16 fixed number (major.minor).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* module_requires ::
|
2018-07-26 07:22:18 +02:00
|
|
|
* The version of FreeType this module requires, as a 16.16 fixed
|
|
|
|
* number (major.minor). Starts at version 2.0, i.e., 0x20000.
|
|
|
|
*
|
|
|
|
* module_interface ::
|
|
|
|
* A typeless pointer to a structure (which varies between different
|
|
|
|
* modules) that holds the module's interface functions. This is
|
2018-08-24 18:52:30 +02:00
|
|
|
* essentially what `get_interface` returns.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* module_init ::
|
|
|
|
* The initializing function.
|
|
|
|
*
|
|
|
|
* module_done ::
|
|
|
|
* The finalizing function.
|
|
|
|
*
|
|
|
|
* get_interface ::
|
|
|
|
* The interface requesting function.
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
typedef struct FT_Module_Class_
|
|
|
|
{
|
|
|
|
FT_ULong module_flags;
|
|
|
|
FT_Long module_size;
|
|
|
|
const FT_String* module_name;
|
|
|
|
FT_Fixed module_version;
|
|
|
|
FT_Fixed module_requires;
|
|
|
|
|
|
|
|
const void* module_interface;
|
|
|
|
|
|
|
|
FT_Module_Constructor module_init;
|
|
|
|
FT_Module_Destructor module_done;
|
|
|
|
FT_Module_Requester get_interface;
|
|
|
|
|
|
|
|
} FT_Module_Class;
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Add_Module
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Add a new module to a given library instance.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to the library object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* clazz ::
|
|
|
|
* A pointer to class descriptor for the module.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* 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.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Add_Module( FT_Library library,
|
|
|
|
const FT_Module_Class* clazz );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Get_Module
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Find a module by its name.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to the library object.
|
|
|
|
*
|
|
|
|
* module_name ::
|
|
|
|
* The module's name (as an ASCII string).
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* A module handle. 0~if none was found.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType's internal modules aren't documented very well, and you
|
|
|
|
* should look up the source code for details.
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
FT_EXPORT( FT_Module )
|
|
|
|
FT_Get_Module( FT_Library library,
|
|
|
|
const char* module_name );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Remove_Module
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Remove a given module from a library instance.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to a library object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* module ::
|
|
|
|
* A handle to a module object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-06-03 22:00:42 +02:00
|
|
|
* The module object is destroyed by the function in case of success.
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Remove_Module( FT_Library library,
|
|
|
|
FT_Module module );
|
|
|
|
|
|
|
|
|
2018-09-04 08:00:58 +02:00
|
|
|
/**************************************************************************
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* @function:
|
|
|
|
* FT_Property_Set
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* Set a property for a given module.
|
|
|
|
*
|
|
|
|
* @input:
|
|
|
|
* library ::
|
2018-06-03 22:00:42 +02:00
|
|
|
* A handle to the library the module is part of.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* module_name ::
|
2018-06-03 22:00:42 +02:00
|
|
|
* The module name.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* property_name ::
|
2018-06-03 22:00:42 +02:00
|
|
|
* The property name. Properties are described in section
|
|
|
|
* @properties.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
2018-06-03 22:00:42 +02:00
|
|
|
* Note that only a few modules have properties.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* value ::
|
2018-06-03 22:00:42 +02:00
|
|
|
* A generic pointer to a variable or structure that gives the new
|
2018-09-04 10:37:44 +02:00
|
|
|
* value of the property. The exact definition of `value` is
|
2018-06-03 22:00:42 +02:00
|
|
|
* dependent on the property; see section @properties.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* @return:
|
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* If `module_name` isn't a valid module name, or `property_name`
|
2018-09-04 10:37:44 +02:00
|
|
|
* doesn't specify a valid property, or if `value` doesn't represent a
|
2012-08-30 23:31:55 +02:00
|
|
|
* valid value for the given property, an error is returned.
|
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* The following example sets property 'bar' (a simple integer) in
|
|
|
|
* module 'foo' to value~1.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2012-08-30 23:31:55 +02:00
|
|
|
* FT_UInt bar;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* bar = 1;
|
|
|
|
* FT_Property_Set( library, "foo", "bar", &bar );
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
2013-06-09 08:48:01 +02:00
|
|
|
* Note that the FreeType Cache sub-system doesn't recognize module
|
|
|
|
* property changes. To avoid glyph lookup confusion within the cache
|
2018-08-24 18:52:30 +02:00
|
|
|
* you should call @FTC_Manager_Reset to completely flush the cache if a
|
|
|
|
* module property gets changed after @FTC_Manager_New has been called.
|
2013-06-09 08:48:01 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* It is not possible to set properties of the FreeType Cache sub-system
|
|
|
|
* itself with FT_Property_Set; use @FTC_Property_Set instead.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @since:
|
|
|
|
* 2.4.11
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
*/
|
2013-05-12 06:00:27 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2012-08-30 23:31:55 +02:00
|
|
|
FT_Property_Set( FT_Library library,
|
|
|
|
const FT_String* module_name,
|
|
|
|
const FT_String* property_name,
|
|
|
|
const void* value );
|
|
|
|
|
|
|
|
|
2018-09-04 08:00:58 +02:00
|
|
|
/**************************************************************************
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* @function:
|
|
|
|
* FT_Property_Get
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* Get a module's property value.
|
|
|
|
*
|
|
|
|
* @input:
|
|
|
|
* library ::
|
2018-06-03 22:00:42 +02:00
|
|
|
* A handle to the library the module is part of.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* module_name ::
|
2018-06-03 22:00:42 +02:00
|
|
|
* The module name.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* property_name ::
|
2018-06-03 22:00:42 +02:00
|
|
|
* The property name. Properties are described in section
|
|
|
|
* @properties.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* @inout:
|
|
|
|
* value ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* A generic pointer to a variable or structure that gives the value
|
2018-09-04 10:37:44 +02:00
|
|
|
* of the property. The exact definition of `value` is dependent on
|
2018-08-24 18:52:30 +02:00
|
|
|
* the property; see section @properties.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* @return:
|
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
|
|
|
* @note:
|
2018-08-24 18:52:30 +02:00
|
|
|
* If `module_name` isn't a valid module name, or `property_name`
|
2018-09-04 10:37:44 +02:00
|
|
|
* doesn't specify a valid property, or if `value` doesn't represent a
|
2012-08-30 23:31:55 +02:00
|
|
|
* valid value for the given property, an error is returned.
|
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* The following example gets property 'baz' (a range) in module 'foo'.
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2012-08-30 23:31:55 +02:00
|
|
|
* typedef range_
|
|
|
|
* {
|
|
|
|
* FT_Int32 min;
|
|
|
|
* FT_Int32 max;
|
|
|
|
*
|
|
|
|
* } range;
|
|
|
|
*
|
|
|
|
* range baz;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* FT_Property_Get( library, "foo", "baz", &baz );
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
* It is not possible to retrieve properties of the FreeType Cache
|
|
|
|
* sub-system with FT_Property_Get; use @FTC_Property_Get instead.
|
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @since:
|
|
|
|
* 2.4.11
|
2012-08-30 23:31:55 +02:00
|
|
|
*
|
|
|
|
*/
|
2013-05-12 06:00:27 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
2012-08-30 23:31:55 +02:00
|
|
|
FT_Property_Get( FT_Library library,
|
|
|
|
const FT_String* module_name,
|
|
|
|
const FT_String* property_name,
|
|
|
|
void* value );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Set_Default_Properties
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-09-04 10:37:44 +02:00
|
|
|
* If compilation option `FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES` is
|
|
|
|
* set, this function reads the `FREETYPE_PROPERTIES` environment
|
|
|
|
* variable to control driver properties. See section @properties for
|
|
|
|
* more.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* If the compilation option is not set, this function does nothing.
|
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* `FREETYPE_PROPERTIES` has the following syntax form (broken here into
|
|
|
|
* multiple lines for better readability).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
* <optional whitespace>
|
|
|
|
* <module-name1> ':'
|
|
|
|
* <property-name1> '=' <property-value1>
|
|
|
|
* <whitespace>
|
|
|
|
* <module-name2> ':'
|
|
|
|
* <property-name2> '=' <property-value2>
|
|
|
|
* ...
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
|
|
|
|
* cff:no-stem-darkening=1 \
|
|
|
|
* autofitter:warping=1
|
2018-08-24 18:52:30 +02:00
|
|
|
* ```
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to a new library object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @since:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 2.8
|
|
|
|
*/
|
2017-01-23 12:53:18 +01:00
|
|
|
FT_EXPORT( void )
|
|
|
|
FT_Set_Default_Properties( FT_Library library );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Reference_Library
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* A counter gets initialized to~1 at the time an @FT_Library structure
|
|
|
|
* is created. This function increments the counter. @FT_Done_Library
|
|
|
|
* then only destroys a library if the counter is~1, otherwise it simply
|
|
|
|
* decrements the counter.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* This function helps in managing life-cycles of structures that
|
|
|
|
* reference @FT_Library objects.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to a target library object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @since:
|
2018-06-03 22:00:42 +02:00
|
|
|
* 2.4.2
|
|
|
|
*/
|
2010-07-18 18:41:47 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Reference_Library( FT_Library library );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_New_Library
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* This function is used to create a new FreeType library instance from a
|
|
|
|
* given memory object. It is thus possible to use libraries with
|
|
|
|
* distinct memory allocators within the same program. Note, however,
|
|
|
|
* that the used @FT_Memory structure is expected to remain valid for the
|
|
|
|
* life of the @FT_Library object.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* Normally, you would call this function (followed by a call to
|
2018-08-24 18:52:30 +02:00
|
|
|
* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module, and a
|
|
|
|
* call to @FT_Set_Default_Properties) instead of @FT_Init_FreeType to
|
|
|
|
* initialize the FreeType library.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-08-24 18:52:30 +02:00
|
|
|
* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a library
|
|
|
|
* instance.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* memory ::
|
|
|
|
* A handle to the original memory object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @output:
|
2018-06-03 22:00:42 +02:00
|
|
|
* alibrary ::
|
|
|
|
* A pointer to handle of a new library object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-06-03 22:00:42 +02:00
|
|
|
* See the discussion of reference counters in the description of
|
|
|
|
* @FT_Reference_Library.
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_New_Library( FT_Memory memory,
|
|
|
|
FT_Library *alibrary );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Done_Library
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* Discard a given library object. This closes all drivers and discards
|
|
|
|
* all resource objects.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to the target library.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @return:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-06-03 22:00:42 +02:00
|
|
|
* See the discussion of reference counters in the description of
|
|
|
|
* @FT_Reference_Library.
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_Done_Library( FT_Library library );
|
|
|
|
|
|
|
|
|
2018-12-12 14:05:03 +01:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @functype:
|
|
|
|
* FT_DebugHook_Func
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* A drop-in replacement (or rather a wrapper) for the bytecode or
|
|
|
|
* charstring interpreter's main loop function.
|
|
|
|
*
|
|
|
|
* Its job is essentially
|
|
|
|
*
|
|
|
|
* - to activate debug mode to enforce single-stepping,
|
2018-12-30 15:32:08 +01:00
|
|
|
*
|
2018-12-12 14:05:03 +01:00
|
|
|
* - to call the main loop function to interpret the next opcode, and
|
2018-12-30 15:32:08 +01:00
|
|
|
*
|
2018-12-12 14:05:03 +01:00
|
|
|
* - to show the changed context to the user.
|
|
|
|
*
|
|
|
|
* An example for such a main loop function is `TT_RunIns` (declared in
|
|
|
|
* FreeType's internal header file `src/truetype/ttinterp.h`).
|
|
|
|
*
|
|
|
|
* Have a look at the source code of the `ttdebug` FreeType demo program
|
|
|
|
* for an example of a drop-in replacement.
|
|
|
|
*
|
|
|
|
* @inout:
|
|
|
|
* arg ::
|
|
|
|
* A typeless pointer, to be cast to the main loop function's data
|
|
|
|
* structure (which depends on the font module). For TrueType fonts
|
|
|
|
* it is bytecode interpreter's execution context, `TT_ExecContext`,
|
|
|
|
* which is declared in FreeType's internal header file `tttypes.h`.
|
|
|
|
*/
|
2019-06-13 04:30:21 +02:00
|
|
|
typedef FT_Error
|
2003-10-05 11:55:58 +02:00
|
|
|
(*FT_DebugHook_Func)( void* arg );
|
|
|
|
|
|
|
|
|
2018-12-12 14:05:03 +01:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @enum:
|
|
|
|
* FT_DEBUG_HOOK_XXX
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* A list of named debug hook indices.
|
|
|
|
*
|
|
|
|
* @values:
|
|
|
|
* FT_DEBUG_HOOK_TRUETYPE::
|
|
|
|
* This hook index identifies the TrueType bytecode debugger.
|
|
|
|
*/
|
|
|
|
#define FT_DEBUG_HOOK_TRUETYPE 0
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Set_Debug_Hook
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-06-03 22:00:42 +02:00
|
|
|
* Set a debug hook function for debugging the interpreter of a font
|
|
|
|
* format.
|
|
|
|
*
|
2018-12-12 14:05:03 +01:00
|
|
|
* While this is a public API function, an application needs access to
|
|
|
|
* FreeType's internal header files to do something useful.
|
|
|
|
*
|
|
|
|
* Have a look at the source code of the `ttdebug` FreeType demo program
|
|
|
|
* for an example of its usage.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to the library object.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @input:
|
2018-06-03 22:00:42 +02:00
|
|
|
* hook_index ::
|
2018-12-12 14:05:03 +01:00
|
|
|
* The index of the debug hook. You should use defined enumeration
|
|
|
|
* macros like @FT_DEBUG_HOOK_TRUETYPE.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
* debug_hook ::
|
|
|
|
* The function used to debug the interpreter.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @note:
|
2018-12-12 14:05:03 +01:00
|
|
|
* Currently, four debug hook slots are available, but only one (for the
|
|
|
|
* TrueType interpreter) is defined.
|
2018-06-03 22:00:42 +02:00
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
FT_EXPORT( void )
|
|
|
|
FT_Set_Debug_Hook( FT_Library library,
|
|
|
|
FT_UInt hook_index,
|
|
|
|
FT_DebugHook_Func debug_hook );
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @function:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_Add_Default_Modules
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* Add the set of default drivers to a given library object. This is
|
|
|
|
* only useful when you create a library object with @FT_New_Library
|
|
|
|
* (usually to plug a custom memory manager).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @inout:
|
2018-06-03 22:00:42 +02:00
|
|
|
* library ::
|
|
|
|
* A handle to a new library object.
|
|
|
|
*/
|
2003-10-05 11:55:58 +02:00
|
|
|
FT_EXPORT( void )
|
|
|
|
FT_Add_Default_Modules( FT_Library library );
|
|
|
|
|
|
|
|
|
2006-05-12 15:55:04 +02:00
|
|
|
|
2006-04-22 14:24:52 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
|
|
|
* @section:
|
2007-04-10 07:13:03 +02:00
|
|
|
* truetype_engine
|
2006-04-22 14:24:52 +02:00
|
|
|
*
|
|
|
|
* @title:
|
|
|
|
* The TrueType Engine
|
|
|
|
*
|
|
|
|
* @abstract:
|
2006-05-12 06:00:44 +02:00
|
|
|
* TrueType bytecode support.
|
2006-04-22 14:24:52 +02:00
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* This section contains a function used to query the level of TrueType
|
|
|
|
* bytecode support compiled in this version of the library.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2006-04-21 10:35:11 +02:00
|
|
|
|
2006-02-22 15:28:06 +01:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @enum:
|
|
|
|
* FT_TrueTypeEngineType
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* A list of values describing which kind of TrueType bytecode engine is
|
|
|
|
* implemented in a given FT_Library instance. It is used by the
|
|
|
|
* @FT_Get_TrueType_Engine_Type function.
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @values:
|
|
|
|
* FT_TRUETYPE_ENGINE_TYPE_NONE ::
|
|
|
|
* The library doesn't implement any kind of bytecode interpreter.
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::
|
|
|
|
* Deprecated and removed.
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* FT_TRUETYPE_ENGINE_TYPE_PATENTED ::
|
2018-08-24 18:52:30 +02:00
|
|
|
* The library implements a bytecode interpreter that covers the full
|
|
|
|
* instruction set of the TrueType virtual machine (this was governed
|
|
|
|
* by patents until May 2010, hence the name).
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @since:
|
|
|
|
* 2.2
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
|
|
|
*/
|
2008-05-29 00:17:28 +02:00
|
|
|
typedef enum FT_TrueTypeEngineType_
|
2006-02-21 23:36:23 +01:00
|
|
|
{
|
|
|
|
FT_TRUETYPE_ENGINE_TYPE_NONE = 0,
|
|
|
|
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,
|
|
|
|
FT_TRUETYPE_ENGINE_TYPE_PATENTED
|
|
|
|
|
|
|
|
} FT_TrueTypeEngineType;
|
|
|
|
|
|
|
|
|
2006-02-22 15:28:06 +01:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @function:
|
|
|
|
* FT_Get_TrueType_Engine_Type
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* Return an @FT_TrueTypeEngineType value to indicate which level of the
|
|
|
|
* TrueType virtual machine a given library instance supports.
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @input:
|
|
|
|
* library ::
|
|
|
|
* A library instance.
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @return:
|
|
|
|
* A value indicating which level is supported.
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
2018-06-17 11:22:37 +02:00
|
|
|
* @since:
|
|
|
|
* 2.2
|
2006-02-22 09:23:35 +01:00
|
|
|
*
|
|
|
|
*/
|
2006-02-21 23:36:23 +01:00
|
|
|
FT_EXPORT( FT_TrueTypeEngineType )
|
|
|
|
FT_Get_TrueType_Engine_Type( FT_Library library );
|
|
|
|
|
2003-10-05 11:55:58 +02:00
|
|
|
/* */
|
|
|
|
|
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* FTMODAPI_H_ */
|
2003-10-05 11:55:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|