hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- return ot_font->cmap.get_relaxed()->get_nominal_glyph (unicode, glyph);
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ return ot_face->cmap.get_relaxed()->get_nominal_glyph (unicode, glyph);
}
static hb_bool_t
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- return ot_font->cmap.get_relaxed ()->get_variation_glyph (unicode, variation_selector, glyph);
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ return ot_face->cmap.get_relaxed ()->get_variation_glyph (unicode, variation_selector, glyph);
}
static hb_position_t
hb_codepoint_t glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- return font->em_scale_x (ot_font->hmtx.get_relaxed ()->get_advance (glyph, font));
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ return font->em_scale_x (ot_face->hmtx.get_relaxed ()->get_advance (glyph, font));
}
static void
unsigned advance_stride,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- const OT::hmtx_accelerator_t &hmtx = *ot_font->hmtx.get_relaxed ();
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const OT::hmtx_accelerator_t &hmtx = *ot_face->hmtx.get_relaxed ();
for (unsigned int i = 0; i < count; i++)
{
hb_codepoint_t glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- return font->em_scale_y (-(int) ot_font->vmtx.get_relaxed ()->get_advance (glyph, font));
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ return font->em_scale_y (-(int) ot_face->vmtx.get_relaxed ()->get_advance (glyph, font));
}
static void
unsigned advance_stride,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- const OT::vmtx_accelerator_t &vmtx = *ot_font->vmtx.get_relaxed ();
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ const OT::vmtx_accelerator_t &vmtx = *ot_face->vmtx.get_relaxed ();
for (unsigned int i = 0; i < count; i++)
{
hb_codepoint_t right_glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- return font->em_scale_x (ot_font->kern->get_h_kerning (left_glyph, right_glyph));
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ return font->em_scale_x (ot_face->kern->get_h_kerning (left_glyph, right_glyph));
}
static hb_bool_t
hb_glyph_extents_t *extents,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- bool ret = ot_font->glyf->get_extents (glyph, extents);
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ bool ret = ot_face->glyf->get_extents (glyph, extents);
if (!ret)
- ret = ot_font->CBDT->get_extents (glyph, extents);
+ ret = ot_face->CBDT->get_extents (glyph, extents);
// TODO Hook up side-bearings variations.
extents->x_bearing = font->em_scale_x (extents->x_bearing);
extents->y_bearing = font->em_scale_y (extents->y_bearing);
char *name, unsigned int size,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- return ot_font->post->get_glyph_name (glyph, name, size);
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ return ot_face->post->get_glyph_name (glyph, name, size);
}
static hb_bool_t
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- return ot_font->post->get_glyph_from_name (name, len, glyph);
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ return ot_face->post->get_glyph_from_name (name, len, glyph);
}
static hb_bool_t
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- metrics->ascender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->ascender);
- metrics->descender = font->em_scale_y (ot_font->hmtx.get_relaxed ()->descender);
- metrics->line_gap = font->em_scale_y (ot_font->hmtx.get_relaxed ()->line_gap);
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ metrics->ascender = font->em_scale_y (ot_face->hmtx.get_relaxed ()->ascender);
+ metrics->descender = font->em_scale_y (ot_face->hmtx.get_relaxed ()->descender);
+ metrics->line_gap = font->em_scale_y (ot_face->hmtx.get_relaxed ()->line_gap);
// TODO Hook up variations.
- return ot_font->hmtx.get_relaxed ()->has_font_extents;
+ return ot_face->hmtx.get_relaxed ()->has_font_extents;
}
static hb_bool_t
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
{
- const hb_ot_face_data_t *ot_font = (const hb_ot_face_data_t *) font_data;
- metrics->ascender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->ascender);
- metrics->descender = font->em_scale_x (ot_font->vmtx.get_relaxed ()->descender);
- metrics->line_gap = font->em_scale_x (ot_font->vmtx.get_relaxed ()->line_gap);
+ const hb_ot_face_data_t *ot_face = (const hb_ot_face_data_t *) font_data;
+ metrics->ascender = font->em_scale_x (ot_face->vmtx.get_relaxed ()->ascender);
+ metrics->descender = font->em_scale_x (ot_face->vmtx.get_relaxed ()->descender);
+ metrics->line_gap = font->em_scale_x (ot_face->vmtx.get_relaxed ()->line_gap);
// TODO Hook up variations.
- return ot_font->vmtx.get_relaxed ()->has_font_extents;
+ return ot_face->vmtx.get_relaxed ()->has_font_extents;
}
#ifdef HB_USE_ATEXIT
static void free_static_ot_funcs (void);
#endif
-static struct hb_ot_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot_font_funcs_lazy_loader_t>
+static struct hb_ot_face_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_ot_face_funcs_lazy_loader_t>
{
static inline hb_font_funcs_t *create (void)
{
hb_ot_font_set_funcs (hb_font_t *font)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (font->face))) return;
- hb_ot_face_data_t *ot_font = hb_ot_face_data (font->face);
+ hb_ot_face_data_t *ot_face = hb_ot_face_data (font->face);
/* Load them lazies. We access them with get_relaxed() for performance. */
- ot_font->cmap.get ();
- ot_font->hmtx.get ();
- ot_font->vmtx.get ();
+ ot_face->cmap.get ();
+ ot_face->hmtx.get ();
+ ot_face->vmtx.get ();
hb_font_set_funcs (font,
_hb_ot_get_font_funcs (),
- ot_font,
+ ot_face,
nullptr);
}