提交 6f729b45 编写于 作者: B Behdad Esfahbod

More contour point use

上级 3840b6b5
......@@ -196,6 +196,7 @@ hb_font_get_contour_point (hb_font_t *font, hb_face_t *face,
unsigned int point_index,
hb_codepoint_t glyph, hb_position_t *x, hb_position_t *y)
{
*x = 0; *y = 0;
return font->klass->get_contour_point (font, face, font->user_data,
point_index,
glyph, x, y);
......
......@@ -116,9 +116,11 @@ struct CaretValueFormat2
inline int get_caret_value (hb_ot_layout_context_t *context, hb_codepoint_t glyph_id) const
{
/* TODO vertical */
hb_position_t x = 0, y = 0;
hb_font_get_contour_point (context->font, context->face, caretValuePoint, glyph_id, &x, &y);
return x;
hb_position_t x, y;
if (hb_font_get_contour_point (context->font, context->face, caretValuePoint, glyph_id, &x, &y))
return x;
else
return 0;
}
inline bool sanitize (SANITIZE_ARG_DEF) {
......
......@@ -221,10 +221,15 @@ struct AnchorFormat2
inline void get_anchor (hb_ot_layout_context_t *layout_context, hb_codepoint_t glyph_id,
hb_position_t *x, hb_position_t *y) const
{
/* TODO Contour
* NOTE only adjust directions with nonzero ppem */
*x = _hb_16dot16_mul_round (layout_context->font->x_scale, xCoordinate);
*y = _hb_16dot16_mul_round (layout_context->font->y_scale, yCoordinate);
unsigned int x_ppem = layout_context->font->x_ppem;
unsigned int y_ppem = layout_context->font->y_ppem;
hb_position_t cx, cy;
hb_bool_t ret;
if (x_ppem || y_ppem)
ret = hb_font_get_contour_point (layout_context->font, layout_context->face, anchorPoint, glyph_id, &cx, &cy);
*x = x_ppem && ret ? cx : _hb_16dot16_mul_round (layout_context->font->x_scale, xCoordinate);
*y = y_ppem && ret ? cy : _hb_16dot16_mul_round (layout_context->font->y_scale, yCoordinate);
}
inline bool sanitize (SANITIZE_ARG_DEF) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册