1 
2 //          Copyright Ahmet Sait Koçak 2020.
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          https://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.hb.bind.ot.name;
8 
9 import bindbc.hb.config;
10 
11 import bindbc.hb.bind.common;
12 import bindbc.hb.bind.face;
13 
14 extern(C) @nogc nothrow:
15 
16 /**
17  * hb_ot_name_id_t:
18  * @HB_OT_NAME_ID_INVALID: Value to represent a nonexistent name ID.
19  *
20  * An integral type representing an OpenType 'name' table name identifier.
21  * There are predefined name IDs, as well as name IDs return from other
22  * API.  These can be used to fetch name strings from a font face.
23  *
24  * Since: 2.0.0
25  **/
26 enum : uint
27 {
28 	HB_OT_NAME_ID_COPYRIGHT = 0,
29 	HB_OT_NAME_ID_FONT_FAMILY = 1,
30 	HB_OT_NAME_ID_FONT_SUBFAMILY = 2,
31 	HB_OT_NAME_ID_UNIQUE_ID = 3,
32 	HB_OT_NAME_ID_FULL_NAME = 4,
33 	HB_OT_NAME_ID_VERSION_STRING = 5,
34 	HB_OT_NAME_ID_POSTSCRIPT_NAME = 6,
35 	HB_OT_NAME_ID_TRADEMARK = 7,
36 	HB_OT_NAME_ID_MANUFACTURER = 8,
37 	HB_OT_NAME_ID_DESIGNER = 9,
38 	HB_OT_NAME_ID_DESCRIPTION = 10,
39 	HB_OT_NAME_ID_VENDOR_URL = 11,
40 	HB_OT_NAME_ID_DESIGNER_URL = 12,
41 	HB_OT_NAME_ID_LICENSE = 13,
42 	HB_OT_NAME_ID_LICENSE_URL = 14,
43 	/*HB_OT_NAME_ID_RESERVED		= 15,*/
44 	HB_OT_NAME_ID_TYPOGRAPHIC_FAMILY = 16,
45 	HB_OT_NAME_ID_TYPOGRAPHIC_SUBFAMILY = 17,
46 	HB_OT_NAME_ID_MAC_FULL_NAME = 18,
47 	HB_OT_NAME_ID_SAMPLE_TEXT = 19,
48 	HB_OT_NAME_ID_CID_FINDFONT_NAME = 20,
49 	HB_OT_NAME_ID_WWS_FAMILY = 21,
50 	HB_OT_NAME_ID_WWS_SUBFAMILY = 22,
51 	HB_OT_NAME_ID_LIGHT_BACKGROUND = 23,
52 	HB_OT_NAME_ID_DARK_BACKGROUND = 24,
53 	HB_OT_NAME_ID_VARIATIONS_PS_PREFIX = 25,
54 
55 	HB_OT_NAME_ID_INVALID = 0xFFFF
56 }
57 alias hb_ot_name_id_t = uint;
58 
59 static if (hbSupport >= HBSupport.v2_6_3)
60 {
61 	/**
62 	 * hb_ot_name_entry_t:
63 	 * @name_id: name ID
64 	 * @language: language
65 	 *
66 	 * Structure representing a name ID in a particular language.
67 	 *
68 	 * Since: 2.1.0
69 	 **/
70 	struct hb_ot_name_entry_t
71 	{
72 		hb_ot_name_id_t name_id;
73 		/*< private >*/
74 		hb_var_int_t var;
75 		/*< public >*/
76 		hb_language_t language;
77 	}
78 
79 	/* OUT */
80 	version(BindHB_Static)
81 		const(hb_ot_name_entry_t)* hb_ot_name_list_names (
82 			hb_face_t* face,
83 			uint* num_entries);
84 	else
85 	{
86 		private alias fp_hb_ot_name_list_names = const(hb_ot_name_entry_t)* function (
87 			hb_face_t* face,
88 			uint* num_entries);
89 		__gshared fp_hb_ot_name_list_names hb_ot_name_list_names;
90 	}
91 
92 	/* IN/OUT */
93 	/* OUT */
94 	version(BindHB_Static)
95 		uint hb_ot_name_get_utf8 (
96 			hb_face_t* face,
97 			hb_ot_name_id_t name_id,
98 			hb_language_t language,
99 			uint* text_size,
100 			char* text);
101 	else
102 	{
103 		private alias fp_hb_ot_name_get_utf8 = uint function (
104 			hb_face_t* face,
105 			hb_ot_name_id_t name_id,
106 			hb_language_t language,
107 			uint* text_size,
108 			char* text);
109 		__gshared fp_hb_ot_name_get_utf8 hb_ot_name_get_utf8;
110 	}
111 
112 	/* IN/OUT */
113 	/* OUT */
114 	version(BindHB_Static)
115 		uint hb_ot_name_get_utf16 (
116 			hb_face_t* face,
117 			hb_ot_name_id_t name_id,
118 			hb_language_t language,
119 			uint* text_size,
120 			ushort* text);
121 	else
122 	{
123 		private alias fp_hb_ot_name_get_utf16 = uint function (
124 			hb_face_t* face,
125 			hb_ot_name_id_t name_id,
126 			hb_language_t language,
127 			uint* text_size,
128 			ushort* text);
129 		__gshared fp_hb_ot_name_get_utf16 hb_ot_name_get_utf16;
130 	}
131 
132 	/* IN/OUT */
133 	/* OUT */
134 	version(BindHB_Static)
135 		uint hb_ot_name_get_utf32 (
136 			hb_face_t* face,
137 			hb_ot_name_id_t name_id,
138 			hb_language_t language,
139 			uint* text_size,
140 			uint* text);
141 	else
142 	{
143 		private alias fp_hb_ot_name_get_utf32 = uint function (
144 			hb_face_t* face,
145 			hb_ot_name_id_t name_id,
146 			hb_language_t language,
147 			uint* text_size,
148 			uint* text);
149 		__gshared fp_hb_ot_name_get_utf32 hb_ot_name_get_utf32;
150 	}
151 }