}
+hb_font_get_glyph_func_t
+hb_font_funcs_get_glyph_func (hb_font_funcs_t *ffuncs)
+{
+ return ffuncs->v.get_glyph;
+}
+
+hb_font_get_contour_point_func_t
+hb_font_funcs_get_contour_point_func (hb_font_funcs_t *ffuncs)
+{
+ return ffuncs->v.get_contour_point;
+}
+
+hb_font_get_glyph_metrics_func_t
+hb_font_funcs_get_glyph_metrics_func (hb_font_funcs_t *ffuncs)
+{
+ return ffuncs->v.get_glyph_metrics;
+}
+
+hb_font_get_kerning_func_t
+hb_font_funcs_get_kerning_func (hb_font_funcs_t *ffuncs)
+{
+ return ffuncs->v.get_kerning;
+}
+
+
+
hb_codepoint_t
hb_font_get_glyph (hb_font_t *font, hb_face_t *face,
hb_codepoint_t unicode, hb_codepoint_t variation_selector)
}
void
+hb_font_unset_funcs (hb_font_t *font,
+ hb_font_funcs_t **klass,
+ hb_destroy_func_t *destroy,
+ void **user_data)
+{
+ /* None of the input arguments can be NULL. */
+
+ *klass = font->klass;
+ *destroy = font->destroy;
+ *user_data = font->user_data;
+
+ if (HB_OBJECT_IS_INERT (font))
+ return;
+
+ font->klass = NULL;
+ font->destroy = NULL;
+ font->user_data = NULL;
+}
+
+void
hb_font_set_scale (hb_font_t *font,
unsigned int x_scale,
unsigned int y_scale)
}
void
+hb_font_get_scale (hb_font_t *font,
+ unsigned int *x_scale,
+ unsigned int *y_scale)
+{
+ if (x_scale) *x_scale = font->x_scale;
+ if (y_scale) *y_scale = font->y_scale;
+}
+
+void
hb_font_set_ppem (hb_font_t *font,
unsigned int x_ppem,
unsigned int y_ppem)
font->y_ppem = y_ppem;
}
+void
+hb_font_get_ppem (hb_font_t *font,
+ unsigned int *x_ppem,
+ unsigned int *y_ppem)
+{
+ if (x_ppem) *x_ppem = font->x_ppem;
+ if (y_ppem) *y_ppem = font->y_ppem;
+}
+
HB_END_DECLS
hb_font_get_kerning_func_t kerning_func);
+/* These never return NULL. Return fallback defaults instead. */
+
+hb_font_get_glyph_func_t
+hb_font_funcs_get_glyph_func (hb_font_funcs_t *ffuncs);
+
+hb_font_get_contour_point_func_t
+hb_font_funcs_get_contour_point_func (hb_font_funcs_t *ffuncs);
+
+hb_font_get_glyph_metrics_func_t
+hb_font_funcs_get_glyph_metrics_func (hb_font_funcs_t *ffuncs);
+
+hb_font_get_kerning_func_t
+hb_font_funcs_get_kerning_func (hb_font_funcs_t *ffuncs);
+
+
hb_codepoint_t
hb_font_get_glyph (hb_font_t *font, hb_face_t *face,
hb_codepoint_t unicode, hb_codepoint_t variation_selector);
hb_destroy_func_t destroy,
void *user_data);
+/* Returns what was set and unsets it, but doesn't destroy(user_data).
+ * This is useful for wrapping / chaining font_funcs_t's.
+ *
+ * The client is responsible for:
+ *
+ * - Take ownership of the reference on the returned klass
+ * - Calling "destroy(user_data)" exactly once if returned destroy func
+ * is not NULL and the returned info is not needed anymore.
+ */
+void
+hb_font_unset_funcs (hb_font_t *font,
+ hb_font_funcs_t **klass,
+ hb_destroy_func_t *destroy,
+ void **user_data);
+
/*
* We should add support for full matrices.
unsigned int x_scale,
unsigned int y_scale);
+void
+hb_font_get_scale (hb_font_t *font,
+ unsigned int *x_scale,
+ unsigned int *y_scale);
+
/*
* A zero value means "no hinting in that direction"
*/
unsigned int x_ppem,
unsigned int y_ppem);
+void
+hb_font_get_ppem (hb_font_t *font,
+ unsigned int *x_ppem,
+ unsigned int *y_ppem);
+
HB_END_DECLS
}
+hb_unicode_get_mirroring_func_t
+hb_unicode_funcs_get_mirroring_func (hb_unicode_funcs_t *ufuncs)
+{
+ return ufuncs->v.get_mirroring;
+}
+
+hb_unicode_get_general_category_func_t
+hb_unicode_funcs_get_general_category_func (hb_unicode_funcs_t *ufuncs)
+{
+ return ufuncs->v.get_general_category;
+}
+
+hb_unicode_get_script_func_t
+hb_unicode_funcs_get_script_func (hb_unicode_funcs_t *ufuncs)
+{
+ return ufuncs->v.get_script;
+}
+
+hb_unicode_get_combining_class_func_t
+hb_unicode_funcs_get_combining_class_func (hb_unicode_funcs_t *ufuncs)
+{
+ return ufuncs->v.get_combining_class;
+}
+
+hb_unicode_get_eastasian_width_func_t
+hb_unicode_funcs_get_eastasian_width_func (hb_unicode_funcs_t *ufuncs)
+{
+ return ufuncs->v.get_eastasian_width;
+}
+
+
+
hb_codepoint_t
hb_unicode_get_mirroring (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode)
hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs);
-/* funcs */
+/*
+ * funcs
+ */
+
+
+/* typedefs */
typedef hb_codepoint_t (*hb_unicode_get_mirroring_func_t) (hb_codepoint_t unicode);
typedef hb_category_t (*hb_unicode_get_general_category_func_t) (hb_codepoint_t unicode);
typedef unsigned int (*hb_unicode_get_eastasian_width_func_t) (hb_codepoint_t unicode);
+/* setters */
+
void
hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs,
hb_unicode_get_mirroring_func_t mirroring_func);
hb_unicode_get_eastasian_width_func_t eastasian_width_func);
+/* getters */
+
+/* These never return NULL. Return fallback defaults instead. */
+
+hb_unicode_get_mirroring_func_t
+hb_unicode_funcs_get_mirroring_func (hb_unicode_funcs_t *ufuncs);
+
+hb_unicode_get_general_category_func_t
+hb_unicode_funcs_get_general_category_func (hb_unicode_funcs_t *ufuncs);
+
+hb_unicode_get_script_func_t
+hb_unicode_funcs_get_script_func (hb_unicode_funcs_t *ufuncs);
+
+hb_unicode_get_combining_class_func_t
+hb_unicode_funcs_get_combining_class_func (hb_unicode_funcs_t *ufuncs);
+
+hb_unicode_get_eastasian_width_func_t
+hb_unicode_funcs_get_eastasian_width_func (hb_unicode_funcs_t *ufuncs);
+
+
+/* accessors */
+
hb_codepoint_t
hb_unicode_get_mirroring (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t unicode);