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.subset;
8 
9 import bindbc.hb.config;
10 
11 version(HB_with_subset):
12 
13 pragma(msg, "Warning: HarfBuzz Subset API is not stable and subject to breaking changes.");
14 
15 static if (hbSupport >= 20500)
16 {
17 	import bindbc.hb.bind.common;
18 	import bindbc.hb.bind.face;
19 	import bindbc.hb.bind.set;
20 
21 	extern(C) @nogc nothrow:
22 
23 	/*
24 	 * hb_subset_input_t
25 	 *
26 	 * Things that change based on the input. Characters to keep, etc.
27 	 */
28 
29 	struct hb_subset_input_t;
30 
31 	version(BindHB_Static)
32 		hb_subset_input_t* hb_subset_input_create_or_fail ();
33 	else
34 	{
35 		private alias fp_hb_subset_input_create_or_fail = hb_subset_input_t* function ();
36 		__gshared fp_hb_subset_input_create_or_fail hb_subset_input_create_or_fail;
37 	}
38 
39 	version(BindHB_Static)
40 		hb_subset_input_t* hb_subset_input_reference (hb_subset_input_t* subset_input);
41 	else
42 	{
43 		private alias fp_hb_subset_input_reference = hb_subset_input_t* function (hb_subset_input_t* subset_input);
44 		__gshared fp_hb_subset_input_reference hb_subset_input_reference;
45 	}
46 
47 	version(BindHB_Static)
48 		void hb_subset_input_destroy (hb_subset_input_t* subset_input);
49 	else
50 	{
51 		private alias fp_hb_subset_input_destroy = void function (hb_subset_input_t* subset_input);
52 		__gshared fp_hb_subset_input_destroy hb_subset_input_destroy;
53 	}
54 
55 	version(BindHB_Static)
56 		hb_set_t* hb_subset_input_unicode_set (hb_subset_input_t* subset_input);
57 	else
58 	{
59 		private alias fp_hb_subset_input_unicode_set = hb_set_t* function (hb_subset_input_t* subset_input);
60 		__gshared fp_hb_subset_input_unicode_set hb_subset_input_unicode_set;
61 	}
62 
63 	version(BindHB_Static)
64 		hb_set_t* hb_subset_input_glyph_set (hb_subset_input_t* subset_input);
65 	else
66 	{
67 		private alias fp_hb_subset_input_glyph_set = hb_set_t* function (hb_subset_input_t* subset_input);
68 		__gshared fp_hb_subset_input_glyph_set hb_subset_input_glyph_set;
69 	}
70 
71 	version(BindHB_Static)
72 		hb_set_t* hb_subset_input_nameid_set (hb_subset_input_t* subset_input);
73 	else
74 	{
75 		private alias fp_hb_subset_input_nameid_set = hb_set_t* function (hb_subset_input_t* subset_input);
76 		__gshared fp_hb_subset_input_nameid_set hb_subset_input_nameid_set;
77 	}
78 
79 	version(BindHB_Static)
80 		hb_set_t* hb_subset_input_drop_tables_set (hb_subset_input_t* subset_input);
81 	else
82 	{
83 		private alias fp_hb_subset_input_drop_tables_set = hb_set_t* function (hb_subset_input_t* subset_input);
84 		__gshared fp_hb_subset_input_drop_tables_set hb_subset_input_drop_tables_set;
85 	}
86 
87 	version(BindHB_Static)
88 		void hb_subset_input_set_drop_hints (
89 			hb_subset_input_t* subset_input,
90 			hb_bool_t drop_hints);
91 	else
92 	{
93 		private alias fp_hb_subset_input_set_drop_hints = void function (
94 			hb_subset_input_t* subset_input,
95 			hb_bool_t drop_hints);
96 		__gshared fp_hb_subset_input_set_drop_hints hb_subset_input_set_drop_hints;
97 	}
98 	version(BindHB_Static)
99 		hb_bool_t hb_subset_input_get_drop_hints (hb_subset_input_t* subset_input);
100 	else
101 	{
102 		private alias fp_hb_subset_input_get_drop_hints = hb_bool_t function (hb_subset_input_t* subset_input);
103 		__gshared fp_hb_subset_input_get_drop_hints hb_subset_input_get_drop_hints;
104 	}
105 
106 	version(BindHB_Static)
107 		void hb_subset_input_set_desubroutinize (
108 			hb_subset_input_t* subset_input,
109 			hb_bool_t desubroutinize);
110 	else
111 	{
112 		private alias fp_hb_subset_input_set_desubroutinize = void function (
113 			hb_subset_input_t* subset_input,
114 			hb_bool_t desubroutinize);
115 		__gshared fp_hb_subset_input_set_desubroutinize hb_subset_input_set_desubroutinize;
116 	}
117 	version(BindHB_Static)
118 		hb_bool_t hb_subset_input_get_desubroutinize (hb_subset_input_t* subset_input);
119 	else
120 	{
121 		private alias fp_hb_subset_input_get_desubroutinize = hb_bool_t function (hb_subset_input_t* subset_input);
122 		__gshared fp_hb_subset_input_get_desubroutinize hb_subset_input_get_desubroutinize;
123 	}
124 
125 	version(BindHB_Static)
126 		void hb_subset_input_set_retain_gids (
127 			hb_subset_input_t* subset_input,
128 			hb_bool_t retain_gids);
129 	else
130 	{
131 		private alias fp_hb_subset_input_set_retain_gids = void function (
132 			hb_subset_input_t* subset_input,
133 			hb_bool_t retain_gids);
134 		__gshared fp_hb_subset_input_set_retain_gids hb_subset_input_set_retain_gids;
135 	}
136 	version(BindHB_Static)
137 		hb_bool_t hb_subset_input_get_retain_gids (hb_subset_input_t* subset_input);
138 	else
139 	{
140 		private alias fp_hb_subset_input_get_retain_gids = hb_bool_t function (hb_subset_input_t* subset_input);
141 		__gshared fp_hb_subset_input_get_retain_gids hb_subset_input_get_retain_gids;
142 	}
143 
144 	/* hb_subset () */
145 	version(BindHB_Static)
146 		hb_face_t* hb_subset (hb_face_t* source, hb_subset_input_t* input);
147 	else
148 	{
149 		private alias fp_hb_subset = hb_face_t* function (hb_face_t* source, hb_subset_input_t* input);
150 		__gshared fp_hb_subset hb_subset;
151 	}
152 }