modules/freetype2/include/ftgasp.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /***************************************************************************/
michael@0 2 /* */
michael@0 3 /* ftgasp.h */
michael@0 4 /* */
michael@0 5 /* Access of TrueType's `gasp' table (specification). */
michael@0 6 /* */
michael@0 7 /* Copyright 2007, 2008, 2011 by */
michael@0 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
michael@0 9 /* */
michael@0 10 /* This file is part of the FreeType project, and may only be used, */
michael@0 11 /* modified, and distributed under the terms of the FreeType project */
michael@0 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
michael@0 13 /* this file you indicate that you have read the license and */
michael@0 14 /* understand and accept it fully. */
michael@0 15 /* */
michael@0 16 /***************************************************************************/
michael@0 17
michael@0 18
michael@0 19 #ifndef _FT_GASP_H_
michael@0 20 #define _FT_GASP_H_
michael@0 21
michael@0 22 #include <ft2build.h>
michael@0 23 #include FT_FREETYPE_H
michael@0 24
michael@0 25 #ifdef FREETYPE_H
michael@0 26 #error "freetype.h of FreeType 1 has been loaded!"
michael@0 27 #error "Please fix the directory search order for header files"
michael@0 28 #error "so that freetype.h of FreeType 2 is found first."
michael@0 29 #endif
michael@0 30
michael@0 31
michael@0 32 /***************************************************************************
michael@0 33 *
michael@0 34 * @section:
michael@0 35 * gasp_table
michael@0 36 *
michael@0 37 * @title:
michael@0 38 * Gasp Table
michael@0 39 *
michael@0 40 * @abstract:
michael@0 41 * Retrieving TrueType `gasp' table entries.
michael@0 42 *
michael@0 43 * @description:
michael@0 44 * The function @FT_Get_Gasp can be used to query a TrueType or OpenType
michael@0 45 * font for specific entries in its `gasp' table, if any. This is
michael@0 46 * mainly useful when implementing native TrueType hinting with the
michael@0 47 * bytecode interpreter to duplicate the Windows text rendering results.
michael@0 48 */
michael@0 49
michael@0 50 /*************************************************************************
michael@0 51 *
michael@0 52 * @enum:
michael@0 53 * FT_GASP_XXX
michael@0 54 *
michael@0 55 * @description:
michael@0 56 * A list of values and/or bit-flags returned by the @FT_Get_Gasp
michael@0 57 * function.
michael@0 58 *
michael@0 59 * @values:
michael@0 60 * FT_GASP_NO_TABLE ::
michael@0 61 * This special value means that there is no GASP table in this face.
michael@0 62 * It is up to the client to decide what to do.
michael@0 63 *
michael@0 64 * FT_GASP_DO_GRIDFIT ::
michael@0 65 * Grid-fitting and hinting should be performed at the specified ppem.
michael@0 66 * This *really* means TrueType bytecode interpretation. If this bit
michael@0 67 * is not set, no hinting gets applied.
michael@0 68 *
michael@0 69 * FT_GASP_DO_GRAY ::
michael@0 70 * Anti-aliased rendering should be performed at the specified ppem.
michael@0 71 * If not set, do monochrome rendering.
michael@0 72 *
michael@0 73 * FT_GASP_SYMMETRIC_SMOOTHING ::
michael@0 74 * If set, smoothing along multiple axes must be used with ClearType.
michael@0 75 *
michael@0 76 * FT_GASP_SYMMETRIC_GRIDFIT ::
michael@0 77 * Grid-fitting must be used with ClearType's symmetric smoothing.
michael@0 78 *
michael@0 79 * @note:
michael@0 80 * The bit-flags `FT_GASP_DO_GRIDFIT' and `FT_GASP_DO_GRAY' are to be
michael@0 81 * used for standard font rasterization only. Independently of that,
michael@0 82 * `FT_GASP_SYMMETRIC_SMOOTHING' and `FT_GASP_SYMMETRIC_GRIDFIT' are to
michael@0 83 * be used if ClearType is enabled (and `FT_GASP_DO_GRIDFIT' and
michael@0 84 * `FT_GASP_DO_GRAY' are consequently ignored).
michael@0 85 *
michael@0 86 * `ClearType' is Microsoft's implementation of LCD rendering, partly
michael@0 87 * protected by patents.
michael@0 88 *
michael@0 89 * @since:
michael@0 90 * 2.3.0
michael@0 91 */
michael@0 92 #define FT_GASP_NO_TABLE -1
michael@0 93 #define FT_GASP_DO_GRIDFIT 0x01
michael@0 94 #define FT_GASP_DO_GRAY 0x02
michael@0 95 #define FT_GASP_SYMMETRIC_SMOOTHING 0x08
michael@0 96 #define FT_GASP_SYMMETRIC_GRIDFIT 0x10
michael@0 97
michael@0 98
michael@0 99 /*************************************************************************
michael@0 100 *
michael@0 101 * @func:
michael@0 102 * FT_Get_Gasp
michael@0 103 *
michael@0 104 * @description:
michael@0 105 * Read the `gasp' table from a TrueType or OpenType font file and
michael@0 106 * return the entry corresponding to a given character pixel size.
michael@0 107 *
michael@0 108 * @input:
michael@0 109 * face :: The source face handle.
michael@0 110 * ppem :: The vertical character pixel size.
michael@0 111 *
michael@0 112 * @return:
michael@0 113 * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE if there is no
michael@0 114 * `gasp' table in the face.
michael@0 115 *
michael@0 116 * @since:
michael@0 117 * 2.3.0
michael@0 118 */
michael@0 119 FT_EXPORT( FT_Int )
michael@0 120 FT_Get_Gasp( FT_Face face,
michael@0 121 FT_UInt ppem );
michael@0 122
michael@0 123 /* */
michael@0 124
michael@0 125 #endif /* _FT_GASP_H_ */
michael@0 126
michael@0 127
michael@0 128 /* END */

mercurial