/modules/freetype2/include/freetype/ftbdf.h

http://github.com/zpao/v8monkey · C Header · 209 lines · 37 code · 26 blank · 146 comment · 0 complexity · dc58cd2f08b7b77ef3c103084406c344 MD5 · raw file

  1. /***************************************************************************/
  2. /* */
  3. /* ftbdf.h */
  4. /* */
  5. /* FreeType API for accessing BDF-specific strings (specification). */
  6. /* */
  7. /* Copyright 2002, 2003, 2004, 2006, 2009 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 __FTBDF_H__
  18. #define __FTBDF_H__
  19. #include <ft2build.h>
  20. #include FT_FREETYPE_H
  21. #ifdef FREETYPE_H
  22. #error "freetype.h of FreeType 1 has been loaded!"
  23. #error "Please fix the directory search order for header files"
  24. #error "so that freetype.h of FreeType 2 is found first."
  25. #endif
  26. FT_BEGIN_HEADER
  27. /*************************************************************************/
  28. /* */
  29. /* <Section> */
  30. /* bdf_fonts */
  31. /* */
  32. /* <Title> */
  33. /* BDF and PCF Files */
  34. /* */
  35. /* <Abstract> */
  36. /* BDF and PCF specific API. */
  37. /* */
  38. /* <Description> */
  39. /* This section contains the declaration of functions specific to BDF */
  40. /* and PCF fonts. */
  41. /* */
  42. /*************************************************************************/
  43. /**********************************************************************
  44. *
  45. * @enum:
  46. * FT_PropertyType
  47. *
  48. * @description:
  49. * A list of BDF property types.
  50. *
  51. * @values:
  52. * BDF_PROPERTY_TYPE_NONE ::
  53. * Value~0 is used to indicate a missing property.
  54. *
  55. * BDF_PROPERTY_TYPE_ATOM ::
  56. * Property is a string atom.
  57. *
  58. * BDF_PROPERTY_TYPE_INTEGER ::
  59. * Property is a 32-bit signed integer.
  60. *
  61. * BDF_PROPERTY_TYPE_CARDINAL ::
  62. * Property is a 32-bit unsigned integer.
  63. */
  64. typedef enum BDF_PropertyType_
  65. {
  66. BDF_PROPERTY_TYPE_NONE = 0,
  67. BDF_PROPERTY_TYPE_ATOM = 1,
  68. BDF_PROPERTY_TYPE_INTEGER = 2,
  69. BDF_PROPERTY_TYPE_CARDINAL = 3
  70. } BDF_PropertyType;
  71. /**********************************************************************
  72. *
  73. * @type:
  74. * BDF_Property
  75. *
  76. * @description:
  77. * A handle to a @BDF_PropertyRec structure to model a given
  78. * BDF/PCF property.
  79. */
  80. typedef struct BDF_PropertyRec_* BDF_Property;
  81. /**********************************************************************
  82. *
  83. * @struct:
  84. * BDF_PropertyRec
  85. *
  86. * @description:
  87. * This structure models a given BDF/PCF property.
  88. *
  89. * @fields:
  90. * type ::
  91. * The property type.
  92. *
  93. * u.atom ::
  94. * The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.
  95. *
  96. * u.integer ::
  97. * A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.
  98. *
  99. * u.cardinal ::
  100. * An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.
  101. */
  102. typedef struct BDF_PropertyRec_
  103. {
  104. BDF_PropertyType type;
  105. union {
  106. const char* atom;
  107. FT_Int32 integer;
  108. FT_UInt32 cardinal;
  109. } u;
  110. } BDF_PropertyRec;
  111. /**********************************************************************
  112. *
  113. * @function:
  114. * FT_Get_BDF_Charset_ID
  115. *
  116. * @description:
  117. * Retrieve a BDF font character set identity, according to
  118. * the BDF specification.
  119. *
  120. * @input:
  121. * face ::
  122. * A handle to the input face.
  123. *
  124. * @output:
  125. * acharset_encoding ::
  126. * Charset encoding, as a C~string, owned by the face.
  127. *
  128. * acharset_registry ::
  129. * Charset registry, as a C~string, owned by the face.
  130. *
  131. * @return:
  132. * FreeType error code. 0~means success.
  133. *
  134. * @note:
  135. * This function only works with BDF faces, returning an error otherwise.
  136. */
  137. FT_EXPORT( FT_Error )
  138. FT_Get_BDF_Charset_ID( FT_Face face,
  139. const char* *acharset_encoding,
  140. const char* *acharset_registry );
  141. /**********************************************************************
  142. *
  143. * @function:
  144. * FT_Get_BDF_Property
  145. *
  146. * @description:
  147. * Retrieve a BDF property from a BDF or PCF font file.
  148. *
  149. * @input:
  150. * face :: A handle to the input face.
  151. *
  152. * name :: The property name.
  153. *
  154. * @output:
  155. * aproperty :: The property.
  156. *
  157. * @return:
  158. * FreeType error code. 0~means success.
  159. *
  160. * @note:
  161. * This function works with BDF _and_ PCF fonts. It returns an error
  162. * otherwise. It also returns an error if the property is not in the
  163. * font.
  164. *
  165. * A `property' is a either key-value pair within the STARTPROPERTIES
  166. * ... ENDPROPERTIES block of a BDF font or a key-value pair from the
  167. * `info->props' array within a `FontRec' structure of a PCF font.
  168. *
  169. * Integer properties are always stored as `signed' within PCF fonts;
  170. * consequently, @BDF_PROPERTY_TYPE_CARDINAL is a possible return value
  171. * for BDF fonts only.
  172. *
  173. * In case of error, `aproperty->type' is always set to
  174. * @BDF_PROPERTY_TYPE_NONE.
  175. */
  176. FT_EXPORT( FT_Error )
  177. FT_Get_BDF_Property( FT_Face face,
  178. const char* prop_name,
  179. BDF_PropertyRec *aproperty );
  180. /* */
  181. FT_END_HEADER
  182. #endif /* __FTBDF_H__ */
  183. /* END */