vcl/inc/sft.hxx | 4 +--- vcl/source/fontsubset/sft.cxx | 14 ++++---------- vcl/source/fontsubset/ttcr.cxx | 5 ++--- 3 files changed, 7 insertions(+), 16 deletions(-)
New commits: commit 5861fb95950b0ddebc8e59a14fd3997d3bc4a7aa Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed May 7 21:46:28 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu May 8 09:45:14 2025 +0200 downgrade this SAL_WARN to SAL_INFO and better describe what's going on Change-Id: Ic46a004c4459678bab4d27f247066984d67463b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185035 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 4d8a316feb20..c3d43576eec4 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1259,7 +1259,7 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, std::vec if (std::find(glyphlist.begin(), glyphlist.end(), glyphID) != glyphlist.end()) { - SAL_WARN("vcl.fonts", "Endless loop found in a compound glyph."); + SAL_INFO("vcl.fonts", "Already have this glyph, don't need to get it again"); return 0; } commit 45f2db03385a77f7d3001e65b5d6f0795394b197 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Wed May 7 21:44:13 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu May 8 09:45:03 2025 +0200 ofz#416128313 Timeout Revert "bogus "Endless loop found in a compound glyph" warnings" its not actually endless, but it is effectively so. This reverts commit 2cd059c04e15678114ecbbcf1cb50467fa5a3619. Change-Id: Ifd74e4f9ac53ae3bce4e3dc5228ad9c5ce667dc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185034 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx index df390ec4fad3..0a2697c3e062 100644 --- a/vcl/inc/sft.hxx +++ b/vcl/inc/sft.hxx @@ -536,9 +536,7 @@ class TrueTypeFont; * @ingroup sft * */ - int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, - std::vector<sal_uInt32>& glyphlist, - std::vector<sal_uInt32>& currentGlyphStack); + int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< sal_uInt32 >& glyphlist); /** * Extracts all Name Records from the font and stores them in an allocated diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 10b2f6fc3c2b..4d8a316feb20 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1239,9 +1239,7 @@ int GetTTGlyphPoints(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< return GetTTGlyphOutline(ttf, glyphID, pointArray, nullptr, nullptr); } -int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, - std::vector<sal_uInt32>& glyphlist, - std::vector<sal_uInt32>& currentGlyphStack) +int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, std::vector< sal_uInt32 >& glyphlist) { int n = 1; @@ -1259,9 +1257,9 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, if (nOffset > nNextOffset) return 0; - if (std::find(currentGlyphStack.begin(), currentGlyphStack.end(), glyphID) != currentGlyphStack.end()) + if (std::find(glyphlist.begin(), glyphlist.end(), glyphID) != glyphlist.end()) { - SAL_WARN("vcl.fonts", "Endless glyph chain found in a compound glyph."); + SAL_WARN("vcl.fonts", "Endless loop found in a compound glyph."); return 0; } @@ -1271,8 +1269,6 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, if (nOffset == nNextOffset) return n; - currentGlyphStack.push_back(glyphID); - const auto* ptr = glyf + nOffset; sal_uInt32 nRemainingData = glyflength - nOffset; @@ -1291,7 +1287,7 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, ptr += 4; nRemainingData -= 4; - n += GetTTGlyphComponents(ttf, index, glyphlist, currentGlyphStack); + n += GetTTGlyphComponents(ttf, index, glyphlist); sal_uInt32 nAdvance; if (flags & ARG_1_AND_2_ARE_WORDS) { @@ -1317,8 +1313,6 @@ int GetTTGlyphComponents(AbstractTrueTypeFont *ttf, sal_uInt32 glyphID, } while (flags & MORE_COMPONENTS); } - currentGlyphStack.pop_back(); - return n; } diff --git a/vcl/source/fontsubset/ttcr.cxx b/vcl/source/fontsubset/ttcr.cxx index 53673ad36f3f..e2095f987338 100644 --- a/vcl/source/fontsubset/ttcr.cxx +++ b/vcl/source/fontsubset/ttcr.cxx @@ -802,10 +802,9 @@ sal_uInt32 TrueTypeTableGlyf::glyfAdd(std::unique_ptr<GlyphData> glyphdata, Abst if (!glyphdata) return sal_uInt32(~0); - std::vector<sal_uInt32> glyphlist; - std::vector<sal_uInt32> currentGlyphStack; + std::vector< sal_uInt32 > glyphlist; - ncomponents = GetTTGlyphComponents(fnt, glyphdata->glyphID, glyphlist, currentGlyphStack); + ncomponents = GetTTGlyphComponents(fnt, glyphdata->glyphID, glyphlist); if (m_list.size() > 0) { ret = n = m_list.back()->newID + 1;