From 15a0220c336113a2df8de91ec0513b1bdde35a89 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 20 May 2009 04:51:30 -0400 Subject: [PATCH] [GPOS] Finally it's working, up to Cursive Wow, IranNastaliq renders perfectly again! --- pango/opentype/hb-ot-layout.cc | 24 ++++++++++++++++++++++++ pango/opentype/hb-ot-layout.h | 12 ++++++++++++ pango/pango-ot-info.c | 15 +++++++++++++-- 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/pango/opentype/hb-ot-layout.cc b/pango/opentype/hb-ot-layout.cc index ced7c95..3c1625c 100644 --- a/pango/opentype/hb-ot-layout.cc +++ b/pango/opentype/hb-ot-layout.cc @@ -89,6 +89,30 @@ hb_ot_layout_set_direction (hb_ot_layout_t *layout, layout->gpos_info.r2l = !!r2l; } +void +hb_ot_layout_set_hinting (hb_ot_layout_t *layout, + hb_bool_t hinted) +{ + layout->gpos_info.dvi = !hinted; +} + +void +hb_ot_layout_set_scale (hb_ot_layout_t *layout, + hb_16dot16_t x_scale, hb_16dot16_t y_scale) +{ + layout->gpos_info.x_scale = x_scale; + layout->gpos_info.y_scale = y_scale; +} + +void +hb_ot_layout_set_ppem (hb_ot_layout_t *layout, + unsigned int x_ppem, unsigned int y_ppem) +{ + layout->gpos_info.x_ppem = x_ppem; + layout->gpos_info.y_ppem = y_ppem; +} + + /* * GDEF */ diff --git a/pango/opentype/hb-ot-layout.h b/pango/opentype/hb-ot-layout.h index 3e83c36..148c609 100644 --- a/pango/opentype/hb-ot-layout.h +++ b/pango/opentype/hb-ot-layout.h @@ -52,6 +52,18 @@ void hb_ot_layout_set_direction (hb_ot_layout_t *layout, hb_bool_t r2l); +void +hb_ot_layout_set_hinting (hb_ot_layout_t *layout, + hb_bool_t hinted); + +void +hb_ot_layout_set_scale (hb_ot_layout_t *layout, + hb_16dot16_t x_scale, hb_16dot16_t y_scale); + +void +hb_ot_layout_set_ppem (hb_ot_layout_t *layout, + unsigned int x_ppem, unsigned int y_ppem); + /* TODO sanitizing API/constructor (make_writable_func_t) */ /* TODO get_table_func_t constructor */ diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c index de21154..2f43345 100644 --- a/pango/pango-ot-info.c +++ b/pango/pango-ot-info.c @@ -556,8 +556,17 @@ _pango_ot_info_position (const PangoOTInfo *info, unsigned int i; _hb_buffer_clear_positions (buffer->buffer); - _hb_buffer_clear_positions (buffer->buffer); - hb_ot_layout_set_direction (info->layout, buffer->rtl); + + hb_ot_layout_set_direction (info->layout, + buffer->rtl); + hb_ot_layout_set_hinting (info->layout, + buffer->font->is_hinted); + hb_ot_layout_set_scale (info->layout, + info->face->size->metrics.x_scale, + info->face->size->metrics.y_scale); + hb_ot_layout_set_ppem (info->layout, + info->face->size->metrics.x_ppem, + info->face->size->metrics.y_ppem); for (i = 0; i < ruleset->rules->len; i++) { @@ -609,4 +618,6 @@ _pango_ot_info_position (const PangoOTInfo *info, positions[j].y_pos += positions[j - positions[j].cursive_chain].y_pos; } } + + buffer->applied_gpos = TRUE; } -- 2.7.4