apply_string<GSUBProxy> (c, lookup, accel);
}
-#if 0
-hb_bool_t
-hb_ot_layout_get_baseline (hb_font_t *font,
- hb_ot_layout_baseline_t baseline,
- hb_direction_t direction,
- hb_tag_t script_tag,
- hb_tag_t language_tag,
- hb_position_t *coord /* OUT. May be NULL. */)
-{
- bool result = font->face->table.BASE->get_baseline (font, baseline, direction, script_tag,
- language_tag, coord);
-
- /* TODO: Simulate https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags#ideographic-em-box */
- if (!result && coord) *coord = 0;
-
- if (coord) *coord = font->em_scale_dir (*coord, direction);
-
- return result;
-}
-
-/* To be moved to public header */
-/*
- * BASE
- */
-
-/**
- * hb_ot_layout_baseline_t:
- *
- * https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags
- *
- * Since: DONTREPLACEME
- */
-typedef enum {
- HB_OT_LAYOUT_BASELINE_HANG = HB_TAG('h','a','n','g'),
- HB_OT_LAYOUT_BASELINE_ICFB = HB_TAG('i','c','f','b'),
- HB_OT_LAYOUT_BASELINE_ICFT = HB_TAG('i','c','f','t'),
- HB_OT_LAYOUT_BASELINE_IDEO = HB_TAG('i','d','e','o'),
- HB_OT_LAYOUT_BASELINE_IDTB = HB_TAG('i','d','t','b'),
- HB_OT_LAYOUT_BASELINE_MATH = HB_TAG('m','a','t','h'),
- HB_OT_LAYOUT_BASELINE_ROMN = HB_TAG('r','o','m','n'),
-
- _HB_OT_LAYOUT_BASELINE_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/
-} hb_ot_layout_baseline_t;
-
-
+#ifndef HB_NO_BASE
/**
* hb_ot_layout_get_baseline:
- * @font: The #hb_font_t to work upon
- * @baseline: The #hb_ot_layout_baseline_t to query
- * @direction: The #hb_direction_t text direction to use (horizontal or vertical)
- * @script_tag: #hb_tag_t of the script to use
- * @language_tag: #hb_tag_t of the language to use
- * @coord: (out): The position of the requested baseline
- *
- * Fetches the coordinates of the specified baseline in the face, underneath
- * the specified script and language and in the specified text direction.
+ * @font: a font
+ * @baseline: a baseline tag
+ * @direction: text direction.
+ * @script_tag: script tag.
+ * @language_tag: language tag.
+ * @coord: (out): baseline value if found.
*
- * Return value: true if the baseline is found for the settings queried, false otherwise
+ * Fetches a baseline value from the face.
*
+ * Return value: if found baseline value in the the font.
**/
-HB_EXTERN hb_bool_t
-hb_ot_layout_get_baseline (hb_font_t *font,
- hb_ot_layout_baseline_t baseline,
- hb_direction_t direction,
- hb_tag_t script_tag,
- hb_tag_t language_tag,
- hb_position_t *coord /* OUT. May be NULL. */);
-
-#endif
+hb_bool_t
+hb_ot_layout_get_baseline (hb_font_t *font,
+ hb_ot_layout_baseline_tag_t baseline_tag,
+ hb_direction_t direction,
+ hb_tag_t script_tag,
+ hb_tag_t language_tag,
+ hb_position_t *coord /* OUT. May be NULL. */)
+{
+ bool result = font->face->table.BASE->get_baseline (font, baseline_tag, direction, script_tag, language_tag, coord);
+ if (result && coord)
+ *coord = HB_DIRECTION_IS_HORIZONTAL (direction) ? font->em_scale_y (*coord) : font->em_scale_x (*coord);
+ return result;
+}
+#endif
#endif
unsigned int *char_count /* IN/OUT. May be NULL */,
hb_codepoint_t *characters /* OUT. May be NULL */);
+/*
+ * BASE
+ */
+
+/**
+ * hb_ot_layout_baseline_tag_t:
+ *
+ * https://docs.microsoft.com/en-us/typography/opentype/spec/baselinetags
+ *
+ * Since: REPLACEME
+ */
+typedef enum {
+ HB_OT_LAYOUT_BASELINE_TAG_ROMAN = HB_TAG ('r','o','m','n'),
+ HB_OT_LAYOUT_BASELINE_TAG_HANGING = HB_TAG ('h','a','n','g'),
+ HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT = HB_TAG ('i','c','f','b'),
+ HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_TOP_OR_RIGHT = HB_TAG ('i','c','f','t'),
+ HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_BOTTOM_OR_LEFT = HB_TAG ('i','d','e','o'),
+ HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_TOP_OR_RIGHT = HB_TAG ('i','d','t','p'),
+ HB_OT_LAYOUT_BASELINE_TAG_MATH = HB_TAG ('m','a','t','h'),
+
+ _HB_OT_LAYOUT_BASELINE_TAG_MAX_VALUE = HB_TAG_MAX_SIGNED /*< skip >*/
+} hb_ot_layout_baseline_tag_t;
+
+HB_EXTERN hb_bool_t
+hb_ot_layout_get_baseline (hb_font_t *font,
+ hb_ot_layout_baseline_tag_t baseline_tag,
+ hb_direction_t direction,
+ hb_tag_t script_tag,
+ hb_tag_t language_tag,
+ hb_position_t *coord /* OUT. May be NULL. */);
+
+
HB_END_DECLS
#endif /* HB_OT_LAYOUT_H */
hb_face_t *face = hb_test_open_font_file ("fonts/base.ttf");
hb_font_t *font = hb_font_create (face);
-#if 0
hb_position_t position;
- g_assert (hb_ot_layout_get_baseline (font, HB_OT_LAYOUT_BASELINE_ICFB, HB_DIRECTION_TTB,
+ g_assert (hb_ot_layout_get_baseline (font, HB_OT_LAYOUT_BASELINE_TAG_IDEO_FACE_BOTTOM_OR_LEFT, HB_DIRECTION_TTB,
HB_TAG ('h','a','n','i'),
HB_TAG ('E','N','G',' '),
&position));
g_assert_cmpint (46, ==, position);
-#endif
hb_font_destroy (font);
hb_face_destroy (face);