root / windows / trunk / libs / freetype / include / freetype2 / freetype / ftgasp.h @ 23

View | Annotate | Download (3.8 KB)

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