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.face; 8 9 import bindbc.hb.config; 10 11 import bindbc.hb.bind.blob; 12 import bindbc.hb.bind.common; 13 import bindbc.hb.bind.set; 14 15 extern(C) @nogc nothrow: 16 17 static if (hbSupport >= HBSupport.v2_6_3) 18 { 19 version(BindHB_Static) 20 uint hb_face_count (hb_blob_t* blob); 21 else 22 { 23 private alias fp_hb_face_count = uint function (hb_blob_t* blob); 24 __gshared fp_hb_face_count hb_face_count; 25 } 26 } 27 28 /* 29 * hb_face_t 30 */ 31 32 struct hb_face_t; 33 34 version(BindHB_Static) 35 hb_face_t* hb_face_create (hb_blob_t* blob, uint index); 36 else 37 { 38 private alias fp_hb_face_create = hb_face_t* function (hb_blob_t* blob, uint index); 39 __gshared fp_hb_face_create hb_face_create; 40 } 41 42 alias hb_reference_table_func_t = hb_blob_t* function (hb_face_t* face, hb_tag_t tag, void* user_data); 43 44 /* calls destroy() when not needing user_data anymore */ 45 version(BindHB_Static) 46 hb_face_t* hb_face_create_for_tables ( 47 hb_reference_table_func_t reference_table_func, 48 void* user_data, 49 hb_destroy_func_t destroy); 50 else 51 { 52 private alias fp_hb_face_create_for_tables = hb_face_t* function ( 53 hb_reference_table_func_t reference_table_func, 54 void* user_data, 55 hb_destroy_func_t destroy); 56 __gshared fp_hb_face_create_for_tables hb_face_create_for_tables; 57 } 58 59 version(BindHB_Static) 60 hb_face_t* hb_face_get_empty (); 61 else 62 { 63 private alias fp_hb_face_get_empty = hb_face_t* function (); 64 __gshared fp_hb_face_get_empty hb_face_get_empty; 65 } 66 67 version(BindHB_Static) 68 hb_face_t* hb_face_reference (hb_face_t* face); 69 else 70 { 71 private alias fp_hb_face_reference = hb_face_t* function (hb_face_t* face); 72 __gshared fp_hb_face_reference hb_face_reference; 73 } 74 75 version(BindHB_Static) 76 void hb_face_destroy (hb_face_t* face); 77 else 78 { 79 private alias fp_hb_face_destroy = void function (hb_face_t* face); 80 __gshared fp_hb_face_destroy hb_face_destroy; 81 } 82 83 version(BindHB_Static) 84 hb_bool_t hb_face_set_user_data ( 85 hb_face_t* face, 86 hb_user_data_key_t* key, 87 void* data, 88 hb_destroy_func_t destroy, 89 hb_bool_t replace); 90 else 91 { 92 private alias fp_hb_face_set_user_data = hb_bool_t function ( 93 hb_face_t* face, 94 hb_user_data_key_t* key, 95 void* data, 96 hb_destroy_func_t destroy, 97 hb_bool_t replace); 98 __gshared fp_hb_face_set_user_data hb_face_set_user_data; 99 } 100 101 version(BindHB_Static) 102 void* hb_face_get_user_data (const(hb_face_t)* face, hb_user_data_key_t* key); 103 else 104 { 105 private alias fp_hb_face_get_user_data = void* function (const(hb_face_t)* face, hb_user_data_key_t* key); 106 __gshared fp_hb_face_get_user_data hb_face_get_user_data; 107 } 108 109 version(BindHB_Static) 110 void hb_face_make_immutable (hb_face_t* face); 111 else 112 { 113 private alias fp_hb_face_make_immutable = void function (hb_face_t* face); 114 __gshared fp_hb_face_make_immutable hb_face_make_immutable; 115 } 116 117 version(BindHB_Static) 118 hb_bool_t hb_face_is_immutable (const(hb_face_t)* face); 119 else 120 { 121 private alias fp_hb_face_is_immutable = hb_bool_t function (const(hb_face_t)* face); 122 __gshared fp_hb_face_is_immutable hb_face_is_immutable; 123 } 124 125 version(BindHB_Static) 126 hb_blob_t* hb_face_reference_table (const(hb_face_t)* face, hb_tag_t tag); 127 else 128 { 129 private alias fp_hb_face_reference_table = hb_blob_t* function (const(hb_face_t)* face, hb_tag_t tag); 130 __gshared fp_hb_face_reference_table hb_face_reference_table; 131 } 132 133 version(BindHB_Static) 134 hb_blob_t* hb_face_reference_blob (hb_face_t* face); 135 else 136 { 137 private alias fp_hb_face_reference_blob = hb_blob_t* function (hb_face_t* face); 138 __gshared fp_hb_face_reference_blob hb_face_reference_blob; 139 } 140 141 version(BindHB_Static) 142 void hb_face_set_index (hb_face_t* face, uint index); 143 else 144 { 145 private alias fp_hb_face_set_index = void function (hb_face_t* face, uint index); 146 __gshared fp_hb_face_set_index hb_face_set_index; 147 } 148 149 version(BindHB_Static) 150 uint hb_face_get_index (const(hb_face_t)* face); 151 else 152 { 153 private alias fp_hb_face_get_index = uint function (const(hb_face_t)* face); 154 __gshared fp_hb_face_get_index hb_face_get_index; 155 } 156 157 version(BindHB_Static) 158 void hb_face_set_upem (hb_face_t* face, uint upem); 159 else 160 { 161 private alias fp_hb_face_set_upem = void function (hb_face_t* face, uint upem); 162 __gshared fp_hb_face_set_upem hb_face_set_upem; 163 } 164 165 version(BindHB_Static) 166 uint hb_face_get_upem (const(hb_face_t)* face); 167 else 168 { 169 private alias fp_hb_face_get_upem = uint function (const(hb_face_t)* face); 170 __gshared fp_hb_face_get_upem hb_face_get_upem; 171 } 172 173 version(BindHB_Static) 174 void hb_face_set_glyph_count (hb_face_t* face, uint glyph_count); 175 else 176 { 177 private alias fp_hb_face_set_glyph_count = void function (hb_face_t* face, uint glyph_count); 178 __gshared fp_hb_face_set_glyph_count hb_face_set_glyph_count; 179 } 180 181 version(BindHB_Static) 182 uint hb_face_get_glyph_count (const(hb_face_t)* face); 183 else 184 { 185 private alias fp_hb_face_get_glyph_count = uint function (const(hb_face_t)* face); 186 __gshared fp_hb_face_get_glyph_count hb_face_get_glyph_count; 187 } 188 189 /* IN/OUT */ 190 /* OUT */ 191 version(BindHB_Static) 192 uint hb_face_get_table_tags ( 193 const(hb_face_t)* face, 194 uint start_offset, 195 uint* table_count, 196 hb_tag_t* table_tags); 197 else 198 { 199 private alias fp_hb_face_get_table_tags = uint function ( 200 const(hb_face_t)* face, 201 uint start_offset, 202 uint* table_count, 203 hb_tag_t* table_tags); 204 __gshared fp_hb_face_get_table_tags hb_face_get_table_tags; 205 } 206 207 static if (hbSupport >= HBSupport.v2_6_3) 208 { 209 /* 210 * Character set. 211 */ 212 213 version(BindHB_Static) 214 void hb_face_collect_unicodes (hb_face_t* face, hb_set_t* out_); 215 else 216 { 217 private alias fp_hb_face_collect_unicodes = void function (hb_face_t* face, hb_set_t* out_); 218 __gshared fp_hb_face_collect_unicodes hb_face_collect_unicodes; 219 } 220 221 version(BindHB_Static) 222 void hb_face_collect_variation_selectors (hb_face_t* face, hb_set_t* out_); 223 else 224 { 225 private alias fp_hb_face_collect_variation_selectors = void function (hb_face_t* face, hb_set_t* out_); 226 __gshared fp_hb_face_collect_variation_selectors hb_face_collect_variation_selectors; 227 } 228 229 version(BindHB_Static) 230 void hb_face_collect_variation_unicodes ( 231 hb_face_t* face, 232 hb_codepoint_t variation_selector, 233 hb_set_t* out_); 234 else 235 { 236 private alias fp_hb_face_collect_variation_unicodes = void function ( 237 hb_face_t* face, 238 hb_codepoint_t variation_selector, 239 hb_set_t* out_); 240 __gshared fp_hb_face_collect_variation_unicodes hb_face_collect_variation_unicodes; 241 } 242 243 /* 244 * Builder face. 245 */ 246 247 version(BindHB_Static) 248 hb_face_t* hb_face_builder_create (); 249 else 250 { 251 private alias fp_hb_face_builder_create = hb_face_t* function (); 252 __gshared fp_hb_face_builder_create hb_face_builder_create; 253 } 254 255 version(BindHB_Static) 256 hb_bool_t hb_face_builder_add_table ( 257 hb_face_t* face, 258 hb_tag_t tag, 259 hb_blob_t* blob); 260 else 261 { 262 private alias fp_hb_face_builder_add_table = hb_bool_t function ( 263 hb_face_t* face, 264 hb_tag_t tag, 265 hb_blob_t* blob); 266 __gshared fp_hb_face_builder_add_table hb_face_builder_add_table; 267 } 268 }