From: Behdad Esfahbod Date: Thu, 29 Apr 2010 07:59:06 +0000 (-0400) Subject: More contour point use X-Git-Tag: 2.0_alpha~7^2~761 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f729b45b04243c42ad7201b67cda9d5e5c363f1;p=apps%2Fhome%2Fvideo-player.git More contour point use --- diff --git a/src/hb-font.cc b/src/hb-font.cc index 3b1b6ca..d0d58f1 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -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); diff --git a/src/hb-ot-layout-gdef-private.hh b/src/hb-ot-layout-gdef-private.hh index cc037a4..e85b578 100644 --- a/src/hb-ot-layout-gdef-private.hh +++ b/src/hb-ot-layout-gdef-private.hh @@ -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) { diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index f3fb265..07c4117 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -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) {