From 57f4ebfb5fb54d97a617d2f1410a123058653088 Mon Sep 17 00:00:00 2001 From: sarodz Date: Wed, 25 Feb 2026 03:26:13 -0500 Subject: [PATCH 1/3] update gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index b3e9c2960..633d6a6db 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,6 @@ stamp-h1 /testing/output/*.md /testing/output/actual/*.png /testing/output/difference/*.png + +/test_issue* +build/ \ No newline at end of file From 38ffad41a70ad9b04c18030b90ad682f5db995db Mon Sep 17 00:00:00 2001 From: sarodz Date: Wed, 4 Feb 2026 14:31:52 -0500 Subject: [PATCH 2/3] Fix buffer range merging in HarfbuzzShaper to check cluster contiguity --- src/modules/font/freetype/HarfbuzzShaper.cpp | 27 +++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/modules/font/freetype/HarfbuzzShaper.cpp b/src/modules/font/freetype/HarfbuzzShaper.cpp index dbcae81e0..f52219637 100644 --- a/src/modules/font/freetype/HarfbuzzShaper.cpp +++ b/src/modules/font/freetype/HarfbuzzShaper.cpp @@ -163,21 +163,36 @@ void HarfbuzzShaper::computeBufferRanges(const ColoredCodepoints &codepoints, Ra for (size_t i = 0; i < glyphcount; i++) { + uint32 prevCluster = (i > 0) ? glyphinfos[i - 1].cluster : 0; + uint32 currCluster = glyphinfos[i].cluster; + // Only merge consecutive glyphs if their clusters are also consecutive + bool clustersContiguous = (i == 0) || (currCluster == prevCluster + 1) || (currCluster == prevCluster); + if (isValidGlyph(glyphinfos[i].codepoint, codepoints.cps, glyphinfos[i].cluster)) { - if (bufferranges.empty() || bufferranges.back().index != rasti || bufferranges.back().range.getMax() + 1 != i) - bufferranges.push_back({rasti, (int)glyphinfos[i].cluster, Range(i, 1)}); - else + bool canExtendPrevious = !bufferranges.empty() + && bufferranges.back().index == rasti + && bufferranges.back().range.getMax() + 1 == i + && clustersContiguous; + + if (canExtendPrevious) bufferranges.back().range.last++; + else + bufferranges.push_back({rasti, (int)glyphinfos[i].cluster, Range(i, 1)}); } else if (rasti == rasterizers.size() - 1) { // Use the first font for remaining invalid glyphs when no // fallback font supports them. - if (bufferranges.empty() || bufferranges.back().index != 0 || bufferranges.back().range.getMax() + 1 != i) - bufferranges.push_back({0, (int)glyphinfos[i].cluster, Range(i, 1)}); - else + bool canExtendPrevious = !bufferranges.empty() + && bufferranges.back().index == 0 + && bufferranges.back().range.getMax() + 1 == i + && clustersContiguous; + + if (canExtendPrevious) bufferranges.back().range.last++; + else + bufferranges.push_back({0, (int)glyphinfos[i].cluster, Range(i, 1)}); } else { From 281cc42723f7c6ed7888350243e3b496d44cf2b8 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Thu, 16 Apr 2026 23:04:31 -0300 Subject: [PATCH 3/3] Revert "update gitignore" This reverts commit 57f4ebfb5fb54d97a617d2f1410a123058653088. --- .gitignore | 3 --- 1 file changed, 3 deletions(-) diff --git a/.gitignore b/.gitignore index 633d6a6db..b3e9c2960 100644 --- a/.gitignore +++ b/.gitignore @@ -75,6 +75,3 @@ stamp-h1 /testing/output/*.md /testing/output/actual/*.png /testing/output/difference/*.png - -/test_issue* -build/ \ No newline at end of file