* hb_font_funcs_t
*/
+#define HB_FONT_FUNCS_IMPLEMENT_CALLBACKS \
+ HB_FONT_FUNC_IMPLEMENT (glyph) \
+ HB_FONT_FUNC_IMPLEMENT (glyph_h_advance) \
+ HB_FONT_FUNC_IMPLEMENT (glyph_v_advance) \
+ HB_FONT_FUNC_IMPLEMENT (glyph_h_origin) \
+ HB_FONT_FUNC_IMPLEMENT (glyph_v_origin) \
+ HB_FONT_FUNC_IMPLEMENT (glyph_h_kerning) \
+ HB_FONT_FUNC_IMPLEMENT (glyph_v_kerning) \
+ HB_FONT_FUNC_IMPLEMENT (glyph_extents) \
+ HB_FONT_FUNC_IMPLEMENT (glyph_contour_point) \
+ /* ^--- Add new callbacks here */
+
struct _hb_font_funcs_t {
hb_object_header_t header;
/* Don't access these directly. Call hb_font_get_*() instead. */
struct {
- hb_font_get_contour_point_func_t contour_point;
- hb_font_get_glyph_advance_func_t glyph_advance;
- hb_font_get_glyph_extents_func_t glyph_extents;
- hb_font_get_glyph_func_t glyph;
- hb_font_get_kerning_func_t kerning;
+#define HB_FONT_FUNC_IMPLEMENT(name) hb_font_get_##name##_func_t name;
+ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_FONT_FUNC_IMPLEMENT
} get;
struct {
- void *contour_point;
- void *glyph_advance;
- void *glyph_extents;
- void *glyph;
- void *kerning;
+#define HB_FONT_FUNC_IMPLEMENT(name) void *name;
+ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_FONT_FUNC_IMPLEMENT
} user_data;
struct {
- hb_destroy_func_t contour_point;
- hb_destroy_func_t glyph_advance;
- hb_destroy_func_t glyph_extents;
- hb_destroy_func_t glyph;
- hb_destroy_func_t kerning;
+#define HB_FONT_FUNC_IMPLEMENT(name) hb_destroy_func_t name;
+ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS
+#undef HB_FONT_FUNC_IMPLEMENT
} destroy;
};
return v;
}
inline hb_position_t parent_scale_x_position (hb_position_t v) {
- return parent_scale_x_distance (v); /* We don't have translation right now */
+ return parent_scale_x_distance (v);
}
inline hb_position_t parent_scale_y_position (hb_position_t v) {
- return parent_scale_y_distance (v); /* We don't have translation right now */
+ return parent_scale_y_distance (v);
}
inline void parent_scale_distance (hb_position_t *x, hb_position_t *y) {