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.dynload;
8 
9 version(BindHB_Static) {}
10 else:
11 
12 nothrow @nogc:
13 
14 import bindbc.loader;
15 import bindbc.hb.config;
16 
17 private
18 {
19 	__gshared SharedLib hbLib;
20 	__gshared SharedLib hbSubsetLib;
21 	__gshared HBSupport hbLoadedVersion;
22 }
23 
24 void unloadHarfBuzz()
25 {
26 	version(HB_with_subset)
27 		if (hbSubsetLib != invalidHandle)
28 			hbSubsetLib.unload();
29 
30 	if (hbLib != invalidHandle)
31 		hbLib.unload();
32 }
33 
34 HBSupport loadedHarfBuzzVersion() { return hbLoadedVersion; }
35 
36 bool isHarfBuzzLoaded()
37 {
38 	return hbLib != invalidHandle;
39 }
40 
41 bool isHarfBuzzSubsetLoaded()
42 {
43 	return hbSubsetLib != invalidHandle;
44 }
45 
46 HBSupport loadHarfBuzz()
47 {
48 	// FIXME: Library names are not verified
49 	version(Windows)
50 	{
51 		const(char)[][3] hbLibNames = [
52 			"harfbuzz.dll",
53 			"libharfbuzz.dll",
54 			"libharfbuzz-0.dll"
55 		];
56 		const(char)[][3] subsetLibNames = [
57 			"harfbuzz-subset.dll",
58 			"libharfbuzz-subset.dll",
59 			"libharfbuzz-subset-0.dll"
60 		];
61 	}
62 	else version(OSX)
63 	{
64 		const(char)[][6] hbLibNames = [
65 			"libharfbuzz.dylib",
66 			"libharfbuzz.0.dylib",
67 			"/usr/X11/hbLib/libharfbuzz.dylib",
68 			"/usr/X11/hbLib/libharfbuzz.0.dylib",
69 			"/opt/X11/hbLib/libharfbuzz.dylib",
70 			"/opt/X11/hbLib/libharfbuzz.0.dylib"
71 		];
72 		const(char)[][6] subsetLibNames = [
73 			"libharfbuzz-subset.dylib",
74 			"libharfbuzz-subset.0.dylib",
75 			"/usr/X11/hbLib/libharfbuzz-subset.dylib",
76 			"/usr/X11/hbLib/libharfbuzz-subset.0.dylib",
77 			"/opt/X11/hbLib/libharfbuzz-subset.dylib",
78 			"/opt/X11/hbLib/libharfbuzz-subset.0.dylib"
79 		];
80 	}
81 	else version(Posix)
82 	{
83 		const(char)[][2] hbLibNames = [
84 			"libharfbuzz.so.0",
85 			"libharfbuzz.so"
86 		];
87 		const(char)[][2] subsetLibNames = [
88 			"libharfbuzz-subset.so.0",
89 			"libharfbuzz-subset.so"
90 		];
91 	}
92 	else static assert(0, "bindbc-harfbuzz is not yet supported on this platform.");
93 
94 	HBSupport ret;
95 	assert(hbLibNames.length == subsetLibNames.length);
96 	foreach(i; 0 .. hbLibNames.length)
97 	{
98 		version(HB_with_subset)
99 			ret = loadHarfBuzz(hbLibNames[i].ptr, subsetLibNames[i].ptr);
100 		else
101 			ret = loadHarfBuzz(hbLibNames[i].ptr, null);
102 		if (ret != HBSupport.noLibrary)
103 			break;
104 	}
105 	return ret;
106 }
107 
108 HBSupport loadHarfBuzz(const(char)* libName, const(char)* subsetLibName)
109 {
110 	hbLib = load(libName);
111 	if (hbLib == invalidHandle)
112 		return HBSupport.noLibrary;
113 	
114 	version(HB_with_subset)
115 	{
116 		hbSubsetLib = load(subsetLibName);
117 		if (hbSubsetLib == invalidHandle)
118 			return HBSupport.noLibrary;
119 	}
120 
121 	auto lastErrorCount = errorCount();
122 	hbLoadedVersion = HBSupport.badLibrary;
123 
124 	import bindbc.hb.bind.blob;
125 	hbLib.bindSymbol(cast(void**)&hb_blob_create, "hb_blob_create");
126 	hbLib.bindSymbol(cast(void**)&hb_blob_create_sub_blob, "hb_blob_create_sub_blob");
127 	hbLib.bindSymbol(cast(void**)&hb_blob_get_empty, "hb_blob_get_empty");
128 	hbLib.bindSymbol(cast(void**)&hb_blob_reference, "hb_blob_reference");
129 	hbLib.bindSymbol(cast(void**)&hb_blob_destroy, "hb_blob_destroy");
130 	hbLib.bindSymbol(cast(void**)&hb_blob_set_user_data, "hb_blob_set_user_data");
131 	hbLib.bindSymbol(cast(void**)&hb_blob_get_user_data, "hb_blob_get_user_data");
132 	hbLib.bindSymbol(cast(void**)&hb_blob_make_immutable, "hb_blob_make_immutable");
133 	hbLib.bindSymbol(cast(void**)&hb_blob_is_immutable, "hb_blob_is_immutable");
134 	hbLib.bindSymbol(cast(void**)&hb_blob_get_length, "hb_blob_get_length");
135 	hbLib.bindSymbol(cast(void**)&hb_blob_get_data, "hb_blob_get_data");
136 	hbLib.bindSymbol(cast(void**)&hb_blob_get_data_writable, "hb_blob_get_data_writable");
137 
138 	import bindbc.hb.bind.buffer;
139 	//hbLib.bindSymbol(cast(void**)&hb_glyph_info_get_glyph_flags, "hb_glyph_info_get_glyph_flags");
140 	hbLib.bindSymbol(cast(void**)&hb_segment_properties_equal, "hb_segment_properties_equal");
141 	hbLib.bindSymbol(cast(void**)&hb_segment_properties_hash, "hb_segment_properties_hash");
142 	hbLib.bindSymbol(cast(void**)&hb_buffer_create, "hb_buffer_create");
143 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_empty, "hb_buffer_get_empty");
144 	hbLib.bindSymbol(cast(void**)&hb_buffer_reference, "hb_buffer_reference");
145 	hbLib.bindSymbol(cast(void**)&hb_buffer_destroy, "hb_buffer_destroy");
146 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_user_data, "hb_buffer_set_user_data");
147 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_user_data, "hb_buffer_get_user_data");
148 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_content_type, "hb_buffer_set_content_type");
149 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_content_type, "hb_buffer_get_content_type");
150 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_unicode_funcs, "hb_buffer_set_unicode_funcs");
151 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_unicode_funcs, "hb_buffer_get_unicode_funcs");
152 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_direction, "hb_buffer_set_direction");
153 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_direction, "hb_buffer_get_direction");
154 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_script, "hb_buffer_set_script");
155 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_script, "hb_buffer_get_script");
156 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_language, "hb_buffer_set_language");
157 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_language, "hb_buffer_get_language");
158 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_segment_properties, "hb_buffer_set_segment_properties");
159 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_segment_properties, "hb_buffer_get_segment_properties");
160 	hbLib.bindSymbol(cast(void**)&hb_buffer_guess_segment_properties, "hb_buffer_guess_segment_properties");
161 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_flags, "hb_buffer_set_flags");
162 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_flags, "hb_buffer_get_flags");
163 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_cluster_level, "hb_buffer_set_cluster_level");
164 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_cluster_level, "hb_buffer_get_cluster_level");
165 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_replacement_codepoint, "hb_buffer_set_replacement_codepoint");
166 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_replacement_codepoint, "hb_buffer_get_replacement_codepoint");
167 	hbLib.bindSymbol(cast(void**)&hb_buffer_reset, "hb_buffer_reset");
168 	hbLib.bindSymbol(cast(void**)&hb_buffer_clear_contents, "hb_buffer_clear_contents");
169 	hbLib.bindSymbol(cast(void**)&hb_buffer_pre_allocate, "hb_buffer_pre_allocate");
170 	hbLib.bindSymbol(cast(void**)&hb_buffer_allocation_successful, "hb_buffer_allocation_successful");
171 	hbLib.bindSymbol(cast(void**)&hb_buffer_reverse, "hb_buffer_reverse");
172 	hbLib.bindSymbol(cast(void**)&hb_buffer_reverse_range, "hb_buffer_reverse_range");
173 	hbLib.bindSymbol(cast(void**)&hb_buffer_reverse_clusters, "hb_buffer_reverse_clusters");
174 	hbLib.bindSymbol(cast(void**)&hb_buffer_add, "hb_buffer_add");
175 	hbLib.bindSymbol(cast(void**)&hb_buffer_add_utf8, "hb_buffer_add_utf8");
176 	hbLib.bindSymbol(cast(void**)&hb_buffer_add_utf16, "hb_buffer_add_utf16");
177 	hbLib.bindSymbol(cast(void**)&hb_buffer_add_utf32, "hb_buffer_add_utf32");
178 	hbLib.bindSymbol(cast(void**)&hb_buffer_add_latin1, "hb_buffer_add_latin1");
179 	hbLib.bindSymbol(cast(void**)&hb_buffer_add_codepoints, "hb_buffer_add_codepoints");
180 	hbLib.bindSymbol(cast(void**)&hb_buffer_append, "hb_buffer_append");
181 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_length, "hb_buffer_set_length");
182 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_length, "hb_buffer_get_length");
183 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_glyph_infos, "hb_buffer_get_glyph_infos");
184 	hbLib.bindSymbol(cast(void**)&hb_buffer_get_glyph_positions, "hb_buffer_get_glyph_positions");
185 	hbLib.bindSymbol(cast(void**)&hb_buffer_normalize_glyphs, "hb_buffer_normalize_glyphs");
186 	hbLib.bindSymbol(cast(void**)&hb_buffer_serialize_format_from_string, "hb_buffer_serialize_format_from_string");
187 	hbLib.bindSymbol(cast(void**)&hb_buffer_serialize_format_to_string, "hb_buffer_serialize_format_to_string");
188 	hbLib.bindSymbol(cast(void**)&hb_buffer_serialize_list_formats, "hb_buffer_serialize_list_formats");
189 	hbLib.bindSymbol(cast(void**)&hb_buffer_serialize_glyphs, "hb_buffer_serialize_glyphs");
190 	hbLib.bindSymbol(cast(void**)&hb_buffer_deserialize_glyphs, "hb_buffer_deserialize_glyphs");
191 	hbLib.bindSymbol(cast(void**)&hb_buffer_diff, "hb_buffer_diff");
192 	hbLib.bindSymbol(cast(void**)&hb_buffer_set_message_func, "hb_buffer_set_message_func");
193 
194 	import bindbc.hb.bind.common;
195 	hbLib.bindSymbol(cast(void**)&hb_tag_from_string, "hb_tag_from_string");
196 	hbLib.bindSymbol(cast(void**)&hb_tag_to_string, "hb_tag_to_string");
197 	hbLib.bindSymbol(cast(void**)&hb_direction_from_string, "hb_direction_from_string");
198 	hbLib.bindSymbol(cast(void**)&hb_direction_to_string, "hb_direction_to_string");
199 	hbLib.bindSymbol(cast(void**)&hb_language_from_string, "hb_language_from_string");
200 	hbLib.bindSymbol(cast(void**)&hb_language_to_string, "hb_language_to_string");
201 	hbLib.bindSymbol(cast(void**)&hb_language_get_default, "hb_language_get_default");
202 	hbLib.bindSymbol(cast(void**)&hb_script_from_iso15924_tag, "hb_script_from_iso15924_tag");
203 	hbLib.bindSymbol(cast(void**)&hb_script_from_string, "hb_script_from_string");
204 	hbLib.bindSymbol(cast(void**)&hb_script_to_iso15924_tag, "hb_script_to_iso15924_tag");
205 	hbLib.bindSymbol(cast(void**)&hb_script_get_horizontal_direction, "hb_script_get_horizontal_direction");
206 	hbLib.bindSymbol(cast(void**)&hb_feature_from_string, "hb_feature_from_string");
207 	hbLib.bindSymbol(cast(void**)&hb_feature_to_string, "hb_feature_to_string");
208 	hbLib.bindSymbol(cast(void**)&hb_variation_from_string, "hb_variation_from_string");
209 	hbLib.bindSymbol(cast(void**)&hb_variation_to_string, "hb_variation_to_string");
210 
211 	version(HB_with_deprecated)
212 	{
213 		import bindbc.hb.bind.deprecated_;
214 		hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_func, "hb_font_funcs_set_glyph_func");
215 		hbLib.bindSymbol(cast(void**)&hb_set_invert, "hb_set_invert");
216 		hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_eastasian_width_func, "hb_unicode_funcs_set_eastasian_width_func");
217 		hbLib.bindSymbol(cast(void**)&hb_unicode_eastasian_width, "hb_unicode_eastasian_width");
218 		hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_decompose_compatibility_func, "hb_unicode_funcs_set_decompose_compatibility_func");
219 		hbLib.bindSymbol(cast(void**)&hb_unicode_decompose_compatibility, "hb_unicode_decompose_compatibility");
220 		hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_v_kerning_func, "hb_font_funcs_set_glyph_v_kerning_func");
221 		hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_v_kerning, "hb_font_get_glyph_v_kerning");
222 	}
223 	
224 	version(Windows)
225 	version(HB_with_directwrite)
226 	version(Have_aurora_directx)
227 	{
228 		import bindbc.hb.bind.directwrite;
229 		hbLib.bindSymbol(cast(void**)&hb_directwrite_face_create, "hb_directwrite_face_create");
230 		hbLib.bindSymbol(cast(void**)&hb_directwrite_face_get_font_face, "hb_directwrite_face_get_font_face");
231 	}
232 	
233 	import bindbc.hb.bind.face;
234 	hbLib.bindSymbol(cast(void**)&hb_face_create, "hb_face_create");
235 	hbLib.bindSymbol(cast(void**)&hb_face_create_for_tables, "hb_face_create_for_tables");
236 	hbLib.bindSymbol(cast(void**)&hb_face_get_empty, "hb_face_get_empty");
237 	hbLib.bindSymbol(cast(void**)&hb_face_reference, "hb_face_reference");
238 	hbLib.bindSymbol(cast(void**)&hb_face_destroy, "hb_face_destroy");
239 	hbLib.bindSymbol(cast(void**)&hb_face_set_user_data, "hb_face_set_user_data");
240 	hbLib.bindSymbol(cast(void**)&hb_face_get_user_data, "hb_face_get_user_data");
241 	hbLib.bindSymbol(cast(void**)&hb_face_make_immutable, "hb_face_make_immutable");
242 	hbLib.bindSymbol(cast(void**)&hb_face_is_immutable, "hb_face_is_immutable");
243 	hbLib.bindSymbol(cast(void**)&hb_face_reference_table, "hb_face_reference_table");
244 	hbLib.bindSymbol(cast(void**)&hb_face_reference_blob, "hb_face_reference_blob");
245 	hbLib.bindSymbol(cast(void**)&hb_face_set_index, "hb_face_set_index");
246 	hbLib.bindSymbol(cast(void**)&hb_face_get_index, "hb_face_get_index");
247 	hbLib.bindSymbol(cast(void**)&hb_face_set_upem, "hb_face_set_upem");
248 	hbLib.bindSymbol(cast(void**)&hb_face_get_upem, "hb_face_get_upem");
249 	hbLib.bindSymbol(cast(void**)&hb_face_set_glyph_count, "hb_face_set_glyph_count");
250 	hbLib.bindSymbol(cast(void**)&hb_face_get_glyph_count, "hb_face_get_glyph_count");
251 	hbLib.bindSymbol(cast(void**)&hb_face_get_table_tags, "hb_face_get_table_tags");
252 
253 	import bindbc.hb.bind.font;
254 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_create, "hb_font_funcs_create");
255 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_get_empty, "hb_font_funcs_get_empty");
256 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_reference, "hb_font_funcs_reference");
257 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_destroy, "hb_font_funcs_destroy");
258 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_user_data, "hb_font_funcs_set_user_data");
259 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_get_user_data, "hb_font_funcs_get_user_data");
260 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_make_immutable, "hb_font_funcs_make_immutable");
261 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_is_immutable, "hb_font_funcs_is_immutable");
262 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_font_h_extents_func, "hb_font_funcs_set_font_h_extents_func");
263 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_font_v_extents_func, "hb_font_funcs_set_font_v_extents_func");
264 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_nominal_glyph_func, "hb_font_funcs_set_nominal_glyph_func");
265 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_variation_glyph_func, "hb_font_funcs_set_variation_glyph_func");
266 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_h_advance_func, "hb_font_funcs_set_glyph_h_advance_func");
267 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_v_advance_func, "hb_font_funcs_set_glyph_v_advance_func");
268 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_h_origin_func, "hb_font_funcs_set_glyph_h_origin_func");
269 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_v_origin_func, "hb_font_funcs_set_glyph_v_origin_func");
270 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_h_kerning_func, "hb_font_funcs_set_glyph_h_kerning_func");
271 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_extents_func, "hb_font_funcs_set_glyph_extents_func");
272 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_contour_point_func, "hb_font_funcs_set_glyph_contour_point_func");
273 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_name_func, "hb_font_funcs_set_glyph_name_func");
274 	hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_from_name_func, "hb_font_funcs_set_glyph_from_name_func");
275 	hbLib.bindSymbol(cast(void**)&hb_font_get_h_extents, "hb_font_get_h_extents");
276 	hbLib.bindSymbol(cast(void**)&hb_font_get_v_extents, "hb_font_get_v_extents");
277 	hbLib.bindSymbol(cast(void**)&hb_font_get_nominal_glyph, "hb_font_get_nominal_glyph");
278 	hbLib.bindSymbol(cast(void**)&hb_font_get_variation_glyph, "hb_font_get_variation_glyph");
279 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_h_advance, "hb_font_get_glyph_h_advance");
280 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_v_advance, "hb_font_get_glyph_v_advance");
281 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_h_origin, "hb_font_get_glyph_h_origin");
282 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_v_origin, "hb_font_get_glyph_v_origin");
283 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_h_kerning, "hb_font_get_glyph_h_kerning");
284 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_extents, "hb_font_get_glyph_extents");
285 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_contour_point, "hb_font_get_glyph_contour_point");
286 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_name, "hb_font_get_glyph_name");
287 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_from_name, "hb_font_get_glyph_from_name");
288 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph, "hb_font_get_glyph");
289 	hbLib.bindSymbol(cast(void**)&hb_font_get_extents_for_direction, "hb_font_get_extents_for_direction");
290 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_advance_for_direction, "hb_font_get_glyph_advance_for_direction");
291 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_origin_for_direction, "hb_font_get_glyph_origin_for_direction");
292 	hbLib.bindSymbol(cast(void**)&hb_font_add_glyph_origin_for_direction, "hb_font_add_glyph_origin_for_direction");
293 	hbLib.bindSymbol(cast(void**)&hb_font_subtract_glyph_origin_for_direction, "hb_font_subtract_glyph_origin_for_direction");
294 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_kerning_for_direction, "hb_font_get_glyph_kerning_for_direction");
295 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_extents_for_origin, "hb_font_get_glyph_extents_for_origin");
296 	hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_contour_point_for_origin, "hb_font_get_glyph_contour_point_for_origin");
297 	hbLib.bindSymbol(cast(void**)&hb_font_glyph_to_string, "hb_font_glyph_to_string");
298 	hbLib.bindSymbol(cast(void**)&hb_font_glyph_from_string, "hb_font_glyph_from_string");
299 	hbLib.bindSymbol(cast(void**)&hb_font_create, "hb_font_create");
300 	hbLib.bindSymbol(cast(void**)&hb_font_create_sub_font, "hb_font_create_sub_font");
301 	hbLib.bindSymbol(cast(void**)&hb_font_get_empty, "hb_font_get_empty");
302 	hbLib.bindSymbol(cast(void**)&hb_font_reference, "hb_font_reference");
303 	hbLib.bindSymbol(cast(void**)&hb_font_destroy, "hb_font_destroy");
304 	hbLib.bindSymbol(cast(void**)&hb_font_set_user_data, "hb_font_set_user_data");
305 	hbLib.bindSymbol(cast(void**)&hb_font_get_user_data, "hb_font_get_user_data");
306 	hbLib.bindSymbol(cast(void**)&hb_font_make_immutable, "hb_font_make_immutable");
307 	hbLib.bindSymbol(cast(void**)&hb_font_is_immutable, "hb_font_is_immutable");
308 	hbLib.bindSymbol(cast(void**)&hb_font_set_parent, "hb_font_set_parent");
309 	hbLib.bindSymbol(cast(void**)&hb_font_get_parent, "hb_font_get_parent");
310 	hbLib.bindSymbol(cast(void**)&hb_font_set_face, "hb_font_set_face");
311 	hbLib.bindSymbol(cast(void**)&hb_font_get_face, "hb_font_get_face");
312 	hbLib.bindSymbol(cast(void**)&hb_font_set_funcs, "hb_font_set_funcs");
313 	hbLib.bindSymbol(cast(void**)&hb_font_set_funcs_data, "hb_font_set_funcs_data");
314 	hbLib.bindSymbol(cast(void**)&hb_font_set_scale, "hb_font_set_scale");
315 	hbLib.bindSymbol(cast(void**)&hb_font_get_scale, "hb_font_get_scale");
316 	hbLib.bindSymbol(cast(void**)&hb_font_set_ppem, "hb_font_set_ppem");
317 	hbLib.bindSymbol(cast(void**)&hb_font_get_ppem, "hb_font_get_ppem");
318 	hbLib.bindSymbol(cast(void**)&hb_font_set_ptem, "hb_font_set_ptem");
319 	hbLib.bindSymbol(cast(void**)&hb_font_get_ptem, "hb_font_get_ptem");
320 	hbLib.bindSymbol(cast(void**)&hb_font_set_variations, "hb_font_set_variations");
321 	hbLib.bindSymbol(cast(void**)&hb_font_set_var_coords_design, "hb_font_set_var_coords_design");
322 	hbLib.bindSymbol(cast(void**)&hb_font_set_var_coords_normalized, "hb_font_set_var_coords_normalized");
323 	hbLib.bindSymbol(cast(void**)&hb_font_get_var_coords_normalized, "hb_font_get_var_coords_normalized");
324 
325 	version(HB_with_freetype)
326 	version(Have_bindbc_freetype)
327 	{
328 		import bindbc.hb.bind.ft;
329 		hbLib.bindSymbol(cast(void**)&hb_ft_face_create, "hb_ft_face_create");
330 		hbLib.bindSymbol(cast(void**)&hb_ft_face_create_cached, "hb_ft_face_create_cached");
331 		hbLib.bindSymbol(cast(void**)&hb_ft_face_create_referenced, "hb_ft_face_create_referenced");
332 		hbLib.bindSymbol(cast(void**)&hb_ft_font_create, "hb_ft_font_create");
333 		hbLib.bindSymbol(cast(void**)&hb_ft_font_create_referenced, "hb_ft_font_create_referenced");
334 		hbLib.bindSymbol(cast(void**)&hb_ft_font_get_face, "hb_ft_font_get_face");
335 		hbLib.bindSymbol(cast(void**)&hb_ft_font_set_load_flags, "hb_ft_font_set_load_flags");
336 		hbLib.bindSymbol(cast(void**)&hb_ft_font_get_load_flags, "hb_ft_font_get_load_flags");
337 		hbLib.bindSymbol(cast(void**)&hb_ft_font_changed, "hb_ft_font_changed");
338 		hbLib.bindSymbol(cast(void**)&hb_ft_font_set_funcs, "hb_ft_font_set_funcs");
339 	}
340 	
341 	version(Windows)
342 	version(HB_with_gdi)
343 	{
344 		import bindbc.hb.bind.gdi;
345 		hbLib.bindSymbol(cast(void**)&hb_gdi_face_create, "hb_gdi_face_create");
346 	}
347 	
348 	version(HB_with_graphite2)
349 	{
350 		import bindbc.hb.bind.graphite2;
351 		hbLib.bindSymbol(cast(void**)&hb_graphite2_face_get_gr_face, "hb_graphite2_face_get_gr_face");
352 		hbLib.bindSymbol(cast(void**)&hb_graphite2_font_get_gr_font, "hb_graphite2_font_get_gr_font");
353 	}
354 
355 	version(HB_with_icu)
356 	{
357 		import bindbc.hb.bind.icu;
358 		hbLib.bindSymbol(cast(void**)&hb_icu_script_to_script, "hb_icu_script_to_script");
359 		hbLib.bindSymbol(cast(void**)&hb_icu_script_from_script, "hb_icu_script_from_script");
360 		hbLib.bindSymbol(cast(void**)&hb_icu_get_unicode_funcs, "hb_icu_get_unicode_funcs");
361 	}
362 	
363 	import bindbc.hb.bind.set;
364 	hbLib.bindSymbol(cast(void**)&hb_set_create, "hb_set_create");
365 	hbLib.bindSymbol(cast(void**)&hb_set_get_empty, "hb_set_get_empty");
366 	hbLib.bindSymbol(cast(void**)&hb_set_reference, "hb_set_reference");
367 	hbLib.bindSymbol(cast(void**)&hb_set_destroy, "hb_set_destroy");
368 	hbLib.bindSymbol(cast(void**)&hb_set_set_user_data, "hb_set_set_user_data");
369 	hbLib.bindSymbol(cast(void**)&hb_set_get_user_data, "hb_set_get_user_data");
370 	hbLib.bindSymbol(cast(void**)&hb_set_allocation_successful, "hb_set_allocation_successful");
371 	hbLib.bindSymbol(cast(void**)&hb_set_clear, "hb_set_clear");
372 	hbLib.bindSymbol(cast(void**)&hb_set_is_empty, "hb_set_is_empty");
373 	hbLib.bindSymbol(cast(void**)&hb_set_has, "hb_set_has");
374 	hbLib.bindSymbol(cast(void**)&hb_set_add, "hb_set_add");
375 	hbLib.bindSymbol(cast(void**)&hb_set_add_range, "hb_set_add_range");
376 	hbLib.bindSymbol(cast(void**)&hb_set_del, "hb_set_del");
377 	hbLib.bindSymbol(cast(void**)&hb_set_del_range, "hb_set_del_range");
378 	hbLib.bindSymbol(cast(void**)&hb_set_is_equal, "hb_set_is_equal");
379 	hbLib.bindSymbol(cast(void**)&hb_set_set, "hb_set_set");
380 	hbLib.bindSymbol(cast(void**)&hb_set_union, "hb_set_union");
381 	hbLib.bindSymbol(cast(void**)&hb_set_intersect, "hb_set_intersect");
382 	hbLib.bindSymbol(cast(void**)&hb_set_subtract, "hb_set_subtract");
383 	hbLib.bindSymbol(cast(void**)&hb_set_symmetric_difference, "hb_set_symmetric_difference");
384 	hbLib.bindSymbol(cast(void**)&hb_set_get_population, "hb_set_get_population");
385 	hbLib.bindSymbol(cast(void**)&hb_set_get_min, "hb_set_get_min");
386 	hbLib.bindSymbol(cast(void**)&hb_set_get_max, "hb_set_get_max");
387 	hbLib.bindSymbol(cast(void**)&hb_set_next, "hb_set_next");
388 	hbLib.bindSymbol(cast(void**)&hb_set_next_range, "hb_set_next_range");
389 
390 	import bindbc.hb.bind.shape;
391 	hbLib.bindSymbol(cast(void**)&hb_shape, "hb_shape");
392 	hbLib.bindSymbol(cast(void**)&hb_shape_full, "hb_shape_full");
393 	hbLib.bindSymbol(cast(void**)&hb_shape_list_shapers, "hb_shape_list_shapers");
394 
395 	import bindbc.hb.bind.shape_plan;
396 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_create, "hb_shape_plan_create");
397 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_create_cached, "hb_shape_plan_create_cached");
398 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_create2, "hb_shape_plan_create2");
399 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_create_cached2, "hb_shape_plan_create_cached2");
400 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_get_empty, "hb_shape_plan_get_empty");
401 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_reference, "hb_shape_plan_reference");
402 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_destroy, "hb_shape_plan_destroy");
403 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_set_user_data, "hb_shape_plan_set_user_data");
404 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_get_user_data, "hb_shape_plan_get_user_data");
405 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_execute, "hb_shape_plan_execute");
406 	hbLib.bindSymbol(cast(void**)&hb_shape_plan_get_shaper, "hb_shape_plan_get_shaper");
407 
408 	import bindbc.hb.bind.unicode;
409 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_get_default, "hb_unicode_funcs_get_default");
410 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_create, "hb_unicode_funcs_create");
411 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_get_empty, "hb_unicode_funcs_get_empty");
412 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_reference, "hb_unicode_funcs_reference");
413 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_destroy, "hb_unicode_funcs_destroy");
414 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_user_data, "hb_unicode_funcs_set_user_data");
415 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_get_user_data, "hb_unicode_funcs_get_user_data");
416 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_make_immutable, "hb_unicode_funcs_make_immutable");
417 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_is_immutable, "hb_unicode_funcs_is_immutable");
418 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_get_parent, "hb_unicode_funcs_get_parent");
419 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_combining_class_func, "hb_unicode_funcs_set_combining_class_func");
420 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_general_category_func, "hb_unicode_funcs_set_general_category_func");
421 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_mirroring_func, "hb_unicode_funcs_set_mirroring_func");
422 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_script_func, "hb_unicode_funcs_set_script_func");
423 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_compose_func, "hb_unicode_funcs_set_compose_func");
424 	hbLib.bindSymbol(cast(void**)&hb_unicode_funcs_set_decompose_func, "hb_unicode_funcs_set_decompose_func");
425 	hbLib.bindSymbol(cast(void**)&hb_unicode_combining_class, "hb_unicode_combining_class");
426 	hbLib.bindSymbol(cast(void**)&hb_unicode_general_category, "hb_unicode_general_category");
427 	hbLib.bindSymbol(cast(void**)&hb_unicode_mirroring, "hb_unicode_mirroring");
428 	hbLib.bindSymbol(cast(void**)&hb_unicode_script, "hb_unicode_script");
429 	hbLib.bindSymbol(cast(void**)&hb_unicode_compose, "hb_unicode_compose");
430 	hbLib.bindSymbol(cast(void**)&hb_unicode_decompose, "hb_unicode_decompose");
431 
432 	version(Windows)
433 	version(HB_with_uniscribe)
434 	{
435 		import bindbc.hb.bind.uniscribe;
436 		hbLib.bindSymbol(cast(void**)&hb_uniscribe_font_get_logfontw, "hb_uniscribe_font_get_logfontw");
437 		hbLib.bindSymbol(cast(void**)&hb_uniscribe_font_get_hfont, "hb_uniscribe_font_get_hfont");
438 	}
439 
440 	import bindbc.hb.bind.version_;
441 	hbLib.bindSymbol(cast(void**)&hb_version, "hb_version");
442 	hbLib.bindSymbol(cast(void**)&hb_version_string, "hb_version_string");
443 	hbLib.bindSymbol(cast(void**)&hb_version_atleast, "hb_version_atleast");
444 
445 	version(HB_with_deprecated)
446 	{
447 		import bindbc.hb.bind.ot.deprecated_;
448 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_table_choose_script, "hb_ot_layout_table_choose_script");
449 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_script_find_language, "hb_ot_layout_script_find_language");
450 		hbLib.bindSymbol(cast(void**)&hb_ot_tags_from_script, "hb_ot_tags_from_script");
451 		hbLib.bindSymbol(cast(void**)&hb_ot_tag_from_language, "hb_ot_tag_from_language");
452 		hbLib.bindSymbol(cast(void**)&hb_ot_var_get_axes, "hb_ot_var_get_axes");
453 		hbLib.bindSymbol(cast(void**)&hb_ot_var_find_axis, "hb_ot_var_find_axis");
454 	}
455 
456 	import bindbc.hb.bind.ot.font;
457 	hbLib.bindSymbol(cast(void**)&hb_ot_font_set_funcs, "hb_ot_font_set_funcs");
458 
459 	import bindbc.hb.bind.ot.layout;
460 	hbLib.bindSymbol(cast(void**)&hb_ot_tag_to_script, "hb_ot_tag_to_script");
461 	hbLib.bindSymbol(cast(void**)&hb_ot_tag_to_language, "hb_ot_tag_to_language");
462 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_has_glyph_classes, "hb_ot_layout_has_glyph_classes");
463 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_get_glyph_class, "hb_ot_layout_get_glyph_class");
464 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_get_glyphs_in_class, "hb_ot_layout_get_glyphs_in_class");
465 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_get_attach_points, "hb_ot_layout_get_attach_points");
466 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_get_ligature_carets, "hb_ot_layout_get_ligature_carets");
467 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_table_get_script_tags, "hb_ot_layout_table_get_script_tags");
468 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_table_find_script, "hb_ot_layout_table_find_script");
469 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_table_get_feature_tags, "hb_ot_layout_table_get_feature_tags");
470 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_script_get_language_tags, "hb_ot_layout_script_get_language_tags");
471 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_language_get_required_feature_index, "hb_ot_layout_language_get_required_feature_index");
472 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_language_get_required_feature, "hb_ot_layout_language_get_required_feature");
473 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_language_get_feature_indexes, "hb_ot_layout_language_get_feature_indexes");
474 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_language_get_feature_tags, "hb_ot_layout_language_get_feature_tags");
475 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_language_find_feature, "hb_ot_layout_language_find_feature");
476 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_feature_get_lookups, "hb_ot_layout_feature_get_lookups");
477 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_table_get_lookup_count, "hb_ot_layout_table_get_lookup_count");
478 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_collect_lookups, "hb_ot_layout_collect_lookups");
479 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_lookup_collect_glyphs, "hb_ot_layout_lookup_collect_glyphs");
480 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_table_find_feature_variations, "hb_ot_layout_table_find_feature_variations");
481 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_feature_with_variations_get_lookups, "hb_ot_layout_feature_with_variations_get_lookups");
482 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_has_substitution, "hb_ot_layout_has_substitution");
483 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_lookup_would_substitute, "hb_ot_layout_lookup_would_substitute");
484 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_lookup_substitute_closure, "hb_ot_layout_lookup_substitute_closure");
485 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_has_positioning, "hb_ot_layout_has_positioning");
486 	hbLib.bindSymbol(cast(void**)&hb_ot_layout_get_size_params, "hb_ot_layout_get_size_params");
487 
488 	import bindbc.hb.bind.ot.math;
489 	hbLib.bindSymbol(cast(void**)&hb_ot_math_has_data, "hb_ot_math_has_data");
490 	hbLib.bindSymbol(cast(void**)&hb_ot_math_get_constant, "hb_ot_math_get_constant");
491 	hbLib.bindSymbol(cast(void**)&hb_ot_math_get_glyph_italics_correction, "hb_ot_math_get_glyph_italics_correction");
492 	hbLib.bindSymbol(cast(void**)&hb_ot_math_get_glyph_top_accent_attachment, "hb_ot_math_get_glyph_top_accent_attachment");
493 	hbLib.bindSymbol(cast(void**)&hb_ot_math_is_glyph_extended_shape, "hb_ot_math_is_glyph_extended_shape");
494 	hbLib.bindSymbol(cast(void**)&hb_ot_math_get_glyph_kerning, "hb_ot_math_get_glyph_kerning");
495 	hbLib.bindSymbol(cast(void**)&hb_ot_math_get_glyph_variants, "hb_ot_math_get_glyph_variants");
496 	hbLib.bindSymbol(cast(void**)&hb_ot_math_get_min_connector_overlap, "hb_ot_math_get_min_connector_overlap");
497 	hbLib.bindSymbol(cast(void**)&hb_ot_math_get_glyph_assembly, "hb_ot_math_get_glyph_assembly");
498 
499 	import bindbc.hb.bind.ot.shape;
500 	hbLib.bindSymbol(cast(void**)&hb_ot_shape_glyphs_closure, "hb_ot_shape_glyphs_closure");
501 	hbLib.bindSymbol(cast(void**)&hb_ot_shape_plan_collect_lookups, "hb_ot_shape_plan_collect_lookups");
502 
503 	import bindbc.hb.bind.ot.var;
504 	hbLib.bindSymbol(cast(void**)&hb_ot_var_has_data, "hb_ot_var_has_data");
505 	hbLib.bindSymbol(cast(void**)&hb_ot_var_get_axis_count, "hb_ot_var_get_axis_count");
506 	hbLib.bindSymbol(cast(void**)&hb_ot_var_normalize_variations, "hb_ot_var_normalize_variations");
507 	hbLib.bindSymbol(cast(void**)&hb_ot_var_normalize_coords, "hb_ot_var_normalize_coords");
508 	
509 	if (errorCount() != lastErrorCount)
510 		return HBSupport.badLibrary;
511 	else
512 		hbLoadedVersion = HBSupport.v1_7_2;
513 	
514 	version(HB_with_subset)
515 	{
516 		static if (hbSupport >= 20500)
517 		{
518 			import bindbc.hb.bind.subset;
519 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_create_or_fail, "hb_subset_input_create_or_fail");
520 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_reference, "hb_subset_input_reference");
521 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_destroy, "hb_subset_input_destroy");
522 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_unicode_set, "hb_subset_input_unicode_set");
523 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_glyph_set, "hb_subset_input_glyph_set");
524 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_nameid_set, "hb_subset_input_nameid_set");
525 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_drop_tables_set, "hb_subset_input_drop_tables_set");
526 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_set_drop_hints, "hb_subset_input_set_drop_hints");
527 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_get_drop_hints, "hb_subset_input_get_drop_hints");
528 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_set_desubroutinize, "hb_subset_input_set_desubroutinize");
529 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_get_desubroutinize, "hb_subset_input_get_desubroutinize");
530 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_set_retain_gids, "hb_subset_input_set_retain_gids");
531 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset_input_get_retain_gids, "hb_subset_input_get_retain_gids");
532 			hbSubsetLib.bindSymbol(cast(void**)&hb_subset, "hb_subset");
533 		}
534 		else
535 			static assert(false, "Subset library is only supported for versions >= 2.5.0");
536 	}
537 	
538 	static if (hbSupport >= HBSupport.v2_6_3)
539 	{
540 		import bindbc.hb.bind.aat.layout;
541 		hbLib.bindSymbol(cast(void**)&hb_aat_layout_feature_type_get_name_id, "hb_aat_layout_feature_type_get_name_id");
542 		hbLib.bindSymbol(cast(void**)&hb_aat_layout_feature_type_get_selector_infos, "hb_aat_layout_feature_type_get_selector_infos");
543 		hbLib.bindSymbol(cast(void**)&hb_aat_layout_get_feature_types, "hb_aat_layout_get_feature_types");
544 		hbLib.bindSymbol(cast(void**)&hb_aat_layout_has_positioning, "hb_aat_layout_has_positioning");
545 		hbLib.bindSymbol(cast(void**)&hb_aat_layout_has_substitution, "hb_aat_layout_has_substitution");
546 		hbLib.bindSymbol(cast(void**)&hb_aat_layout_has_tracking, "hb_aat_layout_has_tracking");
547 		
548 		import bindbc.hb.bind.blob;
549 		hbLib.bindSymbol(cast(void**)&hb_blob_copy_writable_or_fail, "hb_blob_copy_writable_or_fail");
550 		hbLib.bindSymbol(cast(void**)&hb_blob_create_from_file, "hb_blob_create_from_file");
551 		
552 		import bindbc.hb.bind.buffer;
553 		hbLib.bindSymbol(cast(void**)&hb_buffer_get_invisible_glyph, "hb_buffer_get_invisible_glyph");
554 		hbLib.bindSymbol(cast(void**)&hb_buffer_set_invisible_glyph, "hb_buffer_set_invisible_glyph");
555 		
556 		//import bindbc.hb.bind.common;
557 		//hbLib.bindSymbol(cast(void**)&hb_color_get_alpha, "hb_color_get_alpha");
558 		//hbLib.bindSymbol(cast(void**)&hb_color_get_blue, "hb_color_get_blue");
559 		//hbLib.bindSymbol(cast(void**)&hb_color_get_green, "hb_color_get_green");
560 		//hbLib.bindSymbol(cast(void**)&hb_color_get_red, "hb_color_get_red");
561 		
562 		import bindbc.hb.bind.face;
563 		hbLib.bindSymbol(cast(void**)&hb_face_builder_add_table, "hb_face_builder_add_table");
564 		hbLib.bindSymbol(cast(void**)&hb_face_builder_create, "hb_face_builder_create");
565 		hbLib.bindSymbol(cast(void**)&hb_face_collect_unicodes, "hb_face_collect_unicodes");
566 		hbLib.bindSymbol(cast(void**)&hb_face_collect_variation_selectors, "hb_face_collect_variation_selectors");
567 		hbLib.bindSymbol(cast(void**)&hb_face_collect_variation_unicodes, "hb_face_collect_variation_unicodes");
568 		hbLib.bindSymbol(cast(void**)&hb_face_count, "hb_face_count");
569 		
570 		import bindbc.hb.bind.font;
571 		hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_h_advances_func, "hb_font_funcs_set_glyph_h_advances_func");
572 		hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_glyph_v_advances_func, "hb_font_funcs_set_glyph_v_advances_func");
573 		hbLib.bindSymbol(cast(void**)&hb_font_funcs_set_nominal_glyphs_func, "hb_font_funcs_set_nominal_glyphs_func");
574 		hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_advances_for_direction, "hb_font_get_glyph_advances_for_direction");
575 		hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_h_advances, "hb_font_get_glyph_h_advances");
576 		hbLib.bindSymbol(cast(void**)&hb_font_get_glyph_v_advances, "hb_font_get_glyph_v_advances");
577 		hbLib.bindSymbol(cast(void**)&hb_font_get_nominal_glyphs, "hb_font_get_nominal_glyphs");
578 		hbLib.bindSymbol(cast(void**)&hb_font_set_var_named_instance, "hb_font_set_var_named_instance");
579 		
580 		import bindbc.hb.bind.map;
581 		hbLib.bindSymbol(cast(void**)&hb_map_allocation_successful, "hb_map_allocation_successful");
582 		hbLib.bindSymbol(cast(void**)&hb_map_clear, "hb_map_clear");
583 		hbLib.bindSymbol(cast(void**)&hb_map_create, "hb_map_create");
584 		hbLib.bindSymbol(cast(void**)&hb_map_del, "hb_map_del");
585 		hbLib.bindSymbol(cast(void**)&hb_map_destroy, "hb_map_destroy");
586 		hbLib.bindSymbol(cast(void**)&hb_map_get, "hb_map_get");
587 		hbLib.bindSymbol(cast(void**)&hb_map_get_empty, "hb_map_get_empty");
588 		hbLib.bindSymbol(cast(void**)&hb_map_get_population, "hb_map_get_population");
589 		hbLib.bindSymbol(cast(void**)&hb_map_get_user_data, "hb_map_get_user_data");
590 		hbLib.bindSymbol(cast(void**)&hb_map_has, "hb_map_has");
591 		hbLib.bindSymbol(cast(void**)&hb_map_is_empty, "hb_map_is_empty");
592 		hbLib.bindSymbol(cast(void**)&hb_map_reference, "hb_map_reference");
593 		hbLib.bindSymbol(cast(void**)&hb_map_set, "hb_map_set");
594 		hbLib.bindSymbol(cast(void**)&hb_map_set_user_data, "hb_map_set_user_data");
595 		
596 		import bindbc.hb.bind.ot.color;
597 		hbLib.bindSymbol(cast(void**)&hb_ot_color_glyph_get_layers, "hb_ot_color_glyph_get_layers");
598 		hbLib.bindSymbol(cast(void**)&hb_ot_color_glyph_reference_png, "hb_ot_color_glyph_reference_png");
599 		hbLib.bindSymbol(cast(void**)&hb_ot_color_glyph_reference_svg, "hb_ot_color_glyph_reference_svg");
600 		hbLib.bindSymbol(cast(void**)&hb_ot_color_has_layers, "hb_ot_color_has_layers");
601 		hbLib.bindSymbol(cast(void**)&hb_ot_color_has_palettes, "hb_ot_color_has_palettes");
602 		hbLib.bindSymbol(cast(void**)&hb_ot_color_has_png, "hb_ot_color_has_png");
603 		hbLib.bindSymbol(cast(void**)&hb_ot_color_has_svg, "hb_ot_color_has_svg");
604 		hbLib.bindSymbol(cast(void**)&hb_ot_color_palette_color_get_name_id, "hb_ot_color_palette_color_get_name_id");
605 		hbLib.bindSymbol(cast(void**)&hb_ot_color_palette_get_colors, "hb_ot_color_palette_get_colors");
606 		hbLib.bindSymbol(cast(void**)&hb_ot_color_palette_get_count, "hb_ot_color_palette_get_count");
607 		hbLib.bindSymbol(cast(void**)&hb_ot_color_palette_get_flags, "hb_ot_color_palette_get_flags");
608 		hbLib.bindSymbol(cast(void**)&hb_ot_color_palette_get_name_id, "hb_ot_color_palette_get_name_id");
609 		
610 		import bindbc.hb.bind.ot.layout;
611 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_collect_features, "hb_ot_layout_collect_features");
612 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_feature_get_characters, "hb_ot_layout_feature_get_characters");
613 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_feature_get_name_ids, "hb_ot_layout_feature_get_name_ids");
614 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_get_baseline, "hb_ot_layout_get_baseline");
615 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_lookups_substitute_closure, "hb_ot_layout_lookups_substitute_closure");
616 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_script_select_language, "hb_ot_layout_script_select_language");
617 		hbLib.bindSymbol(cast(void**)&hb_ot_layout_table_select_script, "hb_ot_layout_table_select_script");
618 		hbLib.bindSymbol(cast(void**)&hb_ot_tags_from_script_and_language, "hb_ot_tags_from_script_and_language");
619 		hbLib.bindSymbol(cast(void**)&hb_ot_tags_to_script_and_language, "hb_ot_tags_to_script_and_language");
620 		
621 		import bindbc.hb.bind.ot.meta;
622 		hbLib.bindSymbol(cast(void**)&hb_ot_meta_get_entry_tags, "hb_ot_meta_get_entry_tags");
623 		hbLib.bindSymbol(cast(void**)&hb_ot_meta_reference_entry, "hb_ot_meta_reference_entry");
624 		
625 		import bindbc.hb.bind.ot.metrics;
626 		hbLib.bindSymbol(cast(void**)&hb_ot_metrics_get_position, "hb_ot_metrics_get_position");
627 		hbLib.bindSymbol(cast(void**)&hb_ot_metrics_get_variation, "hb_ot_metrics_get_variation");
628 		hbLib.bindSymbol(cast(void**)&hb_ot_metrics_get_x_variation, "hb_ot_metrics_get_x_variation");
629 		hbLib.bindSymbol(cast(void**)&hb_ot_metrics_get_y_variation, "hb_ot_metrics_get_y_variation");
630 		
631 		import bindbc.hb.bind.ot.name;
632 		hbLib.bindSymbol(cast(void**)&hb_ot_name_get_utf16, "hb_ot_name_get_utf16");
633 		hbLib.bindSymbol(cast(void**)&hb_ot_name_get_utf32, "hb_ot_name_get_utf32");
634 		hbLib.bindSymbol(cast(void**)&hb_ot_name_get_utf8, "hb_ot_name_get_utf8");
635 		hbLib.bindSymbol(cast(void**)&hb_ot_name_list_names, "hb_ot_name_list_names");
636 		
637 		import bindbc.hb.bind.ot.var;
638 		hbLib.bindSymbol(cast(void**)&hb_ot_var_find_axis_info, "hb_ot_var_find_axis_info");
639 		hbLib.bindSymbol(cast(void**)&hb_ot_var_get_axis_infos, "hb_ot_var_get_axis_infos");
640 		hbLib.bindSymbol(cast(void**)&hb_ot_var_get_named_instance_count, "hb_ot_var_get_named_instance_count");
641 		hbLib.bindSymbol(cast(void**)&hb_ot_var_named_instance_get_design_coords, "hb_ot_var_named_instance_get_design_coords");
642 		hbLib.bindSymbol(cast(void**)&hb_ot_var_named_instance_get_postscript_name_id, "hb_ot_var_named_instance_get_postscript_name_id");
643 		hbLib.bindSymbol(cast(void**)&hb_ot_var_named_instance_get_subfamily_name_id, "hb_ot_var_named_instance_get_subfamily_name_id");
644 		
645 		import bindbc.hb.bind.set;
646 		hbLib.bindSymbol(cast(void**)&hb_set_is_subset, "hb_set_is_subset");
647 		hbLib.bindSymbol(cast(void**)&hb_set_previous, "hb_set_previous");
648 		hbLib.bindSymbol(cast(void**)&hb_set_previous_range, "hb_set_previous_range");
649 
650 		if (errorCount() != lastErrorCount)
651 			return HBSupport.badLibrary;
652 		else
653 			hbLoadedVersion = HBSupport.v2_6_3;
654 	}
655 	
656 	return hbLoadedVersion;
657 }