1/*
2 * Copyright © 2009 Red Hat, Inc.
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 * Red Hat Author(s): Behdad Esfahbod
25 */
26
27#ifndef HB_H_IN
28#error "Include <hb.h> instead."
29#endif
30
31#ifndef HB_FONT_H
32#define HB_FONT_H
33
34#include "hb-common.h"
35#include "hb-face.h"
36
37HB_BEGIN_DECLS
38
39
40typedef struct hb_font_t hb_font_t;
41
42
43/*
44 * hb_font_funcs_t
45 */
46
47typedef struct hb_font_funcs_t hb_font_funcs_t;
48
49HB_EXTERN hb_font_funcs_t *
50hb_font_funcs_create (void);
51
52HB_EXTERN hb_font_funcs_t *
53hb_font_funcs_get_empty (void);
54
55HB_EXTERN hb_font_funcs_t *
56hb_font_funcs_reference (hb_font_funcs_t *ffuncs);
57
58HB_EXTERN void
59hb_font_funcs_destroy (hb_font_funcs_t *ffuncs);
60
61HB_EXTERN hb_bool_t
62hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
63 hb_user_data_key_t *key,
64 void * data,
65 hb_destroy_func_t destroy,
66 hb_bool_t replace);
67
68
69HB_EXTERN void *
70hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
71 hb_user_data_key_t *key);
72
73
74HB_EXTERN void
75hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs);
76
77HB_EXTERN hb_bool_t
78hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs);
79
80
81/* font and glyph extents */
82
83/* Note that typically ascender is positive and descender negative in coordinate systems that grow up. */
84typedef struct hb_font_extents_t
85{
86 hb_position_t ascender; /* typographic ascender. */
87 hb_position_t descender; /* typographic descender. */
88 hb_position_t line_gap; /* suggested line spacing gap. */
89 /*< private >*/
90 hb_position_t reserved9;
91 hb_position_t reserved8;
92 hb_position_t reserved7;
93 hb_position_t reserved6;
94 hb_position_t reserved5;
95 hb_position_t reserved4;
96 hb_position_t reserved3;
97 hb_position_t reserved2;
98 hb_position_t reserved1;
99} hb_font_extents_t;
100
101/* Note that height is negative in coordinate systems that grow up. */
102typedef struct hb_glyph_extents_t
103{
104 hb_position_t x_bearing; /* left side of glyph from origin. */
105 hb_position_t y_bearing; /* top side of glyph from origin. */
106 hb_position_t width; /* distance from left to right side. */
107 hb_position_t height; /* distance from top to bottom side. */
108} hb_glyph_extents_t;
109
110/* func types */
111
112typedef hb_bool_t (*hb_font_get_font_extents_func_t) (hb_font_t *font, void *font_data,
113 hb_font_extents_t *extents,
114 void *user_data);
115typedef hb_font_get_font_extents_func_t hb_font_get_font_h_extents_func_t;
116typedef hb_font_get_font_extents_func_t hb_font_get_font_v_extents_func_t;
117
118
119typedef hb_bool_t (*hb_font_get_nominal_glyph_func_t) (hb_font_t *font, void *font_data,
120 hb_codepoint_t unicode,
121 hb_codepoint_t *glyph,
122 void *user_data);
123typedef hb_bool_t (*hb_font_get_variation_glyph_func_t) (hb_font_t *font, void *font_data,
124 hb_codepoint_t unicode, hb_codepoint_t variation_selector,
125 hb_codepoint_t *glyph,
126 void *user_data);
127
128typedef unsigned int (*hb_font_get_nominal_glyphs_func_t) (hb_font_t *font, void *font_data,
129 unsigned int count,
130 const hb_codepoint_t *first_unicode,
131 unsigned int unicode_stride,
132 hb_codepoint_t *first_glyph,
133 unsigned int glyph_stride,
134 void *user_data);
135
136
137typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data,
138 hb_codepoint_t glyph,
139 void *user_data);
140typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t;
141typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t;
142
143typedef void (*hb_font_get_glyph_advances_func_t) (hb_font_t* font, void* font_data,
144 unsigned int count,
145 const hb_codepoint_t *first_glyph,
146 unsigned glyph_stride,
147 hb_position_t *first_advance,
148 unsigned advance_stride,
149 void *user_data);
150typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_h_advances_func_t;
151typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_v_advances_func_t;
152
153typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *font_data,
154 hb_codepoint_t glyph,
155 hb_position_t *x, hb_position_t *y,
156 void *user_data);
157typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t;
158typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t;
159
160typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data,
161 hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
162 void *user_data);
163typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;
164
165
166typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data,
167 hb_codepoint_t glyph,
168 hb_glyph_extents_t *extents,
169 void *user_data);
170typedef hb_bool_t (*hb_font_get_glyph_contour_point_func_t) (hb_font_t *font, void *font_data,
171 hb_codepoint_t glyph, unsigned int point_index,
172 hb_position_t *x, hb_position_t *y,
173 void *user_data);
174
175
176typedef hb_bool_t (*hb_font_get_glyph_name_func_t) (hb_font_t *font, void *font_data,
177 hb_codepoint_t glyph,
178 char *name, unsigned int size,
179 void *user_data);
180typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *font_data,
181 const char *name, int len, /* -1 means nul-terminated */
182 hb_codepoint_t *glyph,
183 void *user_data);
184
185
186/* func setters */
187
188/**
189 * hb_font_funcs_set_font_h_extents_func:
190 * @ffuncs: font functions.
191 * @func: (closure user_data) (destroy destroy) (scope notified):
192 * @user_data:
193 * @destroy:
194 *
195 *
196 *
197 * Since: 1.1.2
198 **/
199HB_EXTERN void
200hb_font_funcs_set_font_h_extents_func (hb_font_funcs_t *ffuncs,
201 hb_font_get_font_h_extents_func_t func,
202 void *user_data, hb_destroy_func_t destroy);
203
204/**
205 * hb_font_funcs_set_font_v_extents_func:
206 * @ffuncs: font functions.
207 * @func: (closure user_data) (destroy destroy) (scope notified):
208 * @user_data:
209 * @destroy:
210 *
211 *
212 *
213 * Since: 1.1.2
214 **/
215HB_EXTERN void
216hb_font_funcs_set_font_v_extents_func (hb_font_funcs_t *ffuncs,
217 hb_font_get_font_v_extents_func_t func,
218 void *user_data, hb_destroy_func_t destroy);
219
220/**
221 * hb_font_funcs_set_nominal_glyph_func:
222 * @ffuncs: font functions.
223 * @func: (closure user_data) (destroy destroy) (scope notified):
224 * @user_data:
225 * @destroy:
226 *
227 *
228 *
229 * Since: 1.2.3
230 **/
231HB_EXTERN void
232hb_font_funcs_set_nominal_glyph_func (hb_font_funcs_t *ffuncs,
233 hb_font_get_nominal_glyph_func_t func,
234 void *user_data, hb_destroy_func_t destroy);
235
236/**
237 * hb_font_funcs_set_nominal_glyphs_func:
238 * @ffuncs: font functions.
239 * @func: (closure user_data) (destroy destroy) (scope notified):
240 * @user_data:
241 * @destroy:
242 *
243 *
244 *
245 * Since: 2.0.0
246 **/
247HB_EXTERN void
248hb_font_funcs_set_nominal_glyphs_func (hb_font_funcs_t *ffuncs,
249 hb_font_get_nominal_glyphs_func_t func,
250 void *user_data, hb_destroy_func_t destroy);
251
252/**
253 * hb_font_funcs_set_variation_glyph_func:
254 * @ffuncs: font functions.
255 * @func: (closure user_data) (destroy destroy) (scope notified):
256 * @user_data:
257 * @destroy:
258 *
259 *
260 *
261 * Since: 1.2.3
262 **/
263HB_EXTERN void
264hb_font_funcs_set_variation_glyph_func (hb_font_funcs_t *ffuncs,
265 hb_font_get_variation_glyph_func_t func,
266 void *user_data, hb_destroy_func_t destroy);
267
268/**
269 * hb_font_funcs_set_glyph_h_advance_func:
270 * @ffuncs: font functions.
271 * @func: (closure user_data) (destroy destroy) (scope notified):
272 * @user_data:
273 * @destroy:
274 *
275 *
276 *
277 * Since: 0.9.2
278 **/
279HB_EXTERN void
280hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
281 hb_font_get_glyph_h_advance_func_t func,
282 void *user_data, hb_destroy_func_t destroy);
283
284/**
285 * hb_font_funcs_set_glyph_v_advance_func:
286 * @ffuncs: font functions.
287 * @func: (closure user_data) (destroy destroy) (scope notified):
288 * @user_data:
289 * @destroy:
290 *
291 *
292 *
293 * Since: 0.9.2
294 **/
295HB_EXTERN void
296hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
297 hb_font_get_glyph_v_advance_func_t func,
298 void *user_data, hb_destroy_func_t destroy);
299
300/**
301 * hb_font_funcs_set_glyph_h_advances_func:
302 * @ffuncs: font functions.
303 * @func: (closure user_data) (destroy destroy) (scope notified):
304 * @user_data:
305 * @destroy:
306 *
307 *
308 *
309 * Since: 1.8.6
310 **/
311HB_EXTERN void
312hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
313 hb_font_get_glyph_h_advances_func_t func,
314 void *user_data, hb_destroy_func_t destroy);
315
316/**
317 * hb_font_funcs_set_glyph_v_advances_func:
318 * @ffuncs: font functions.
319 * @func: (closure user_data) (destroy destroy) (scope notified):
320 * @user_data:
321 * @destroy:
322 *
323 *
324 *
325 * Since: 1.8.6
326 **/
327HB_EXTERN void
328hb_font_funcs_set_glyph_v_advances_func (hb_font_funcs_t *ffuncs,
329 hb_font_get_glyph_v_advances_func_t func,
330 void *user_data, hb_destroy_func_t destroy);
331
332/**
333 * hb_font_funcs_set_glyph_h_origin_func:
334 * @ffuncs: font functions.
335 * @func: (closure user_data) (destroy destroy) (scope notified):
336 * @user_data:
337 * @destroy:
338 *
339 *
340 *
341 * Since: 0.9.2
342 **/
343HB_EXTERN void
344hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
345 hb_font_get_glyph_h_origin_func_t func,
346 void *user_data, hb_destroy_func_t destroy);
347
348/**
349 * hb_font_funcs_set_glyph_v_origin_func:
350 * @ffuncs: font functions.
351 * @func: (closure user_data) (destroy destroy) (scope notified):
352 * @user_data:
353 * @destroy:
354 *
355 *
356 *
357 * Since: 0.9.2
358 **/
359HB_EXTERN void
360hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
361 hb_font_get_glyph_v_origin_func_t func,
362 void *user_data, hb_destroy_func_t destroy);
363
364/**
365 * hb_font_funcs_set_glyph_h_kerning_func:
366 * @ffuncs: font functions.
367 * @func: (closure user_data) (destroy destroy) (scope notified):
368 * @user_data:
369 * @destroy:
370 *
371 *
372 *
373 * Since: 0.9.2
374 **/
375HB_EXTERN void
376hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
377 hb_font_get_glyph_h_kerning_func_t func,
378 void *user_data, hb_destroy_func_t destroy);
379
380/**
381 * hb_font_funcs_set_glyph_extents_func:
382 * @ffuncs: font functions.
383 * @func: (closure user_data) (destroy destroy) (scope notified):
384 * @user_data:
385 * @destroy:
386 *
387 *
388 *
389 * Since: 0.9.2
390 **/
391HB_EXTERN void
392hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
393 hb_font_get_glyph_extents_func_t func,
394 void *user_data, hb_destroy_func_t destroy);
395
396/**
397 * hb_font_funcs_set_glyph_contour_point_func:
398 * @ffuncs: font functions.
399 * @func: (closure user_data) (destroy destroy) (scope notified):
400 * @user_data:
401 * @destroy:
402 *
403 *
404 *
405 * Since: 0.9.2
406 **/
407HB_EXTERN void
408hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
409 hb_font_get_glyph_contour_point_func_t func,
410 void *user_data, hb_destroy_func_t destroy);
411
412/**
413 * hb_font_funcs_set_glyph_name_func:
414 * @ffuncs: font functions.
415 * @func: (closure user_data) (destroy destroy) (scope notified):
416 * @user_data:
417 * @destroy:
418 *
419 *
420 *
421 * Since: 0.9.2
422 **/
423HB_EXTERN void
424hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
425 hb_font_get_glyph_name_func_t func,
426 void *user_data, hb_destroy_func_t destroy);
427
428/**
429 * hb_font_funcs_set_glyph_from_name_func:
430 * @ffuncs: font functions.
431 * @func: (closure user_data) (destroy destroy) (scope notified):
432 * @user_data:
433 * @destroy:
434 *
435 *
436 *
437 * Since: 0.9.2
438 **/
439HB_EXTERN void
440hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs,
441 hb_font_get_glyph_from_name_func_t func,
442 void *user_data, hb_destroy_func_t destroy);
443
444/* func dispatch */
445
446HB_EXTERN hb_bool_t
447hb_font_get_h_extents (hb_font_t *font,
448 hb_font_extents_t *extents);
449HB_EXTERN hb_bool_t
450hb_font_get_v_extents (hb_font_t *font,
451 hb_font_extents_t *extents);
452
453HB_EXTERN hb_bool_t
454hb_font_get_nominal_glyph (hb_font_t *font,
455 hb_codepoint_t unicode,
456 hb_codepoint_t *glyph);
457HB_EXTERN hb_bool_t
458hb_font_get_variation_glyph (hb_font_t *font,
459 hb_codepoint_t unicode, hb_codepoint_t variation_selector,
460 hb_codepoint_t *glyph);
461
462HB_EXTERN unsigned int
463hb_font_get_nominal_glyphs (hb_font_t *font,
464 unsigned int count,
465 const hb_codepoint_t *first_unicode,
466 unsigned int unicode_stride,
467 hb_codepoint_t *first_glyph,
468 unsigned int glyph_stride);
469
470HB_EXTERN hb_position_t
471hb_font_get_glyph_h_advance (hb_font_t *font,
472 hb_codepoint_t glyph);
473HB_EXTERN hb_position_t
474hb_font_get_glyph_v_advance (hb_font_t *font,
475 hb_codepoint_t glyph);
476
477HB_EXTERN void
478hb_font_get_glyph_h_advances (hb_font_t* font,
479 unsigned int count,
480 const hb_codepoint_t *first_glyph,
481 unsigned glyph_stride,
482 hb_position_t *first_advance,
483 unsigned advance_stride);
484HB_EXTERN void
485hb_font_get_glyph_v_advances (hb_font_t* font,
486 unsigned int count,
487 const hb_codepoint_t *first_glyph,
488 unsigned glyph_stride,
489 hb_position_t *first_advance,
490 unsigned advance_stride);
491
492HB_EXTERN hb_bool_t
493hb_font_get_glyph_h_origin (hb_font_t *font,
494 hb_codepoint_t glyph,
495 hb_position_t *x, hb_position_t *y);
496HB_EXTERN hb_bool_t
497hb_font_get_glyph_v_origin (hb_font_t *font,
498 hb_codepoint_t glyph,
499 hb_position_t *x, hb_position_t *y);
500
501HB_EXTERN hb_position_t
502hb_font_get_glyph_h_kerning (hb_font_t *font,
503 hb_codepoint_t left_glyph, hb_codepoint_t right_glyph);
504
505HB_EXTERN hb_bool_t
506hb_font_get_glyph_extents (hb_font_t *font,
507 hb_codepoint_t glyph,
508 hb_glyph_extents_t *extents);
509
510HB_EXTERN hb_bool_t
511hb_font_get_glyph_contour_point (hb_font_t *font,
512 hb_codepoint_t glyph, unsigned int point_index,
513 hb_position_t *x, hb_position_t *y);
514
515HB_EXTERN hb_bool_t
516hb_font_get_glyph_name (hb_font_t *font,
517 hb_codepoint_t glyph,
518 char *name, unsigned int size);
519HB_EXTERN hb_bool_t
520hb_font_get_glyph_from_name (hb_font_t *font,
521 const char *name, int len, /* -1 means nul-terminated */
522 hb_codepoint_t *glyph);
523
524
525/* high-level funcs, with fallback */
526
527/* Calls either hb_font_get_nominal_glyph() if variation_selector is 0,
528 * otherwise calls hb_font_get_variation_glyph(). */
529HB_EXTERN hb_bool_t
530hb_font_get_glyph (hb_font_t *font,
531 hb_codepoint_t unicode, hb_codepoint_t variation_selector,
532 hb_codepoint_t *glyph);
533
534HB_EXTERN void
535hb_font_get_extents_for_direction (hb_font_t *font,
536 hb_direction_t direction,
537 hb_font_extents_t *extents);
538HB_EXTERN void
539hb_font_get_glyph_advance_for_direction (hb_font_t *font,
540 hb_codepoint_t glyph,
541 hb_direction_t direction,
542 hb_position_t *x, hb_position_t *y);
543HB_EXTERN void
544hb_font_get_glyph_advances_for_direction (hb_font_t* font,
545 hb_direction_t direction,
546 unsigned int count,
547 const hb_codepoint_t *first_glyph,
548 unsigned glyph_stride,
549 hb_position_t *first_advance,
550 unsigned advance_stride);
551HB_EXTERN void
552hb_font_get_glyph_origin_for_direction (hb_font_t *font,
553 hb_codepoint_t glyph,
554 hb_direction_t direction,
555 hb_position_t *x, hb_position_t *y);
556HB_EXTERN void
557hb_font_add_glyph_origin_for_direction (hb_font_t *font,
558 hb_codepoint_t glyph,
559 hb_direction_t direction,
560 hb_position_t *x, hb_position_t *y);
561HB_EXTERN void
562hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
563 hb_codepoint_t glyph,
564 hb_direction_t direction,
565 hb_position_t *x, hb_position_t *y);
566
567HB_EXTERN void
568hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
569 hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
570 hb_direction_t direction,
571 hb_position_t *x, hb_position_t *y);
572
573HB_EXTERN hb_bool_t
574hb_font_get_glyph_extents_for_origin (hb_font_t *font,
575 hb_codepoint_t glyph,
576 hb_direction_t direction,
577 hb_glyph_extents_t *extents);
578
579HB_EXTERN hb_bool_t
580hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
581 hb_codepoint_t glyph, unsigned int point_index,
582 hb_direction_t direction,
583 hb_position_t *x, hb_position_t *y);
584
585/* Generates gidDDD if glyph has no name. */
586HB_EXTERN void
587hb_font_glyph_to_string (hb_font_t *font,
588 hb_codepoint_t glyph,
589 char *s, unsigned int size);
590/* Parses gidDDD and uniUUUU strings automatically. */
591HB_EXTERN hb_bool_t
592hb_font_glyph_from_string (hb_font_t *font,
593 const char *s, int len, /* -1 means nul-terminated */
594 hb_codepoint_t *glyph);
595
596
597/*
598 * hb_font_t
599 */
600
601/* Fonts are very light-weight objects */
602
603HB_EXTERN hb_font_t *
604hb_font_create (hb_face_t *face);
605
606HB_EXTERN hb_font_t *
607hb_font_create_sub_font (hb_font_t *parent);
608
609HB_EXTERN hb_font_t *
610hb_font_get_empty (void);
611
612HB_EXTERN hb_font_t *
613hb_font_reference (hb_font_t *font);
614
615HB_EXTERN void
616hb_font_destroy (hb_font_t *font);
617
618HB_EXTERN hb_bool_t
619hb_font_set_user_data (hb_font_t *font,
620 hb_user_data_key_t *key,
621 void * data,
622 hb_destroy_func_t destroy,
623 hb_bool_t replace);
624
625
626HB_EXTERN void *
627hb_font_get_user_data (hb_font_t *font,
628 hb_user_data_key_t *key);
629
630HB_EXTERN void
631hb_font_make_immutable (hb_font_t *font);
632
633HB_EXTERN hb_bool_t
634hb_font_is_immutable (hb_font_t *font);
635
636HB_EXTERN void
637hb_font_set_parent (hb_font_t *font,
638 hb_font_t *parent);
639
640HB_EXTERN hb_font_t *
641hb_font_get_parent (hb_font_t *font);
642
643HB_EXTERN void
644hb_font_set_face (hb_font_t *font,
645 hb_face_t *face);
646
647HB_EXTERN hb_face_t *
648hb_font_get_face (hb_font_t *font);
649
650
651HB_EXTERN void
652hb_font_set_funcs (hb_font_t *font,
653 hb_font_funcs_t *klass,
654 void *font_data,
655 hb_destroy_func_t destroy);
656
657/* Be *very* careful with this function! */
658HB_EXTERN void
659hb_font_set_funcs_data (hb_font_t *font,
660 void *font_data,
661 hb_destroy_func_t destroy);
662
663
664HB_EXTERN void
665hb_font_set_scale (hb_font_t *font,
666 int x_scale,
667 int y_scale);
668
669HB_EXTERN void
670hb_font_get_scale (hb_font_t *font,
671 int *x_scale,
672 int *y_scale);
673
674/*
675 * A zero value means "no hinting in that direction"
676 */
677HB_EXTERN void
678hb_font_set_ppem (hb_font_t *font,
679 unsigned int x_ppem,
680 unsigned int y_ppem);
681
682HB_EXTERN void
683hb_font_get_ppem (hb_font_t *font,
684 unsigned int *x_ppem,
685 unsigned int *y_ppem);
686
687/*
688 * Point size per EM. Used for optical-sizing in CoreText.
689 * A value of zero means "not set".
690 */
691HB_EXTERN void
692hb_font_set_ptem (hb_font_t *font, float ptem);
693
694HB_EXTERN float
695hb_font_get_ptem (hb_font_t *font);
696
697HB_EXTERN void
698hb_font_set_variations (hb_font_t *font,
699 const hb_variation_t *variations,
700 unsigned int variations_length);
701
702HB_EXTERN void
703hb_font_set_var_coords_design (hb_font_t *font,
704 const float *coords,
705 unsigned int coords_length);
706
707HB_EXTERN void
708hb_font_set_var_coords_normalized (hb_font_t *font,
709 const int *coords, /* 2.14 normalized */
710 unsigned int coords_length);
711
712HB_EXTERN const int *
713hb_font_get_var_coords_normalized (hb_font_t *font,
714 unsigned int *length);
715
716HB_EXTERN void
717hb_font_set_var_named_instance (hb_font_t *font,
718 unsigned instance_index);
719
720HB_END_DECLS
721
722#endif /* HB_FONT_H */
723