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