hb-ot-name.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * Copyright © 2018 Ebrahim Byagowi.
  3. *
  4. * This is part of HarfBuzz, a text shaping library.
  5. *
  6. * Permission is hereby granted, without written agreement and without
  7. * license or royalty fees, to use, copy, modify, and distribute this
  8. * software and its documentation for any purpose, provided that the
  9. * above copyright notice and the following two paragraphs appear in
  10. * all copies of this software.
  11. *
  12. * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
  13. * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  14. * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
  15. * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
  16. * DAMAGE.
  17. *
  18. * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
  19. * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  20. * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
  21. * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
  22. * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  23. */
  24. #ifndef HB_OT_H_IN
  25. #error "Include <hb-ot.h> instead."
  26. #endif
  27. #ifndef HB_OT_NAME_H
  28. #define HB_OT_NAME_H
  29. #include "hb.h"
  30. HB_BEGIN_DECLS
  31. /**
  32. * hb_ot_name_id_t:
  33. * @HB_OT_NAME_ID_INVALID: Value to represent a nonexistent name ID.
  34. *
  35. * An integral type representing an OpenType 'name' table name identifier.
  36. * There are predefined name IDs, as well as name IDs return from other
  37. * API. These can be used to fetch name strings from a font face.
  38. *
  39. * Since: 2.0.0
  40. **/
  41. enum
  42. {
  43. HB_OT_NAME_ID_COPYRIGHT = 0,
  44. HB_OT_NAME_ID_FONT_FAMILY = 1,
  45. HB_OT_NAME_ID_FONT_SUBFAMILY = 2,
  46. HB_OT_NAME_ID_UNIQUE_ID = 3,
  47. HB_OT_NAME_ID_FULL_NAME = 4,
  48. HB_OT_NAME_ID_VERSION_STRING = 5,
  49. HB_OT_NAME_ID_POSTSCRIPT_NAME = 6,
  50. HB_OT_NAME_ID_TRADEMARK = 7,
  51. HB_OT_NAME_ID_MANUFACTURER = 8,
  52. HB_OT_NAME_ID_DESIGNER = 9,
  53. HB_OT_NAME_ID_DESCRIPTION = 10,
  54. HB_OT_NAME_ID_VENDOR_URL = 11,
  55. HB_OT_NAME_ID_DESIGNER_URL = 12,
  56. HB_OT_NAME_ID_LICENSE = 13,
  57. HB_OT_NAME_ID_LICENSE_URL = 14,
  58. /*HB_OT_NAME_ID_RESERVED = 15,*/
  59. HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY = 16,
  60. HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17,
  61. HB_OT_NAME_ID_MAC_FULL_NAME = 18,
  62. HB_OT_NAME_ID_SAMPLE_TEXT = 19,
  63. HB_OT_NAME_ID_CID_FINDFONT_NAME = 20,
  64. HB_OT_NAME_ID_WWS_FAMILY = 21,
  65. HB_OT_NAME_ID_WWS_SUBFAMILY = 22,
  66. HB_OT_NAME_ID_LIGHT_BACKGROUND = 23,
  67. HB_OT_NAME_ID_DARK_BACKGROUND = 24,
  68. HB_OT_NAME_ID_VARIATIONS_PS_PREFIX = 25,
  69. HB_OT_NAME_ID_INVALID = 0xFFFF
  70. };
  71. typedef unsigned int hb_ot_name_id_t;
  72. /**
  73. * hb_ot_name_entry_t:
  74. * @name_id: name ID
  75. * @language: language
  76. *
  77. * Structure representing a name ID in a particular language.
  78. *
  79. * Since: 2.1.0
  80. **/
  81. typedef struct hb_ot_name_entry_t
  82. {
  83. hb_ot_name_id_t name_id;
  84. /*< private >*/
  85. hb_var_int_t var;
  86. /*< public >*/
  87. hb_language_t language;
  88. } hb_ot_name_entry_t;
  89. HB_EXTERN const hb_ot_name_entry_t *
  90. hb_ot_name_list_names (hb_face_t *face,
  91. unsigned int *num_entries /* OUT */);
  92. HB_EXTERN unsigned int
  93. hb_ot_name_get_utf8 (hb_face_t *face,
  94. hb_ot_name_id_t name_id,
  95. hb_language_t language,
  96. unsigned int *text_size /* IN/OUT */,
  97. char *text /* OUT */);
  98. HB_EXTERN unsigned int
  99. hb_ot_name_get_utf16 (hb_face_t *face,
  100. hb_ot_name_id_t name_id,
  101. hb_language_t language,
  102. unsigned int *text_size /* IN/OUT */,
  103. uint16_t *text /* OUT */);
  104. HB_EXTERN unsigned int
  105. hb_ot_name_get_utf32 (hb_face_t *face,
  106. hb_ot_name_id_t name_id,
  107. hb_language_t language,
  108. unsigned int *text_size /* IN/OUT */,
  109. uint32_t *text /* OUT */);
  110. HB_END_DECLS
  111. #endif /* HB_OT_NAME_H */