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 *metrics,
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
128
129typedef hb_position_t (*hb_font_get_glyph_advance_func_t) (hb_font_t *font, void *font_data,
130 hb_codepoint_t glyph,
131 void *user_data);
132typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_h_advance_func_t;
133typedef hb_font_get_glyph_advance_func_t hb_font_get_glyph_v_advance_func_t;
134
135typedef void (*hb_font_get_glyph_advances_func_t) (hb_font_t* font, void* font_data,
136 unsigned count,
137 hb_codepoint_t *first_glyph,
138 unsigned glyph_stride,
139 hb_position_t *first_advance,
140 unsigned advance_stride,
141 void *user_data);
142typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_h_advances_func_t;
143typedef hb_font_get_glyph_advances_func_t hb_font_get_glyph_v_advances_func_t;
144
145typedef hb_bool_t (*hb_font_get_glyph_origin_func_t) (hb_font_t *font, void *font_data,
146 hb_codepoint_t glyph,
147 hb_position_t *x, hb_position_t *y,
148 void *user_data);
149typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_h_origin_func_t;
150typedef hb_font_get_glyph_origin_func_t hb_font_get_glyph_v_origin_func_t;
151
152typedef hb_position_t (*hb_font_get_glyph_kerning_func_t) (hb_font_t *font, void *font_data,
153 hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
154 void *user_data);
155typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_h_kerning_func_t;
156typedef hb_font_get_glyph_kerning_func_t hb_font_get_glyph_v_kerning_func_t;
157
158
159typedef hb_bool_t (*hb_font_get_glyph_extents_func_t) (hb_font_t *font, void *font_data,
160 hb_codepoint_t glyph,
161 hb_glyph_extents_t *extents,
162 void *user_data);
163typedef hb_bool_t (*hb_font_get_glyph_contour_point_func_t) (hb_font_t *font, void *font_data,
164 hb_codepoint_t glyph, unsigned int point_index,
165 hb_position_t *x, hb_position_t *y,
166 void *user_data);
167
168
169typedef hb_bool_t (*hb_font_get_glyph_name_func_t) (hb_font_t *font, void *font_data,
170 hb_codepoint_t glyph,
171 char *name, unsigned int size,
172 void *user_data);
173typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *font_data,
174 const char *name, int len, /* -1 means nul-terminated */
175 hb_codepoint_t *glyph,
176 void *user_data);
177
178
179/* func setters */
180
181/**
182 * hb_font_funcs_set_font_h_extents_func:
183 * @ffuncs: font functions.
184 * @func: (closure user_data) (destroy destroy) (scope notified):
185 * @user_data:
186 * @destroy:
187 *
188 *
189 *
190 * Since: 1.1.2
191 **/
192HB_EXTERN void
193hb_font_funcs_set_font_h_extents_func (hb_font_funcs_t *ffuncs,
194 hb_font_get_font_h_extents_func_t func,
195 void *user_data, hb_destroy_func_t destroy);
196
197/**
198 * hb_font_funcs_set_font_v_extents_func:
199 * @ffuncs: font functions.
200 * @func: (closure user_data) (destroy destroy) (scope notified):
201 * @user_data:
202 * @destroy:
203 *
204 *
205 *
206 * Since: 1.1.2
207 **/
208HB_EXTERN void
209hb_font_funcs_set_font_v_extents_func (hb_font_funcs_t *ffuncs,
210 hb_font_get_font_v_extents_func_t func,
211 void *user_data, hb_destroy_func_t destroy);
212
213/**
214 * hb_font_funcs_set_nominal_glyph_func:
215 * @ffuncs: font functions.
216 * @func: (closure user_data) (destroy destroy) (scope notified):
217 * @user_data:
218 * @destroy:
219 *
220 *
221 *
222 * Since: 1.2.3
223 **/
224HB_EXTERN void
225hb_font_funcs_set_nominal_glyph_func (hb_font_funcs_t *ffuncs,
226 hb_font_get_nominal_glyph_func_t func,
227 void *user_data, hb_destroy_func_t destroy);
228
229/**
230 * hb_font_funcs_set_variation_glyph_func:
231 * @ffuncs: font functions.
232 * @func: (closure user_data) (destroy destroy) (scope notified):
233 * @user_data:
234 * @destroy:
235 *
236 *
237 *
238 * Since: 1.2.3
239 **/
240HB_EXTERN void
241hb_font_funcs_set_variation_glyph_func (hb_font_funcs_t *ffuncs,
242 hb_font_get_variation_glyph_func_t func,
243 void *user_data, hb_destroy_func_t destroy);
244
245/**
246 * hb_font_funcs_set_glyph_h_advance_func:
247 * @ffuncs: font functions.
248 * @func: (closure user_data) (destroy destroy) (scope notified):
249 * @user_data:
250 * @destroy:
251 *
252 *
253 *
254 * Since: 0.9.2
255 **/
256HB_EXTERN void
257hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
258 hb_font_get_glyph_h_advance_func_t func,
259 void *user_data, hb_destroy_func_t destroy);
260
261/**
262 * hb_font_funcs_set_glyph_v_advance_func:
263 * @ffuncs: font functions.
264 * @func: (closure user_data) (destroy destroy) (scope notified):
265 * @user_data:
266 * @destroy:
267 *
268 *
269 *
270 * Since: 0.9.2
271 **/
272HB_EXTERN void
273hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
274 hb_font_get_glyph_v_advance_func_t func,
275 void *user_data, hb_destroy_func_t destroy);
276
277/**
278 * hb_font_funcs_set_glyph_h_advances_func:
279 * @ffuncs: font functions.
280 * @func: (closure user_data) (destroy destroy) (scope notified):
281 * @user_data:
282 * @destroy:
283 *
284 *
285 *
286 * Since: 1.8.6
287 **/
288HB_EXTERN void
289hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
290 hb_font_get_glyph_h_advances_func_t func,
291 void *user_data, hb_destroy_func_t destroy);
292
293/**
294 * hb_font_funcs_set_glyph_v_advances_func:
295 * @ffuncs: font functions.
296 * @func: (closure user_data) (destroy destroy) (scope notified):
297 * @user_data:
298 * @destroy:
299 *
300 *
301 *
302 * Since: 1.8.6
303 **/
304HB_EXTERN void
305hb_font_funcs_set_glyph_v_advances_func (hb_font_funcs_t *ffuncs,
306 hb_font_get_glyph_v_advances_func_t func,
307 void *user_data, hb_destroy_func_t destroy);
308
309/**
310 * hb_font_funcs_set_glyph_h_origin_func:
311 * @ffuncs: font functions.
312 * @func: (closure user_data) (destroy destroy) (scope notified):
313 * @user_data:
314 * @destroy:
315 *
316 *
317 *
318 * Since: 0.9.2
319 **/
320HB_EXTERN void
321hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
322 hb_font_get_glyph_h_origin_func_t func,
323 void *user_data, hb_destroy_func_t destroy);
324
325/**
326 * hb_font_funcs_set_glyph_v_origin_func:
327 * @ffuncs: font functions.
328 * @func: (closure user_data) (destroy destroy) (scope notified):
329 * @user_data:
330 * @destroy:
331 *
332 *
333 *
334 * Since: 0.9.2
335 **/
336HB_EXTERN void
337hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
338 hb_font_get_glyph_v_origin_func_t func,
339 void *user_data, hb_destroy_func_t destroy);
340
341/**
342 * hb_font_funcs_set_glyph_h_kerning_func:
343 * @ffuncs: font functions.
344 * @func: (closure user_data) (destroy destroy) (scope notified):
345 * @user_data:
346 * @destroy:
347 *
348 *
349 *
350 * Since: 0.9.2
351 **/
352HB_EXTERN void
353hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
354 hb_font_get_glyph_h_kerning_func_t func,
355 void *user_data, hb_destroy_func_t destroy);
356
357/**
358 * hb_font_funcs_set_glyph_v_kerning_func:
359 * @ffuncs: font functions.
360 * @func: (closure user_data) (destroy destroy) (scope notified):
361 * @user_data:
362 * @destroy:
363 *
364 *
365 *
366 * Since: 0.9.2
367 **/
368HB_EXTERN void
369hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
370 hb_font_get_glyph_v_kerning_func_t func,
371 void *user_data, hb_destroy_func_t destroy);
372
373/**
374 * hb_font_funcs_set_glyph_extents_func:
375 * @ffuncs: font functions.
376 * @func: (closure user_data) (destroy destroy) (scope notified):
377 * @user_data:
378 * @destroy:
379 *
380 *
381 *
382 * Since: 0.9.2
383 **/
384HB_EXTERN void
385hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
386 hb_font_get_glyph_extents_func_t func,
387 void *user_data, hb_destroy_func_t destroy);
388
389/**
390 * hb_font_funcs_set_glyph_contour_point_func:
391 * @ffuncs: font functions.
392 * @func: (closure user_data) (destroy destroy) (scope notified):
393 * @user_data:
394 * @destroy:
395 *
396 *
397 *
398 * Since: 0.9.2
399 **/
400HB_EXTERN void
401hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
402 hb_font_get_glyph_contour_point_func_t func,
403 void *user_data, hb_destroy_func_t destroy);
404
405/**
406 * hb_font_funcs_set_glyph_name_func:
407 * @ffuncs: font functions.
408 * @func: (closure user_data) (destroy destroy) (scope notified):
409 * @user_data:
410 * @destroy:
411 *
412 *
413 *
414 * Since: 0.9.2
415 **/
416HB_EXTERN void
417hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
418 hb_font_get_glyph_name_func_t func,
419 void *user_data, hb_destroy_func_t destroy);
420
421/**
422 * hb_font_funcs_set_glyph_from_name_func:
423 * @ffuncs: font functions.
424 * @func: (closure user_data) (destroy destroy) (scope notified):
425 * @user_data:
426 * @destroy:
427 *
428 *
429 *
430 * Since: 0.9.2
431 **/
432HB_EXTERN void
433hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs,
434 hb_font_get_glyph_from_name_func_t func,
435 void *user_data, hb_destroy_func_t destroy);
436
437/* func dispatch */
438
439HB_EXTERN hb_bool_t
440hb_font_get_h_extents (hb_font_t *font,
441 hb_font_extents_t *extents);
442HB_EXTERN hb_bool_t
443hb_font_get_v_extents (hb_font_t *font,
444 hb_font_extents_t *extents);
445
446HB_EXTERN hb_bool_t
447hb_font_get_nominal_glyph (hb_font_t *font,
448 hb_codepoint_t unicode,
449 hb_codepoint_t *glyph);
450HB_EXTERN hb_bool_t
451hb_font_get_variation_glyph (hb_font_t *font,
452 hb_codepoint_t unicode, hb_codepoint_t variation_selector,
453 hb_codepoint_t *glyph);
454
455HB_EXTERN hb_position_t
456hb_font_get_glyph_h_advance (hb_font_t *font,
457 hb_codepoint_t glyph);
458HB_EXTERN hb_position_t
459hb_font_get_glyph_v_advance (hb_font_t *font,
460 hb_codepoint_t glyph);
461
462HB_EXTERN void
463hb_font_get_glyph_h_advances (hb_font_t* font,
464 unsigned count,
465 hb_codepoint_t *first_glyph,
466 unsigned glyph_stride,
467 hb_position_t *first_advance,
468 unsigned advance_stride);
469HB_EXTERN void
470hb_font_get_glyph_v_advances (hb_font_t* font,
471 unsigned count,
472 hb_codepoint_t *first_glyph,
473 unsigned glyph_stride,
474 hb_position_t *first_advance,
475 unsigned advance_stride);
476
477HB_EXTERN hb_bool_t
478hb_font_get_glyph_h_origin (hb_font_t *font,
479 hb_codepoint_t glyph,
480 hb_position_t *x, hb_position_t *y);
481HB_EXTERN hb_bool_t
482hb_font_get_glyph_v_origin (hb_font_t *font,
483 hb_codepoint_t glyph,
484 hb_position_t *x, hb_position_t *y);
485
486HB_EXTERN hb_position_t
487hb_font_get_glyph_h_kerning (hb_font_t *font,
488 hb_codepoint_t left_glyph, hb_codepoint_t right_glyph);
489HB_EXTERN hb_position_t
490hb_font_get_glyph_v_kerning (hb_font_t *font,
491 hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph);
492
493HB_EXTERN hb_bool_t
494hb_font_get_glyph_extents (hb_font_t *font,
495 hb_codepoint_t glyph,
496 hb_glyph_extents_t *extents);
497
498HB_EXTERN hb_bool_t
499hb_font_get_glyph_contour_point (hb_font_t *font,
500 hb_codepoint_t glyph, unsigned int point_index,
501 hb_position_t *x, hb_position_t *y);
502
503HB_EXTERN hb_bool_t
504hb_font_get_glyph_name (hb_font_t *font,
505 hb_codepoint_t glyph,
506 char *name, unsigned int size);
507HB_EXTERN hb_bool_t
508hb_font_get_glyph_from_name (hb_font_t *font,
509 const char *name, int len, /* -1 means nul-terminated */
510 hb_codepoint_t *glyph);
511
512
513/* high-level funcs, with fallback */
514
515/* Calls either hb_font_get_nominal_glyph() if variation_selector is 0,
516 * otherwise calls hb_font_get_variation_glyph(). */
517HB_EXTERN hb_bool_t
518hb_font_get_glyph (hb_font_t *font,
519 hb_codepoint_t unicode, hb_codepoint_t variation_selector,
520 hb_codepoint_t *glyph);
521
522HB_EXTERN void
523hb_font_get_extents_for_direction (hb_font_t *font,
524 hb_direction_t direction,
525 hb_font_extents_t *extents);
526HB_EXTERN void
527hb_font_get_glyph_advance_for_direction (hb_font_t *font,
528 hb_codepoint_t glyph,
529 hb_direction_t direction,
530 hb_position_t *x, hb_position_t *y);
531HB_EXTERN void
532hb_font_get_glyph_advances_for_direction (hb_font_t* font,
533 hb_direction_t direction,
534 unsigned count,
535 hb_codepoint_t *first_glyph,
536 unsigned glyph_stride,
537 hb_position_t *first_advance,
538 unsigned advance_stride);
539HB_EXTERN void
540hb_font_get_glyph_origin_for_direction (hb_font_t *font,
541 hb_codepoint_t glyph,
542 hb_direction_t direction,
543 hb_position_t *x, hb_position_t *y);
544HB_EXTERN void
545hb_font_add_glyph_origin_for_direction (hb_font_t *font,
546 hb_codepoint_t glyph,
547 hb_direction_t direction,
548 hb_position_t *x, hb_position_t *y);
549HB_EXTERN void
550hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
551 hb_codepoint_t glyph,
552 hb_direction_t direction,
553 hb_position_t *x, hb_position_t *y);
554
555HB_EXTERN void
556hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
557 hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
558 hb_direction_t direction,
559 hb_position_t *x, hb_position_t *y);
560
561HB_EXTERN hb_bool_t
562hb_font_get_glyph_extents_for_origin (hb_font_t *font,
563 hb_codepoint_t glyph,
564 hb_direction_t direction,
565 hb_glyph_extents_t *extents);
566
567HB_EXTERN hb_bool_t
568hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
569 hb_codepoint_t glyph, unsigned int point_index,
570 hb_direction_t direction,
571 hb_position_t *x, hb_position_t *y);
572
573/* Generates gidDDD if glyph has no name. */
574HB_EXTERN void
575hb_font_glyph_to_string (hb_font_t *font,
576 hb_codepoint_t glyph,
577 char *s, unsigned int size);
578/* Parses gidDDD and uniUUUU strings automatically. */
579HB_EXTERN hb_bool_t
580hb_font_glyph_from_string (hb_font_t *font,
581 const char *s, int len, /* -1 means nul-terminated */
582 hb_codepoint_t *glyph);
583
584
585/*
586 * hb_font_t
587 */
588
589/* Fonts are very light-weight objects */
590
591HB_EXTERN hb_font_t *
592hb_font_create (hb_face_t *face);
593
594HB_EXTERN hb_font_t *
595hb_font_create_sub_font (hb_font_t *parent);
596
597HB_EXTERN hb_font_t *
598hb_font_get_empty (void);
599
600HB_EXTERN hb_font_t *
601hb_font_reference (hb_font_t *font);
602
603HB_EXTERN void
604hb_font_destroy (hb_font_t *font);
605
606HB_EXTERN hb_bool_t
607hb_font_set_user_data (hb_font_t *font,
608 hb_user_data_key_t *key,
609 void * data,
610 hb_destroy_func_t destroy,
611 hb_bool_t replace);
612
613
614HB_EXTERN void *
615hb_font_get_user_data (hb_font_t *font,
616 hb_user_data_key_t *key);
617
618HB_EXTERN void
619hb_font_make_immutable (hb_font_t *font);
620
621HB_EXTERN hb_bool_t
622hb_font_is_immutable (hb_font_t *font);
623
624HB_EXTERN void
625hb_font_set_parent (hb_font_t *font,
626 hb_font_t *parent);
627
628HB_EXTERN hb_font_t *
629hb_font_get_parent (hb_font_t *font);
630
631HB_EXTERN void
632hb_font_set_face (hb_font_t *font,
633 hb_face_t *face);
634
635HB_EXTERN hb_face_t *
636hb_font_get_face (hb_font_t *font);
637
638
639HB_EXTERN void
640hb_font_set_funcs (hb_font_t *font,
641 hb_font_funcs_t *klass,
642 void *font_data,
643 hb_destroy_func_t destroy);
644
645/* Be *very* careful with this function! */
646HB_EXTERN void
647hb_font_set_funcs_data (hb_font_t *font,
648 void *font_data,
649 hb_destroy_func_t destroy);
650
651
652HB_EXTERN void
653hb_font_set_scale (hb_font_t *font,
654 int x_scale,
655 int y_scale);
656
657HB_EXTERN void
658hb_font_get_scale (hb_font_t *font,
659 int *x_scale,
660 int *y_scale);
661
662/*
663 * A zero value means "no hinting in that direction"
664 */
665HB_EXTERN void
666hb_font_set_ppem (hb_font_t *font,
667 unsigned int x_ppem,
668 unsigned int y_ppem);
669
670HB_EXTERN void
671hb_font_get_ppem (hb_font_t *font,
672 unsigned int *x_ppem,
673 unsigned int *y_ppem);
674
675/*
676 * Point size per EM. Used for optical-sizing in CoreText.
677 * A value of zero means "not set".
678 */
679HB_EXTERN void
680hb_font_set_ptem (hb_font_t *font, float ptem);
681
682HB_EXTERN float
683hb_font_get_ptem (hb_font_t *font);
684
685HB_EXTERN void
686hb_font_set_variations (hb_font_t *font,
687 const hb_variation_t *variations,
688 unsigned int variations_length);
689
690HB_EXTERN void
691hb_font_set_var_coords_design (hb_font_t *font,
692 const float *coords,
693 unsigned int coords_length);
694
695HB_EXTERN void
696hb_font_set_var_coords_normalized (hb_font_t *font,
697 const int *coords, /* 2.14 normalized */
698 unsigned int coords_length);
699
700HB_EXTERN const int *
701hb_font_get_var_coords_normalized (hb_font_t *font,
702 unsigned int *length);
703
704HB_END_DECLS
705
706#endif /* HB_FONT_H */
707