ftbdf.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /***************************************************************************/
  2. /* */
  3. /* ftbdf.h */
  4. /* */
  5. /* FreeType API for accessing BDF-specific strings (specification). */
  6. /* */
  7. /* Copyright 2002 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. FT_BEGIN_HEADER
  22. /*************************************************************************/
  23. /* */
  24. /* <Section> */
  25. /* bdf_fonts */
  26. /* */
  27. /* <Title> */
  28. /* BDF Fonts */
  29. /* */
  30. /* <Abstract> */
  31. /* BDF-specific APIs */
  32. /* */
  33. /* <Description> */
  34. /* This section contains the declaration of BDF-specific functions. */
  35. /* */
  36. /*************************************************************************/
  37. /**********************************************************************
  38. *
  39. * @enum:
  40. * FT_PropertyType
  41. *
  42. * @description:
  43. * list of BDF property types
  44. *
  45. * @values:
  46. * BDF_PROPERTY_TYPE_NONE ::
  47. * value 0 is used to indicate a missing property
  48. *
  49. * BDF_PROPERTY_TYPE_ATOM ::
  50. * property is a string atom
  51. *
  52. * BDF_PROPERTY_TYPE_INTEGER ::
  53. * property is a 32-bit signed integer
  54. *
  55. * BDF_PROPERTY_TYPE_CARDINAL ::
  56. * property is a 32-bit unsigned integer
  57. */
  58. typedef enum
  59. {
  60. BDF_PROPERTY_TYPE_NONE = 0,
  61. BDF_PROPERTY_TYPE_ATOM = 1,
  62. BDF_PROPERTY_TYPE_INTEGER = 2,
  63. BDF_PROPERTY_TYPE_CARDINAL = 3
  64. } BDF_PropertyType;
  65. /**********************************************************************
  66. *
  67. * @type: BDF_Property
  68. *
  69. * @description:
  70. * handle to a @BDF_PropertyRec structure used to model a given
  71. * BDF/PCF property
  72. */
  73. typedef struct BDF_PropertyRec_* BDF_Property;
  74. /**********************************************************************
  75. *
  76. * @struct: BDF_PropertyRec
  77. *
  78. * @description:
  79. * models a given BDF/PCF property
  80. *
  81. * @note:
  82. * type :: property type
  83. * u.atom :: atom string, when type is @BDF_PROPERTY_TYPE_ATOM
  84. * u.integer :: signed integer, when type is @BDF_PROPERTY_TYPE_INTEGER
  85. * u.cardinal :: unsigned integer, when type is @BDF_PROPERTY_TYPE_CARDINAL
  86. */
  87. typedef struct BDF_PropertyRec_
  88. {
  89. BDF_PropertyType type;
  90. union {
  91. const char* atom;
  92. FT_Int32 integer;
  93. FT_UInt32 cardinal;
  94. } u;
  95. } BDF_PropertyRec;
  96. /**********************************************************************
  97. *
  98. * @function:
  99. * FT_Get_BDF_Charset_ID
  100. *
  101. * @description:
  102. * Retrieves a BDF font character set identity, according to
  103. * the BDF specification.
  104. *
  105. * @input:
  106. * face ::
  107. * handle to input face
  108. *
  109. * @output:
  110. * acharset_encoding ::
  111. * Charset encoding, as a C string, owned by the face.
  112. *
  113. * acharset_registry ::
  114. * Charset registry, as a C string, owned by the face.
  115. *
  116. * @return:
  117. * FreeType rror code. 0 means success.
  118. *
  119. * @note:
  120. * This function only works with BDF faces, returning an error otherwise.
  121. */
  122. FT_EXPORT( FT_Error )
  123. FT_Get_BDF_Charset_ID( FT_Face face,
  124. const char* *acharset_encoding,
  125. const char* *acharset_registry );
  126. /**********************************************************************
  127. *
  128. * @function:
  129. * FT_Get_BDF_Property
  130. *
  131. * @description:
  132. * Retrieves a BDF property from a BDF or PCF font file
  133. *
  134. * @input:
  135. * face :: handle to input face
  136. * name :: property name
  137. *
  138. * @output:
  139. * aproperty :: the property
  140. *
  141. * @return:
  142. * FreeType error code. 0 means success.
  143. *
  144. * @note:
  145. * This function works with BDF _and_ PCF fonts. It returns an error
  146. * otherwise. it also returns an error when the property is not in the
  147. * font.
  148. *
  149. * in case of error, "aproperty->type" is always set to
  150. * @BDF_PROPERTY_TYPE_NONE
  151. */
  152. FT_EXPORT( FT_Error )
  153. FT_Get_BDF_Property( FT_Face face,
  154. const char* prop_name,
  155. BDF_PropertyRec *aproperty );
  156. /* */
  157. FT_END_HEADER
  158. #endif /* __FTBDF_H__ */
  159. /* END */