From 402176e70d0bf696de1e88040a130e20902ab4f2 Mon Sep 17 00:00:00 2001 From: Bob Singor Date: Sun, 1 Nov 2026 18:33:01 +0200 Subject: [PATCH] Check rich fallback coverage with a plain loop On a 16-bit wchar_t platform (Windows) pdfium::CodePointView is a small class meant for range-based for loops, not a range std::ranges::all_of accepts, so FindRichFallback() no longer compiled for win32-x64 and win32-arm64. Elsewhere CodePointView is WideStringView, which is why the Mac and Linux builds were fine. --- core/fpdfdoc/cpdf_annotfontmap.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/fpdfdoc/cpdf_annotfontmap.cpp b/core/fpdfdoc/cpdf_annotfontmap.cpp index 653ff8dc6..1f02974f0 100644 --- a/core/fpdfdoc/cpdf_annotfontmap.cpp +++ b/core/fpdfdoc/cpdf_annotfontmap.cpp @@ -926,11 +926,16 @@ int CPDF_AnnotFontMap::FindRichFallback(WideStringView grapheme, } for (CFX_FontRegistry::FontId font_id : CFX_FontRegistry::GetFallbackOrder( weight, italic, /*for_authoring=*/true)) { - const bool covers = std::ranges::all_of( - pdfium::CodePointView(grapheme), [font_id](char32_t cp) { - return !NeedsGlyph(cp) || CFX_FontRegistry::SupportsUnicode( - font_id, static_cast(cp)); - }); + // A plain loop: on a 16-bit wchar_t platform CodePointView is no range a + // std::ranges algorithm accepts, only something to iterate. + bool covers = true; + for (char32_t cp : pdfium::CodePointView(grapheme)) { + if (NeedsGlyph(cp) && !CFX_FontRegistry::SupportsUnicode( + font_id, static_cast(cp))) { + covers = false; + break; + } + } if (covers) { return EntryForRegisteredFont(font_id); }