From 69e670bee91c1c24cef184da4135d0dece33ecf6 Mon Sep 17 00:00:00 2001 From: Martin Hosken Date: Tue, 22 Sep 2015 11:23:03 +0700 Subject: Fix graphite sole diacritic rendering Change-Id: If44ab2ff8c860fbed2af3b4702fa031675e425f4 Reviewed-on: https://gerrit.libreoffice.org/18757 Tested-by: Jenkins Reviewed-by: Martin Hosken --- vcl/source/glyphs/graphite_layout.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'vcl/source/glyphs/graphite_layout.cxx') diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index bf38a491d232..305a5d4aa3b5 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -152,7 +152,12 @@ GraphiteLayout::fillFrom(gr_segment * pSegment, ImplLayoutArgs &rArgs, float fSc nextBaseSlot = get_next_base(bRtl ? gr_slot_prev_in_segment(baseSlot) : gr_slot_next_in_segment(baseSlot), bRtl); nextBoundary = nextBaseSlot ? gr_slot_origin_X(nextBaseSlot) : gr_seg_advance_X(pSegment); if (firstChar < mnMinCharPos || firstChar >= mnEndCharPos) + { + // handle clipping of diacritic from base + nextBaseSlot = bRtl ? gr_slot_prev_in_segment(baseSlot) : gr_slot_next_in_segment(baseSlot); + nextBoundary = nextBaseSlot ? gr_slot_origin_X(nextBaseSlot) : gr_seg_advance_X(pSegment); continue; + } // handle reordered clusters. Presumes reordered glyphs have monotonic opposite char index until the cluster base. bool isReordered = (nextBaseSlot && ((bRtl != (gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(nextBaseSlot))) < firstChar - mnSegCharOffset)) || gr_cinfo_base(gr_seg_cinfo(pSegment, gr_slot_before(nextBaseSlot))) == firstChar - mnSegCharOffset)); @@ -523,7 +528,7 @@ DeviceCoordinate GraphiteLayout::FillDXArray( DeviceCoordinate* pDXArray ) const void GraphiteLayout::AdjustLayout(ImplLayoutArgs& rArgs) { SalLayout::AdjustLayout(rArgs); - if(rArgs.mpDXArray) + if(rArgs.mpDXArray && mvGlyphs.size()) { std::vector vDeltaWidths(mvGlyphs.size(), 0); ApplyDXArray(rArgs, vDeltaWidths); -- cgit v1.2.3