+hb_font_get_glyph_advance_for_direction (hb_font_t *font,
+ hb_codepoint_t glyph,
+ hb_direction_t direction,
+ hb_position_t *x_advance, hb_position_t *y_advance)
+{
+ if (HB_DIRECTION_IS_VERTICAL (direction)) {
+ hb_bool_t ret = hb_font_get_glyph_v_advance (font, glyph, x_advance, y_advance);
+ if (!ret) {
+ /* TODO Simulate using h_advance and font_extents */
+ }
+ } else {
+ hb_font_get_glyph_h_advance (font, glyph, x_advance, y_advance);
+ }
+}
+
+void
+hb_font_get_kerning_for_direction (hb_font_t *font,
+ hb_codepoint_t first_glyph, hb_codepoint_t second_glyph,
+ hb_direction_t direction,
+ hb_position_t *x_kern, hb_position_t *y_kern)
+{
+ switch (direction) {
+ case HB_DIRECTION_LTR:
+ case HB_DIRECTION_RTL:
+ hb_font_get_h_kerning (font, first_glyph, second_glyph, x_kern, y_kern);
+ break;
+
+ case HB_DIRECTION_TTB:
+ case HB_DIRECTION_BTT:
+ hb_font_get_v_kerning (font, first_glyph, second_glyph, x_kern, y_kern);
+ break;
+
+ case HB_DIRECTION_INVALID:
+ default:
+ break;
+ }
+}
+
+void
+hb_font_get_glyph_extents_for_direction (hb_font_t *font,
+ hb_codepoint_t glyph,
+ hb_direction_t direction,
+ hb_glyph_extents_t *extents)
+{
+ hb_bool_t vertical = HB_DIRECTION_IS_VERTICAL (direction);
+ hb_bool_t ret = hb_font_get_glyph_extents (font, glyph, &vertical, extents);
+
+ if (ret) {
+ if (vertical != HB_DIRECTION_IS_VERTICAL (direction)) {
+ /* XXX Adjust origin */
+ }
+ } else {
+ /* TODO Simulate using get_h_advance and font_extents? */
+ }
+}
+
+hb_bool_t
+hb_font_get_contour_point_for_direction (hb_font_t *font,
+ hb_codepoint_t glyph, unsigned int point_index,
+ hb_direction_t direction,
+ hb_position_t *x, hb_position_t *y)