QtBase  v6.3.1
hb-font.hh
Go to the documentation of this file.
1 /*
2  * Copyright © 2009 Red Hat, Inc.
3  * Copyright © 2011 Google, Inc.
4  *
5  * This is part of HarfBuzz, a text shaping library.
6  *
7  * Permission is hereby granted, without written agreement and without
8  * license or royalty fees, to use, copy, modify, and distribute this
9  * software and its documentation for any purpose, provided that the
10  * above copyright notice and the following two paragraphs appear in
11  * all copies of this software.
12  *
13  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17  * DAMAGE.
18  *
19  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24  *
25  * Red Hat Author(s): Behdad Esfahbod
26  * Google Author(s): Behdad Esfahbod
27  */
28 
29 #ifndef HB_FONT_HH
30 #define HB_FONT_HH
31 
32 #include "hb.hh"
33 
34 #include "hb-face.hh"
35 #include "hb-shaper.hh"
36 
37 
38 /*
39  * hb_font_funcs_t
40  */
41 
42 #define HB_FONT_FUNCS_IMPLEMENT_CALLBACKS \
43  HB_FONT_FUNC_IMPLEMENT (font_h_extents) \
44  HB_FONT_FUNC_IMPLEMENT (font_v_extents) \
45  HB_FONT_FUNC_IMPLEMENT (nominal_glyph) \
46  HB_FONT_FUNC_IMPLEMENT (nominal_glyphs) \
47  HB_FONT_FUNC_IMPLEMENT (variation_glyph) \
48  HB_FONT_FUNC_IMPLEMENT (glyph_h_advance) \
49  HB_FONT_FUNC_IMPLEMENT (glyph_v_advance) \
50  HB_FONT_FUNC_IMPLEMENT (glyph_h_advances) \
51  HB_FONT_FUNC_IMPLEMENT (glyph_v_advances) \
52  HB_FONT_FUNC_IMPLEMENT (glyph_h_origin) \
53  HB_FONT_FUNC_IMPLEMENT (glyph_v_origin) \
54  HB_FONT_FUNC_IMPLEMENT (glyph_h_kerning) \
55  HB_IF_NOT_DEPRECATED (HB_FONT_FUNC_IMPLEMENT (glyph_v_kerning)) \
56  HB_FONT_FUNC_IMPLEMENT (glyph_extents) \
57  HB_FONT_FUNC_IMPLEMENT (glyph_contour_point) \
58  HB_FONT_FUNC_IMPLEMENT (glyph_name) \
59  HB_FONT_FUNC_IMPLEMENT (glyph_from_name) \
60  HB_FONT_FUNC_IMPLEMENT (glyph_shape) \
61  /* ^--- Add new callbacks here */
62 
64 {
66 
67  struct {
68 #define HB_FONT_FUNC_IMPLEMENT(name) void *name;
70 #undef HB_FONT_FUNC_IMPLEMENT
72 
73  struct {
74 #define HB_FONT_FUNC_IMPLEMENT(name) hb_destroy_func_t name;
76 #undef HB_FONT_FUNC_IMPLEMENT
78 
79  /* Don't access these directly. Call font->get_*() instead. */
80  union get_t {
81  struct get_funcs_t {
82 #define HB_FONT_FUNC_IMPLEMENT(name) hb_font_get_##name##_func_t name;
84 #undef HB_FONT_FUNC_IMPLEMENT
85  } f;
86  void (*array[0
87 #define HB_FONT_FUNC_IMPLEMENT(name) +1
90  ]) ();
91  } get;
92 };
94 
95 
96 /*
97  * hb_font_t
98  */
99 
100 #define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INSTANTIATE_SHAPERS(shaper, font);
101 #include "hb-shaper-list.hh"
102 #undef HB_SHAPER_IMPLEMENT
103 
104 struct hb_font_t
105 {
107 
110 
111  int32_t x_scale;
112  int32_t y_scale;
113  float slant;
114  float slant_xy;
115  int64_t x_mult;
116  int64_t y_mult;
117 
118  unsigned int x_ppem;
119  unsigned int y_ppem;
120 
121  float ptem;
122 
123  /* Font variation coordinates. */
124  unsigned int num_coords;
125  int *coords;
127 
129  void *user_data;
131 
132  hb_shaper_object_dataset_t<hb_font_t> data; /* Various shaper data. */
133 
134 
135  /* Convert from font-space to user-space */
138  hb_position_t em_scale_x (int16_t v) { return em_mult (v, x_mult); }
139  hb_position_t em_scale_y (int16_t v) { return em_mult (v, y_mult); }
140  hb_position_t em_scalef_x (float v) { return em_scalef (v, x_scale); }
141  hb_position_t em_scalef_y (float v) { return em_scalef (v, y_scale); }
142  float em_fscale_x (int16_t v) { return em_fscale (v, x_scale); }
143  float em_fscale_y (int16_t v) { return em_fscale (v, y_scale); }
144  float em_fscalef_x (float v) { return em_fscalef (v, x_scale); }
145  float em_fscalef_y (float v) { return em_fscalef (v, y_scale); }
147  { return em_mult (v, dir_mult (direction)); }
148 
149  /* Convert from parent-font user-space to our user-space */
151  {
152  if (unlikely (parent && parent->x_scale != x_scale))
153  return (hb_position_t) (v * (int64_t) this->x_scale / this->parent->x_scale);
154  return v;
155  }
157  {
158  if (unlikely (parent && parent->y_scale != y_scale))
159  return (hb_position_t) (v * (int64_t) this->y_scale / this->parent->y_scale);
160  return v;
161  }
163  { return parent_scale_x_distance (v); }
165  { return parent_scale_y_distance (v); }
166 
168  {
171  }
173  {
176  }
177 
178 
179  /* Public getters */
180 
181  HB_INTERNAL bool has_func (unsigned int i);
182  HB_INTERNAL bool has_func_set (unsigned int i);
183 
184  /* has_* ... */
185 #define HB_FONT_FUNC_IMPLEMENT(name) \
186  bool \
187  has_##name##_func () \
188  { \
189  hb_font_funcs_t *funcs = this->klass; \
190  unsigned int i = offsetof (hb_font_funcs_t::get_t::get_funcs_t, name) / sizeof (funcs->get.array[0]); \
191  return has_func (i); \
192  } \
193  bool \
194  has_##name##_func_set () \
195  { \
196  hb_font_funcs_t *funcs = this->klass; \
197  unsigned int i = offsetof (hb_font_funcs_t::get_t::get_funcs_t, name) / sizeof (funcs->get.array[0]); \
198  return has_func_set (i); \
199  }
201 #undef HB_FONT_FUNC_IMPLEMENT
202 
204  {
205  memset (extents, 0, sizeof (*extents));
206  return klass->get.f.font_h_extents (this, user_data,
207  extents,
208  klass->user_data.font_h_extents);
209  }
211  {
212  memset (extents, 0, sizeof (*extents));
213  return klass->get.f.font_v_extents (this, user_data,
214  extents,
215  klass->user_data.font_v_extents);
216  }
217 
218  bool has_glyph (hb_codepoint_t unicode)
219  {
220  hb_codepoint_t glyph;
221  return get_nominal_glyph (unicode, &glyph);
222  }
223 
225  hb_codepoint_t *glyph,
226  hb_codepoint_t not_found = 0)
227  {
228  *glyph = not_found;
229  return klass->get.f.nominal_glyph (this, user_data,
230  unicode, glyph,
231  klass->user_data.nominal_glyph);
232  }
233  unsigned int get_nominal_glyphs (unsigned int count,
234  const hb_codepoint_t *first_unicode,
235  unsigned int unicode_stride,
236  hb_codepoint_t *first_glyph,
237  unsigned int glyph_stride)
238  {
239  return klass->get.f.nominal_glyphs (this, user_data,
240  count,
241  first_unicode, unicode_stride,
242  first_glyph, glyph_stride,
243  klass->user_data.nominal_glyphs);
244  }
245 
247  hb_codepoint_t *glyph,
248  hb_codepoint_t not_found = 0)
249  {
250  *glyph = not_found;
251  return klass->get.f.variation_glyph (this, user_data,
252  unicode, variation_selector, glyph,
253  klass->user_data.variation_glyph);
254  }
255 
257  {
258  return klass->get.f.glyph_h_advance (this, user_data,
259  glyph,
260  klass->user_data.glyph_h_advance);
261  }
262 
264  {
265  return klass->get.f.glyph_v_advance (this, user_data,
266  glyph,
267  klass->user_data.glyph_v_advance);
268  }
269 
270  void get_glyph_h_advances (unsigned int count,
271  const hb_codepoint_t *first_glyph,
272  unsigned int glyph_stride,
273  hb_position_t *first_advance,
274  unsigned int advance_stride)
275  {
276  return klass->get.f.glyph_h_advances (this, user_data,
277  count,
278  first_glyph, glyph_stride,
279  first_advance, advance_stride,
280  klass->user_data.glyph_h_advances);
281  }
282 
283  void get_glyph_v_advances (unsigned int count,
284  const hb_codepoint_t *first_glyph,
285  unsigned int glyph_stride,
286  hb_position_t *first_advance,
287  unsigned int advance_stride)
288  {
289  return klass->get.f.glyph_v_advances (this, user_data,
290  count,
291  first_glyph, glyph_stride,
292  first_advance, advance_stride,
293  klass->user_data.glyph_v_advances);
294  }
295 
298  {
299  *x = *y = 0;
300  return klass->get.f.glyph_h_origin (this, user_data,
301  glyph, x, y,
302  klass->user_data.glyph_h_origin);
303  }
304 
307  {
308  *x = *y = 0;
309  return klass->get.f.glyph_v_origin (this, user_data,
310  glyph, x, y,
311  klass->user_data.glyph_v_origin);
312  }
313 
316  {
317 #ifdef HB_DISABLE_DEPRECATED
318  return 0;
319 #else
320  return klass->get.f.glyph_h_kerning (this, user_data,
322  klass->user_data.glyph_h_kerning);
323 #endif
324  }
325 
327  hb_codepoint_t bottom_glyph)
328  {
329 #ifdef HB_DISABLE_DEPRECATED
330  return 0;
331 #else
332  return klass->get.f.glyph_v_kerning (this, user_data,
333  top_glyph, bottom_glyph,
334  klass->user_data.glyph_v_kerning);
335 #endif
336  }
337 
339  hb_glyph_extents_t *extents)
340  {
341  memset (extents, 0, sizeof (*extents));
342  return klass->get.f.glyph_extents (this, user_data,
343  glyph,
344  extents,
345  klass->user_data.glyph_extents);
346  }
347 
348  hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index,
350  {
351  *x = *y = 0;
352  return klass->get.f.glyph_contour_point (this, user_data,
353  glyph, point_index,
354  x, y,
355  klass->user_data.glyph_contour_point);
356  }
357 
359  char *name, unsigned int size)
360  {
361  if (size) *name = '\0';
362  return klass->get.f.glyph_name (this, user_data,
363  glyph,
364  name, size,
365  klass->user_data.glyph_name);
366  }
367 
368  hb_bool_t get_glyph_from_name (const char *name, int len, /* -1 means nul-terminated */
369  hb_codepoint_t *glyph)
370  {
371  *glyph = 0;
372  if (len == -1) len = strlen (name);
373  return klass->get.f.glyph_from_name (this, user_data,
374  name, len,
375  glyph,
376  klass->user_data.glyph_from_name);
377  }
378 
380  hb_draw_funcs_t *draw_funcs, void *draw_data)
381  {
382  klass->get.f.glyph_shape (this, user_data,
383  glyph,
384  draw_funcs, draw_data,
385  klass->user_data.glyph_shape);
386  }
387 
388 
389  /* A bit higher-level, and with fallback */
390 
392  {
393  if (!get_font_h_extents (extents))
394  {
395  extents->ascender = y_scale * .8;
396  extents->descender = extents->ascender - y_scale;
397  extents->line_gap = 0;
398  }
399  }
401  {
402  if (!get_font_v_extents (extents))
403  {
404  extents->ascender = x_scale / 2;
405  extents->descender = extents->ascender - x_scale;
406  extents->line_gap = 0;
407  }
408  }
409 
411  hb_font_extents_t *extents)
412  {
414  get_h_extents_with_fallback (extents);
415  else
416  get_v_extents_with_fallback (extents);
417  }
418 
422  {
423  *x = *y = 0;
425  *x = get_glyph_h_advance (glyph);
426  else
427  *y = get_glyph_v_advance (glyph);
428  }
430  unsigned int count,
431  const hb_codepoint_t *first_glyph,
432  unsigned glyph_stride,
433  hb_position_t *first_advance,
434  unsigned advance_stride)
435  {
437  get_glyph_h_advances (count, first_glyph, glyph_stride, first_advance, advance_stride);
438  else
439  get_glyph_v_advances (count, first_glyph, glyph_stride, first_advance, advance_stride);
440  }
441 
444  {
445  *x = get_glyph_h_advance (glyph) / 2;
446 
447  /* TODO cache this somehow?! */
448  hb_font_extents_t extents;
449  get_h_extents_with_fallback (&extents);
450  *y = extents.ascender;
451  }
452 
455  {
456  if (!get_glyph_h_origin (glyph, x, y) &&
457  get_glyph_v_origin (glyph, x, y))
458  {
459  hb_position_t dx, dy;
460  guess_v_origin_minus_h_origin (glyph, &dx, &dy);
461  *x -= dx; *y -= dy;
462  }
463  }
466  {
467  if (!get_glyph_v_origin (glyph, x, y) &&
468  get_glyph_h_origin (glyph, x, y))
469  {
470  hb_position_t dx, dy;
471  guess_v_origin_minus_h_origin (glyph, &dx, &dy);
472  *x += dx; *y += dy;
473  }
474  }
475 
479  {
482  else
484  }
485 
488  {
489  hb_position_t origin_x, origin_y;
490 
491  get_glyph_h_origin_with_fallback (glyph, &origin_x, &origin_y);
492 
493  *x += origin_x;
494  *y += origin_y;
495  }
498  {
499  hb_position_t origin_x, origin_y;
500 
501  get_glyph_v_origin_with_fallback (glyph, &origin_x, &origin_y);
502 
503  *x += origin_x;
504  *y += origin_y;
505  }
509  {
510  hb_position_t origin_x, origin_y;
511 
512  get_glyph_origin_for_direction (glyph, direction, &origin_x, &origin_y);
513 
514  *x += origin_x;
515  *y += origin_y;
516  }
517 
520  {
521  hb_position_t origin_x, origin_y;
522 
523  get_glyph_h_origin_with_fallback (glyph, &origin_x, &origin_y);
524 
525  *x -= origin_x;
526  *y -= origin_y;
527  }
530  {
531  hb_position_t origin_x, origin_y;
532 
533  get_glyph_v_origin_with_fallback (glyph, &origin_x, &origin_y);
534 
535  *x -= origin_x;
536  *y -= origin_y;
537  }
541  {
542  hb_position_t origin_x, origin_y;
543 
544  get_glyph_origin_for_direction (glyph, direction, &origin_x, &origin_y);
545 
546  *x -= origin_x;
547  *y -= origin_y;
548  }
549 
553  {
555  *y = 0;
556  *x = get_glyph_h_kerning (first_glyph, second_glyph);
557  } else {
558  *x = 0;
559  *y = get_glyph_v_kerning (first_glyph, second_glyph);
560  }
561  }
562 
565  hb_glyph_extents_t *extents)
566  {
567  hb_bool_t ret = get_glyph_extents (glyph, extents);
568 
569  if (ret)
570  subtract_glyph_origin_for_direction (glyph, direction, &extents->x_bearing, &extents->y_bearing);
571 
572  return ret;
573  }
574 
578  {
579  hb_bool_t ret = get_glyph_contour_point (glyph, point_index, x, y);
580 
581  if (ret)
583 
584  return ret;
585  }
586 
587  /* Generates gidDDD if glyph has no name. */
588  void
590  char *s, unsigned int size)
591  {
592  if (get_glyph_name (glyph, s, size)) return;
593 
594  if (size && snprintf (s, size, "gid%u", glyph) < 0)
595  *s = '\0';
596  }
597 
598  /* Parses gidDDD and uniUUUU strings automatically. */
599  hb_bool_t
600  glyph_from_string (const char *s, int len, /* -1 means nul-terminated */
601  hb_codepoint_t *glyph)
602  {
603  if (get_glyph_from_name (s, len, glyph)) return true;
604 
605  if (len == -1) len = strlen (s);
606 
607  /* Straight glyph index. */
608  if (hb_codepoint_parse (s, len, 10, glyph))
609  return true;
610 
611  if (len > 3)
612  {
613  /* gidDDD syntax for glyph indices. */
614  if (0 == strncmp (s, "gid", 3) &&
615  hb_codepoint_parse (s + 3, len - 3, 10, glyph))
616  return true;
617 
618  /* uniUUUU and other Unicode character indices. */
619  hb_codepoint_t unichar;
620  if (0 == strncmp (s, "uni", 3) &&
621  hb_codepoint_parse (s + 3, len - 3, 16, &unichar) &&
622  get_nominal_glyph (unichar, glyph))
623  return true;
624  }
625 
626  return false;
627  }
628 
630  {
631  signed upem = face->get_upem ();
632  x_mult = ((int64_t) x_scale << 16) / upem;
633  y_mult = ((int64_t) y_scale << 16) / upem;
634  slant_xy = y_scale ? slant * x_scale / y_scale : 0.f;
635  }
636 
637  hb_position_t em_mult (int16_t v, int64_t mult)
638  { return (hb_position_t) ((v * mult + 32768) >> 16); }
640  { return (hb_position_t) roundf (em_fscalef (v, scale)); }
641  float em_fscalef (float v, int scale)
642  { return v * scale / face->get_upem (); }
643  float em_fscale (int16_t v, int scale)
644  { return (float) v * scale / face->get_upem (); }
645 };
647 
648 
649 #endif /* HB_FONT_HH */
small capitals from c petite p scientific i
[1]
Definition: afcover.h:80
direction
#define roundf(x)
Definition: hb-algs.hh:165
#define HB_FONT_FUNC_IMPLEMENT(name)
Definition: hb-font.hh:185
DECLARE_NULL_INSTANCE(hb_font_funcs_t)
#define HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
Definition: hb-font.hh:42
#define likely(expr)
Definition: hb.hh:250
#define unlikely(expr)
Definition: hb.hh:251
#define HB_INTERNAL
Definition: hb.hh:274
int PRIV() strncmp(PCRE2_SPTR str1, PCRE2_SPTR str2, size_t len)
PCRE2_SIZE PRIV() strlen(PCRE2_SPTR str)
void
Definition: png.h:1080
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLenum face
GLuint name
GLint y
GLenum array
Definition: qopenglext.h:7028
GLenum GLsizei len
Definition: qopenglext.h:3292
GLdouble s
[6]
Definition: qopenglext.h:235
GLenum GLenum GLenum GLenum GLenum scale
Definition: qopenglext.h:10817
void(* hb_destroy_func_t)(void *user_data)
Definition: hb-common.h:771
HB_BEGIN_DECLS typedef int hb_bool_t
Definition: hb-common.h:97
uint32_t hb_codepoint_t
Definition: hb-common.h:106
int32_t hb_position_t
Definition: hb-common.h:115
#define HB_DIRECTION_IS_VERTICAL(dir)
Definition: hb-common.h:270
hb_direction_t
Definition: hb-common.h:229
#define HB_DIRECTION_IS_HORIZONTAL(dir)
Definition: hb-common.h:261
hb_position_t descender
Definition: hb-font.h:115
hb_position_t ascender
Definition: hb-font.h:114
hb_position_t line_gap
Definition: hb-font.h:116
hb_object_header_t header
Definition: hb-font.hh:65
union hb_font_funcs_t::get_t get
struct hb_font_funcs_t::@117 destroy
struct hb_font_funcs_t::@116 user_data
hb_bool_t get_glyph_contour_point_for_origin(hb_codepoint_t glyph, unsigned int point_index, hb_direction_t direction, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:575
hb_position_t em_mult(int16_t v, int64_t mult)
Definition: hb-font.hh:637
hb_bool_t get_glyph_extents(hb_codepoint_t glyph, hb_glyph_extents_t *extents)
Definition: hb-font.hh:338
hb_position_t get_glyph_h_advance(hb_codepoint_t glyph)
Definition: hb-font.hh:256
void * user_data
Definition: hb-font.hh:129
hb_position_t em_scalef_y(float v)
Definition: hb-font.hh:141
hb_bool_t get_glyph_v_origin(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:305
hb_position_t get_glyph_v_advance(hb_codepoint_t glyph)
Definition: hb-font.hh:263
void get_v_extents_with_fallback(hb_font_extents_t *extents)
Definition: hb-font.hh:400
hb_position_t parent_scale_y_position(hb_position_t v)
Definition: hb-font.hh:164
int64_t dir_mult(hb_direction_t direction)
Definition: hb-font.hh:136
void get_glyph_advances_for_direction(hb_direction_t direction, unsigned int count, const hb_codepoint_t *first_glyph, unsigned glyph_stride, hb_position_t *first_advance, unsigned advance_stride)
Definition: hb-font.hh:429
hb_shaper_object_dataset_t< hb_font_t > data
Definition: hb-font.hh:132
void get_glyph_h_advances(unsigned int count, const hb_codepoint_t *first_glyph, unsigned int glyph_stride, hb_position_t *first_advance, unsigned int advance_stride)
Definition: hb-font.hh:270
int64_t x_mult
Definition: hb-font.hh:115
hb_object_header_t header
Definition: hb-font.hh:106
void add_glyph_h_origin(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:486
void get_h_extents_with_fallback(hb_font_extents_t *extents)
Definition: hb-font.hh:391
bool has_glyph(hb_codepoint_t unicode)
Definition: hb-font.hh:218
int32_t x_scale
Definition: hb-font.hh:111
hb_position_t parent_scale_x_distance(hb_position_t v)
Definition: hb-font.hh:150
hb_position_t em_scale_dir(int16_t v, hb_direction_t direction)
Definition: hb-font.hh:146
unsigned int get_nominal_glyphs(unsigned int count, const hb_codepoint_t *first_unicode, unsigned int unicode_stride, hb_codepoint_t *first_glyph, unsigned int glyph_stride)
Definition: hb-font.hh:233
void get_extents_for_direction(hb_direction_t direction, hb_font_extents_t *extents)
Definition: hb-font.hh:410
hb_position_t parent_scale_x_position(hb_position_t v)
Definition: hb-font.hh:162
hb_position_t em_scalef_x(float v)
Definition: hb-font.hh:140
void parent_scale_position(hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:172
hb_bool_t glyph_from_string(const char *s, int len, hb_codepoint_t *glyph)
Definition: hb-font.hh:600
hb_bool_t get_glyph_contour_point(hb_codepoint_t glyph, unsigned int point_index, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:348
hb_bool_t get_glyph_h_origin(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:296
float slant_xy
Definition: hb-font.hh:114
float slant
Definition: hb-font.hh:113
hb_font_t * parent
Definition: hb-font.hh:108
void glyph_to_string(hb_codepoint_t glyph, char *s, unsigned int size)
Definition: hb-font.hh:589
void subtract_glyph_h_origin(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:518
int32_t y_scale
Definition: hb-font.hh:112
int * coords
Definition: hb-font.hh:125
void get_glyph_h_origin_with_fallback(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:453
float em_fscalef_y(float v)
Definition: hb-font.hh:145
float em_fscale(int16_t v, int scale)
Definition: hb-font.hh:643
void get_glyph_advance_for_direction(hb_codepoint_t glyph, hb_direction_t direction, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:419
hb_position_t get_glyph_h_kerning(hb_codepoint_t left_glyph, hb_codepoint_t right_glyph)
Definition: hb-font.hh:314
hb_font_funcs_t * klass
Definition: hb-font.hh:128
void get_glyph_origin_for_direction(hb_codepoint_t glyph, hb_direction_t direction, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:476
HB_INTERNAL bool has_func(unsigned int i)
Definition: hb-font.cc:874
hb_bool_t get_nominal_glyph(hb_codepoint_t unicode, hb_codepoint_t *glyph, hb_codepoint_t not_found=0)
Definition: hb-font.hh:224
void get_glyph_v_advances(unsigned int count, const hb_codepoint_t *first_glyph, unsigned int glyph_stride, hb_position_t *first_advance, unsigned int advance_stride)
Definition: hb-font.hh:283
void parent_scale_distance(hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:167
void guess_v_origin_minus_h_origin(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:442
hb_position_t em_scale_x(int16_t v)
Definition: hb-font.hh:138
hb_bool_t get_glyph_name(hb_codepoint_t glyph, char *name, unsigned int size)
Definition: hb-font.hh:358
hb_position_t parent_scale_y_distance(hb_position_t v)
Definition: hb-font.hh:156
void add_glyph_origin_for_direction(hb_codepoint_t glyph, hb_direction_t direction, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:506
hb_position_t em_scalef(float v, int scale)
Definition: hb-font.hh:639
hb_position_t get_glyph_v_kerning(hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph)
Definition: hb-font.hh:326
HB_INTERNAL bool has_func_set(unsigned int i)
Definition: hb-font.cc:868
hb_position_t em_scale_y(int16_t v)
Definition: hb-font.hh:139
void mults_changed()
Definition: hb-font.hh:629
hb_destroy_func_t destroy
Definition: hb-font.hh:130
hb_bool_t get_variation_glyph(hb_codepoint_t unicode, hb_codepoint_t variation_selector, hb_codepoint_t *glyph, hb_codepoint_t not_found=0)
Definition: hb-font.hh:246
float em_fscale_y(int16_t v)
Definition: hb-font.hh:143
hb_face_t * face
Definition: hb-font.hh:109
hb_bool_t get_glyph_from_name(const char *name, int len, hb_codepoint_t *glyph)
Definition: hb-font.hh:368
void add_glyph_v_origin(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:496
float em_fscalef(float v, int scale)
Definition: hb-font.hh:641
float em_fscale_x(int16_t v)
Definition: hb-font.hh:142
unsigned int num_coords
Definition: hb-font.hh:124
void subtract_glyph_origin_for_direction(hb_codepoint_t glyph, hb_direction_t direction, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:538
void get_glyph_kerning_for_direction(hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, hb_direction_t direction, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:550
hb_bool_t get_font_v_extents(hb_font_extents_t *extents)
Definition: hb-font.hh:210
float em_fscalef_x(float v)
Definition: hb-font.hh:144
float ptem
Definition: hb-font.hh:121
void get_glyph_v_origin_with_fallback(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:464
hb_bool_t get_glyph_extents_for_origin(hb_codepoint_t glyph, hb_direction_t direction, hb_glyph_extents_t *extents)
Definition: hb-font.hh:563
unsigned int y_ppem
Definition: hb-font.hh:119
void get_glyph_shape(hb_codepoint_t glyph, hb_draw_funcs_t *draw_funcs, void *draw_data)
Definition: hb-font.hh:379
unsigned int x_ppem
Definition: hb-font.hh:118
HB_FONT_FUNCS_IMPLEMENT_CALLBACKS hb_bool_t get_font_h_extents(hb_font_extents_t *extents)
Definition: hb-font.hh:203
float * design_coords
Definition: hb-font.hh:126
void subtract_glyph_v_origin(hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
Definition: hb-font.hh:528
int64_t y_mult
Definition: hb-font.hh:116
hb_position_t x_bearing
Definition: hb-font.h:141
hb_position_t y_bearing
Definition: hb-font.h:142
FT_UInt left_glyph
Definition: ttdriver.c:203
FT_UInt FT_UInt right_glyph
Definition: ttdriver.c:204
struct hb_font_funcs_t::get_t::get_funcs_t f