From 8d55340593ce32e55cfbd86a17c0be8750e8fb72 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 20 Nov 2017 19:43:22 -0800 Subject: [PATCH] Fix fallback positioning of double diacritic marks Fixes https://bugzilla.gnome.org/show_bug.cgi?id=787284 --- src/hb-ot-shape-fallback.cc | 4 ++-- .../856ff9562451293cbeff6f396d4e3877c4f0a436.ttf | Bin 0 -> 892 bytes test/shaping/tests/fallback-positioning.tests | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 test/shaping/fonts/sha1sum/856ff9562451293cbeff6f396d4e3877c4f0a436.ttf diff --git a/src/hb-ot-shape-fallback.cc b/src/hb-ot-shape-fallback.cc index f3308847e..458c8eaa0 100644 --- a/src/hb-ot-shape-fallback.cc +++ b/src/hb-ot-shape-fallback.cc @@ -218,10 +218,10 @@ position_mark (const hb_ot_shape_plan_t *plan, case HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW: case HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE: if (buffer->props.direction == HB_DIRECTION_LTR) { - pos.x_offset += base_extents.x_bearing - mark_extents.width / 2 - mark_extents.x_bearing; + pos.x_offset += base_extents.x_bearing + base_extents.width - mark_extents.width / 2 - mark_extents.x_bearing; break; } else if (buffer->props.direction == HB_DIRECTION_RTL) { - pos.x_offset += base_extents.x_bearing + base_extents.width - mark_extents.width / 2 - mark_extents.x_bearing; + pos.x_offset += base_extents.x_bearing - mark_extents.width / 2 - mark_extents.x_bearing; break; } HB_FALLTHROUGH; diff --git a/test/shaping/fonts/sha1sum/856ff9562451293cbeff6f396d4e3877c4f0a436.ttf b/test/shaping/fonts/sha1sum/856ff9562451293cbeff6f396d4e3877c4f0a436.ttf new file mode 100644 index 0000000000000000000000000000000000000000..23da109f182374505eed2cbe558e7dd88b9c4d2a GIT binary patch literal 892 zcmY*XJ7^S96g}_FWb-x2YQ`v{IE;c#bdq6Wiipoo)WRS5fxv=}+1+d)`+@92w0eyo zSXif15Y*nnatcLJOYKt%qE*uE?s(qJD(fBQ-h1x5_uTtF5CF!YVL@HKxO545*nm}J zbpMT8r{i5FL+jYg8N5>|nDXm$Nz`O$Lpi~d*sKPsiD zxMyMJBOtbk=PL|YpOeR|KS6w~Qf+SLkkFL}s3zCzD-mAcHuJv`k5r@01_Hqe#arT| zwWwN>TceZA-zHvY)Hj;HTdxnZzo|cu0Vw9ik^v0D!9j5Cv=fA0=sB(v!~D9(momJ*X97Eu!KF>s;&9{{A|z8r8WpJq{-X@naspvy<&qz Gwu?U@7Me}~ literal 0 HcmV?d00001 diff --git a/test/shaping/tests/fallback-positioning.tests b/test/shaping/tests/fallback-positioning.tests index 3eace30c8..86f5640c2 100644 --- a/test/shaping/tests/fallback-positioning.tests +++ b/test/shaping/tests/fallback-positioning.tests @@ -1 +1,2 @@ fonts/sha1sum/8228d035fcd65d62ec9728fb34f42c63be93a5d3.ttf::U+0078,U+0301,U+0058,U+0301:[x=0+1030|acutecomb=0@-21,-27+0|X=2+1295|acutecomb=2@-147,320+0] +fonts/sha1sum/856ff9562451293cbeff6f396d4e3877c4f0a436.ttf::U+0061,U+035C,U+0062:[uni0061=0+512|uni035C=0@-64,-128+0|uni0062=2+512]