From b0e00d7b7fd82a4c4abcd28b467fd83ed6ee6164 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Fri, 18 Aug 2017 00:45:37 +0200 Subject: Fix vertical RTL text with upright orientation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When orientation is upright we don’t want Pango to use the natural gravity of the text (that would be the mixed orientation). This also changes the positioning of combining marks in such case. It is still wrong, however, but it matches Pango output now. --- src/libnrtype/Layout-TNG-Compute.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libnrtype') diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp index f812f0c41..504314046 100644 --- a/src/libnrtype/Layout-TNG-Compute.cpp +++ b/src/libnrtype/Layout-TNG-Compute.cpp @@ -1746,6 +1746,10 @@ bool Layout::Calculator::calculate() if( _block_progression == RIGHT_TO_LEFT || _block_progression == LEFT_TO_RIGHT ) { // Vertical text, CJK pango_context_set_base_gravity(_pango_context, PANGO_GRAVITY_EAST); + + if( _flow._blockTextOrientation() != SP_CSS_TEXT_ORIENTATION_MIXED ) { + pango_context_set_gravity_hint(_pango_context, PANGO_GRAVITY_HINT_STRONG); + } } else { // Horizontal text pango_context_set_base_gravity(_pango_context, PANGO_GRAVITY_AUTO); -- cgit v1.2.3