*blob = hb_blob_get_empty ();
return Null(AAT::morx);
}
- const AAT::morx& morx = *(hb_ot_face_data (face)->table.morx.get ());
+ const AAT::morx& morx = *(hb_ot_face_data (face)->morx.get ());
if (blob)
- *blob = hb_ot_face_data (face)->table.morx.get_blob ();
+ *blob = hb_ot_face_data (face)->morx.get_blob ();
return morx;
}
hb_set_t *out)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
- hb_ot_face_data (face)->table.cmap->collect_unicodes (out);
+ hb_ot_face_data (face)->cmap->collect_unicodes (out);
}
/**
hb_set_t *out)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
- hb_ot_face_data (face)->table.cmap->collect_variation_selectors (out);
+ hb_ot_face_data (face)->cmap->collect_variation_selectors (out);
}
/**
hb_set_t *out)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return;
- hb_ot_face_data (face)->table.cmap->collect_variation_unicodes (variation_selector, out);
+ hb_ot_face_data (face)->cmap->collect_variation_unicodes (variation_selector, out);
}
#include "hb-ot-layout-gpos-table.hh"
-void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
+void hb_ot_face_data_t::init0 (hb_face_t *face)
{
this->face = face;
#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.init0 ();
#undef HB_OT_LAYOUT_ACCELERATOR
#undef HB_OT_LAYOUT_TABLE
}
-void hb_ot_face_data_t::tables_t::fini (void)
+void hb_ot_face_data_t::fini (void)
{
#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.fini ();
#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
if (unlikely (!data))
return nullptr;
- data->table.init0 (face);
+ data->init0 (face);
return data;
}
void
_hb_ot_face_data_destroy (hb_ot_face_data_t *data)
{
- data->table.fini ();
+ data->fini ();
free (data);
}
struct hb_ot_face_data_t
{
- /* All the president's tables. */
- struct tables_t
- {
- HB_INTERNAL void init0 (hb_face_t *face);
- HB_INTERNAL void fini (void);
+ HB_INTERNAL void init0 (hb_face_t *face);
+ HB_INTERNAL void fini (void);
#define HB_OT_LAYOUT_TABLE_ORDER(Namespace, Type) \
- HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type)))
- enum order_t
- {
- ORDER_ZERO,
+ HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type)))
+ enum order_t
+ {
+ ORDER_ZERO,
#define HB_OT_LAYOUT_TABLE(Namespace, Type) HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type),
#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
- HB_OT_LAYOUT_TABLES
+ HB_OT_LAYOUT_TABLES
#undef HB_OT_LAYOUT_ACCELERATOR
#undef HB_OT_LAYOUT_TABLE
- };
+ };
- hb_face_t *face; /* MUST be JUST before the lazy loaders. */
+ hb_face_t *face; /* MUST be JUST before the lazy loaders. */
#define HB_OT_LAYOUT_TABLE(Namespace, Type) \
- hb_table_lazy_loader_t<Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+ hb_table_lazy_loader_t<Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) \
- hb_face_lazy_loader_t<Namespace::Type##_accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
- HB_OT_LAYOUT_TABLES
+ hb_face_lazy_loader_t<Namespace::Type##_accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
+ HB_OT_LAYOUT_TABLES
#undef HB_OT_LAYOUT_ACCELERATOR
#undef HB_OT_LAYOUT_TABLE
- } table;
};
#include "hb-ot-color-cbdt-table.hh"
-typedef hb_ot_face_data_t::tables_t hb_ot_font_t;
-
-
static hb_bool_t
hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED,
void *font_data,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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);
}
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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);
}
hb_codepoint_t glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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));
}
hb_codepoint_t glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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));
}
hb_codepoint_t right_glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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));
}
hb_glyph_extents_t *extents,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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);
if (!ret)
ret = ot_font->CBDT->get_extents (glyph, extents);
char *name, unsigned int size,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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);
}
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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);
}
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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);
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
{
- const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+ 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);
hb_ot_font_set_funcs (hb_font_t *font)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (font->face))) return;
- hb_ot_font_t *ot_font = &hb_ot_face_data (font->face)->table;
+ hb_ot_face_data_t *ot_font = hb_ot_face_data (font->face);
/* Load them lazies. We access them with get_relaxed() for performance. */
ot_font->cmap.get ();
inline const OT::GDEF& _get_gdef (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GDEF);
- return *hb_ot_face_data (face)->table.GDEF->table;
+ return *hb_ot_face_data (face)->GDEF->table;
}
static hb_blob_t * _get_gsub_blob (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
- return hb_ot_face_data (face)->table.GSUB->blob;
+ return hb_ot_face_data (face)->GSUB->blob;
}
static inline const OT::GSUB& _get_gsub (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB);
- return *hb_ot_face_data (face)->table.GSUB->table;
+ return *hb_ot_face_data (face)->GSUB->table;
}
inline const OT::GSUB& _get_gsub_relaxed (hb_face_t *face)
{
- return *hb_ot_face_data (face)->table.GSUB.get_relaxed ()->table;
+ return *hb_ot_face_data (face)->GSUB.get_relaxed ()->table;
}
static hb_blob_t * _get_gpos_blob (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return hb_blob_get_empty ();
- return hb_ot_face_data (face)->table.GPOS->blob;
+ return hb_ot_face_data (face)->GPOS->blob;
}
static inline const OT::GPOS& _get_gpos (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GPOS);
- return *hb_ot_face_data (face)->table.GPOS->table;
+ return *hb_ot_face_data (face)->GPOS->table;
}
inline const OT::GPOS& _get_gpos_relaxed (hb_face_t *face)
{
- return *hb_ot_face_data (face)->table.GPOS.get_relaxed ()->table;
+ return *hb_ot_face_data (face)->GPOS.get_relaxed ()->table;
}
{
case HB_OT_TAG_GSUB:
{
- return hb_ot_face_data (face)->table.GSUB->lookup_count;
+ return hb_ot_face_data (face)->GSUB->lookup_count;
}
case HB_OT_TAG_GPOS:
{
- return hb_ot_face_data (face)->table.GPOS->lookup_count;
+ return hb_ot_face_data (face)->GPOS->lookup_count;
}
}
return 0;
{
case HB_OT_TAG_GSUB:
{
- const OT::SubstLookup& l = hb_ot_face_data (face)->table.GSUB->table->get_lookup (lookup_index);
+ const OT::SubstLookup& l = hb_ot_face_data (face)->GSUB->table->get_lookup (lookup_index);
l.collect_glyphs (&c);
return;
}
case HB_OT_TAG_GPOS:
{
- const OT::PosLookup& l = hb_ot_face_data (face)->table.GPOS->table->get_lookup (lookup_index);
+ const OT::PosLookup& l = hb_ot_face_data (face)->GPOS->table->get_lookup (lookup_index);
l.collect_glyphs (&c);
return;
}
unsigned int glyphs_length,
hb_bool_t zero_context)
{
- if (unlikely (lookup_index >= hb_ot_face_data (face)->table.GSUB->lookup_count)) return false;
+ if (unlikely (lookup_index >= hb_ot_face_data (face)->GSUB->lookup_count)) return false;
OT::hb_would_apply_context_t c (face, glyphs, glyphs_length, (bool) zero_context);
- const OT::SubstLookup& l = hb_ot_face_data (face)->table.GSUB->table->get_lookup (lookup_index);
+ const OT::SubstLookup& l = hb_ot_face_data (face)->GSUB->table->get_lookup (lookup_index);
- return l.would_apply (&c, &hb_ot_face_data (face)->table.GSUB->accels[lookup_index]);
+ return l.would_apply (&c, &hb_ot_face_data (face)->GSUB->accels[lookup_index]);
}
void
typedef OT::SubstLookup Lookup;
GSUBProxy (hb_face_t *face) :
- table (*hb_ot_face_data (face)->table.GSUB->table),
- accels (hb_ot_face_data (face)->table.GSUB->accels) {}
+ table (*hb_ot_face_data (face)->GSUB->table),
+ accels (hb_ot_face_data (face)->GSUB->accels) {}
const OT::GSUB &table;
const hb_ot_layout_lookup_accelerator_t *accels;
typedef OT::PosLookup Lookup;
GPOSProxy (hb_face_t *face) :
- table (*hb_ot_face_data (face)->table.GPOS->table),
- accels (hb_ot_face_data (face)->table.GPOS->accels) {}
+ table (*hb_ot_face_data (face)->GPOS->table),
+ accels (hb_ot_face_data (face)->GPOS->accels) {}
const OT::GPOS &table;
const hb_ot_layout_lookup_accelerator_t *accels;
_get_math (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::MATH);
- hb_ot_face_data_t * layout = hb_ot_face_data (face);
- return *(layout->table.MATH.get ());
+ hb_ot_face_data_t * data = hb_ot_face_data (face);
+ return *(data->MATH.get ());
}
/*
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::fvar);
hb_ot_face_data_t *layout = hb_ot_face_data (face);
- return *(layout->table.fvar.get ());
+ return *(layout->fvar.get ());
}
static inline const OT::avar&
_get_avar (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::avar);
hb_ot_face_data_t *layout = hb_ot_face_data (face);
- return *(layout->table.avar.get ());
+ return *(layout->avar.get ());
}
/**