ftgasp.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. #ifndef _FT_GASP_H_
  18. #define _FT_GASP_H_
  19. #include <ft2build.h>
  20. #include FT_FREETYPE_H
  21. /***************************************************************************
  22. *
  23. * @section:
  24. * gasp_table
  25. *
  26. * @title:
  27. * Gasp Table
  28. *
  29. * @abstract:
  30. * Retrieving TrueType `gasp' table entries
  31. *
  32. * @description:
  33. * The function @FT_Get_Gasp can be used to query a TrueType or OpenType
  34. * font for specific entries in their `gasp' table, if any. This is
  35. * mainly useful when implementing native TrueType hinting with the
  36. * bytecode interpreter to duplicate the Windows text rendering results.
  37. */
  38. /*************************************************************************
  39. *
  40. * @enum:
  41. * FT_GASP_XXX
  42. *
  43. * @description:
  44. * A list of values and/or bit-flags returned by the @FT_Get_Gasp
  45. * function.
  46. *
  47. * @values:
  48. * FT_GASP_NO_TABLE ::
  49. * This special value means that there is no GASP table in this face.
  50. * It is up to the client to decide what to do.
  51. *
  52. * FT_GASP_DO_GRIDFIT ::
  53. * Grid-fitting and hinting should be performed at the specified ppem.
  54. * This *really* means TrueType bytecode interpretation.
  55. *
  56. * FT_GASP_DO_GRAY ::
  57. * Anti-aliased rendering should be performed at the specified ppem.
  58. *
  59. * FT_GASP_SYMMETRIC_SMOOTHING ::
  60. * Smoothing along multiple axes must be used with ClearType.
  61. *
  62. * FT_GASP_SYMMETRIC_GRIDFIT ::
  63. * Grid-fitting must be used with ClearType's symmetric smoothing.
  64. *
  65. * @note:
  66. * `ClearType' is Microsoft's implementation of LCD rendering, partly
  67. * protected by patents.
  68. *
  69. * @since:
  70. * 2.3.0
  71. */
  72. #define FT_GASP_NO_TABLE -1
  73. #define FT_GASP_DO_GRIDFIT 0x01
  74. #define FT_GASP_DO_GRAY 0x02
  75. #define FT_GASP_SYMMETRIC_SMOOTHING 0x08
  76. #define FT_GASP_SYMMETRIC_GRIDFIT 0x10
  77. /*************************************************************************
  78. *
  79. * @func:
  80. * FT_Get_Gasp
  81. *
  82. * @description:
  83. * Read the `gasp' table from a TrueType or OpenType font file and
  84. * return the entry corresponding to a given character pixel size.
  85. *
  86. * @input:
  87. * face :: The source face handle.
  88. * ppem :: The vertical character pixel size.
  89. *
  90. * @return:
  91. * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE is there is no
  92. * `gasp' table in the face.
  93. *
  94. * @since:
  95. * 2.3.0
  96. */
  97. FT_EXPORT( FT_Int )
  98. FT_Get_Gasp( FT_Face face,
  99. FT_UInt ppem );
  100. /* */
  101. #endif /* _FT_GASP_H_ */
  102. /* END */