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
25#if !defined(HB_OT_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
26#error "Include <hb-ot.h> instead."
27#endif
28
29#ifndef HB_OT_NAME_H
30#define HB_OT_NAME_H
31
32#include "hb.h"
33
34HB_BEGIN_DECLS
35
36/**
37 * hb_ot_name_id_predefined_t:
38 * @HB_OT_NAME_ID_COPYRIGHT: Copyright notice
39 * @HB_OT_NAME_ID_FONT_FAMILY: Font Family name
40 * @HB_OT_NAME_ID_FONT_SUBFAMILY: Font Subfamily name
41 * @HB_OT_NAME_ID_UNIQUE_ID: Unique font identifier
42 * @HB_OT_NAME_ID_FULL_NAME: Full font name that reflects
43 * all family and relevant subfamily descriptors
44 * @HB_OT_NAME_ID_VERSION_STRING: Version string
45 * @HB_OT_NAME_ID_POSTSCRIPT_NAME: PostScript name for the font
46 * @HB_OT_NAME_ID_TRADEMARK: Trademark
47 * @HB_OT_NAME_ID_MANUFACTURER: Manufacturer Name
48 * @HB_OT_NAME_ID_DESIGNER: Designer
49 * @HB_OT_NAME_ID_DESCRIPTION: Description
50 * @HB_OT_NAME_ID_VENDOR_URL: URL of font vendor
51 * @HB_OT_NAME_ID_DESIGNER_URL: URL of typeface designer
52 * @HB_OT_NAME_ID_LICENSE: License Description
53 * @HB_OT_NAME_ID_LICENSE_URL: URL where additional licensing
54 * information can be found
55 * @HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY: Typographic Family name
56 * @HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY: Typographic Subfamily name
57 * @HB_OT_NAME_ID_MAC_FULL_NAME: Compatible Full Name for MacOS
58 * @HB_OT_NAME_ID_SAMPLE_TEXT: Sample text
59 * @HB_OT_NAME_ID_CID_FINDFONT_NAME: PostScript CID findfont name
60 * @HB_OT_NAME_ID_WWS_FAMILY: WWS Family Name
61 * @HB_OT_NAME_ID_WWS_SUBFAMILY: WWS Subfamily Name
62 * @HB_OT_NAME_ID_LIGHT_BACKGROUND: Light Background Palette
63 * @HB_OT_NAME_ID_DARK_BACKGROUND: Dark Background Palette
64 * @HB_OT_NAME_ID_VARIATIONS_PS_PREFIX: Variations PostScript Name Prefix
65 * @HB_OT_NAME_ID_INVALID: Value to represent a nonexistent name ID.
66 *
67 * An enum type representing the pre-defined name IDs.
68 *
69 * For more information on these fields, see the
70 * [OpenType spec](https://docs.microsoft.com/en-us/typography/opentype/spec/name#name-ids).
71 *
72 * Since: 7.0.0
73 **/
74typedef enum
75{
76 HB_OT_NAME_ID_COPYRIGHT = 0,
77 HB_OT_NAME_ID_FONT_FAMILY = 1,
78 HB_OT_NAME_ID_FONT_SUBFAMILY = 2,
79 HB_OT_NAME_ID_UNIQUE_ID = 3,
80 HB_OT_NAME_ID_FULL_NAME = 4,
81 HB_OT_NAME_ID_VERSION_STRING = 5,
82 HB_OT_NAME_ID_POSTSCRIPT_NAME = 6,
83 HB_OT_NAME_ID_TRADEMARK = 7,
84 HB_OT_NAME_ID_MANUFACTURER = 8,
85 HB_OT_NAME_ID_DESIGNER = 9,
86 HB_OT_NAME_ID_DESCRIPTION = 10,
87 HB_OT_NAME_ID_VENDOR_URL = 11,
88 HB_OT_NAME_ID_DESIGNER_URL = 12,
89 HB_OT_NAME_ID_LICENSE = 13,
90 HB_OT_NAME_ID_LICENSE_URL = 14,
91/*HB_OT_NAME_ID_RESERVED = 15,*/
92 HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY = 16,
93 HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17,
94 HB_OT_NAME_ID_MAC_FULL_NAME = 18,
95 HB_OT_NAME_ID_SAMPLE_TEXT = 19,
96 HB_OT_NAME_ID_CID_FINDFONT_NAME = 20,
97 HB_OT_NAME_ID_WWS_FAMILY = 21,
98 HB_OT_NAME_ID_WWS_SUBFAMILY = 22,
99 HB_OT_NAME_ID_LIGHT_BACKGROUND = 23,
100 HB_OT_NAME_ID_DARK_BACKGROUND = 24,
101 HB_OT_NAME_ID_VARIATIONS_PS_PREFIX = 25,
102
103 HB_OT_NAME_ID_INVALID = 0xFFFF
104} hb_ot_name_id_predefined_t;
105
106/**
107 * hb_ot_name_id_t:
108 *
109 * An integral type representing an OpenType 'name' table name identifier.
110 * There are predefined name IDs, as well as name IDs return from other
111 * API. These can be used to fetch name strings from a font face.
112 *
113 * Since: 2.0.0
114 **/
115typedef unsigned int hb_ot_name_id_t;
116
117
118/**
119 * hb_ot_name_entry_t:
120 * @name_id: name ID
121 * @language: language
122 *
123 * Structure representing a name ID in a particular language.
124 *
125 * Since: 2.1.0
126 **/
127typedef struct hb_ot_name_entry_t {
128 hb_ot_name_id_t name_id;
129 /*< private >*/
130 hb_var_int_t var;
131 /*< public >*/
132 hb_language_t language;
133} hb_ot_name_entry_t;
134
135HB_EXTERN const hb_ot_name_entry_t *
136hb_ot_name_list_names (hb_face_t *face,
137 unsigned int *num_entries /* OUT */);
138
139
140HB_EXTERN unsigned int
141hb_ot_name_get_utf8 (hb_face_t *face,
142 hb_ot_name_id_t name_id,
143 hb_language_t language,
144 unsigned int *text_size /* IN/OUT */,
145 char *text /* OUT */);
146
147HB_EXTERN unsigned int
148hb_ot_name_get_utf16 (hb_face_t *face,
149 hb_ot_name_id_t name_id,
150 hb_language_t language,
151 unsigned int *text_size /* IN/OUT */,
152 uint16_t *text /* OUT */);
153
154HB_EXTERN unsigned int
155hb_ot_name_get_utf32 (hb_face_t *face,
156 hb_ot_name_id_t name_id,
157 hb_language_t language,
158 unsigned int *text_size /* IN/OUT */,
159 uint32_t *text /* OUT */);
160
161
162HB_END_DECLS
163
164#endif /* HB_OT_NAME_H */
165