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