• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef HB_OT_H_IN
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 
34 HB_BEGIN_DECLS
35 
36 
37 /**
38  * hb_ot_name_id_t:
39  * @HB_OT_NAME_ID_INVALID: Value to represent a nonexistent name ID.
40  *
41  * An integral type representing an OpenType 'name' table name identifier.
42  * There are predefined name IDs, as well as name IDs return from other
43  * API.  These can be used to fetch name strings from a font face.
44  *
45  * Since: 2.0.0
46  **/
47 enum
48 {
49   HB_OT_NAME_ID_COPYRIGHT		= 0,
50   HB_OT_NAME_ID_FONT_FAMILY		= 1,
51   HB_OT_NAME_ID_FONT_SUBFAMILY		= 2,
52   HB_OT_NAME_ID_UNIQUE_ID		= 3,
53   HB_OT_NAME_ID_FULL_NAME		= 4,
54   HB_OT_NAME_ID_VERSION_STRING		= 5,
55   HB_OT_NAME_ID_POSTSCRIPT_NAME		= 6,
56   HB_OT_NAME_ID_TRADEMARK		= 7,
57   HB_OT_NAME_ID_MANUFACTURER		= 8,
58   HB_OT_NAME_ID_DESIGNER		= 9,
59   HB_OT_NAME_ID_DESCRIPTION		= 10,
60   HB_OT_NAME_ID_VENDOR_URL		= 11,
61   HB_OT_NAME_ID_DESIGNER_URL		= 12,
62   HB_OT_NAME_ID_LICENSE			= 13,
63   HB_OT_NAME_ID_LICENSE_URL		= 14,
64 /*HB_OT_NAME_ID_RESERVED		= 15,*/
65   HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY	= 16,
66   HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY	= 17,
67   HB_OT_NAME_ID_MAC_FULL_NAME		= 18,
68   HB_OT_NAME_ID_SAMPLE_TEXT		= 19,
69   HB_OT_NAME_ID_CID_FINDFONT_NAME	= 20,
70   HB_OT_NAME_ID_WWS_FAMILY		= 21,
71   HB_OT_NAME_ID_WWS_SUBFAMILY		= 22,
72   HB_OT_NAME_ID_LIGHT_BACKGROUND	= 23,
73   HB_OT_NAME_ID_DARK_BACKGROUND		= 24,
74   HB_OT_NAME_ID_VARIATIONS_PS_PREFIX	= 25,
75 
76   HB_OT_NAME_ID_INVALID			= 0xFFFF
77 };
78 
79 typedef unsigned int hb_ot_name_id_t;
80 
81 
82 /**
83  * hb_ot_name_entry_t:
84  * @name_id: name ID
85  * @language: language
86  *
87  * Structure representing a name ID in a particular language.
88  *
89  * Since: 2.1.0
90  **/
91 typedef struct hb_ot_name_entry_t
92 {
93   hb_ot_name_id_t name_id;
94   /*< private >*/
95   hb_var_int_t    var;
96   /*< public >*/
97   hb_language_t   language;
98 } hb_ot_name_entry_t;
99 
100 HB_EXTERN const hb_ot_name_entry_t *
101 hb_ot_name_list_names (hb_face_t    *face,
102 		       unsigned int *num_entries /* OUT */);
103 
104 
105 HB_EXTERN unsigned int
106 hb_ot_name_get_utf8 (hb_face_t       *face,
107 		     hb_ot_name_id_t  name_id,
108 		     hb_language_t    language,
109 		     unsigned int    *text_size /* IN/OUT */,
110 		     char            *text      /* OUT */);
111 
112 HB_EXTERN unsigned int
113 hb_ot_name_get_utf16 (hb_face_t       *face,
114 		      hb_ot_name_id_t  name_id,
115 		      hb_language_t    language,
116 		      unsigned int    *text_size /* IN/OUT */,
117 		      uint16_t        *text      /* OUT */);
118 
119 HB_EXTERN unsigned int
120 hb_ot_name_get_utf32 (hb_face_t       *face,
121 		      hb_ot_name_id_t  name_id,
122 		      hb_language_t    language,
123 		      unsigned int    *text_size /* IN/OUT */,
124 		      uint32_t        *text      /* OUT */);
125 
126 
127 HB_END_DECLS
128 
129 #endif /* HB_OT_NAME_H */
130