From d7c78e8d1484e6bc8d8d134d48374c69ad8176dc Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Sun, 19 Jul 2026 08:07:06 +0000 Subject: [PATCH 06/71] debug(macos): print CoreText locator output in the render probe Font loading fails even with family=Menlo, which points at the CoreText locator->FreeType handoff rather than the compositor. Add a diagnostic that constructs the coretext_locator directly and prints the resolved font path(s) and collection index for the regular face, to distinguish a locator bug (bad or empty path) from a shaper/FreeType load failure. Temporary; will be removed once the locator is confirmed working. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01AeG2jwYMX5gdvvtUnx3PJa --- src/contour_macos/render_probe.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/contour_macos/render_probe.cpp b/src/contour_macos/render_probe.cpp index 58a7d93d..9c7b69a4 100644 --- a/src/contour_macos/render_probe.cpp +++ b/src/contour_macos/render_probe.cpp @@ -10,6 +10,11 @@ #include +#if defined(__APPLE__) + #include +#endif +#include + #include #include @@ -24,6 +29,7 @@ #include #include #include +#include namespace { @@ -81,6 +87,27 @@ int main(int argc, char** argv) fonts.boldItalic.weight = text::font_weight::bold; fonts.boldItalic.slant = text::font_slant::italic; +#if defined(__APPLE__) + // Diagnostic: show exactly what the CoreText locator resolves for the regular face, + // isolating a locator bug (bad/empty path) from a shaper/FreeType load failure. + { + text::coretext_locator locator; + auto const sources = locator.locate(fonts.regular); + std::printf("locator.locate(regular=%s) -> %zu source(s):\n", family, sources.size()); + for (auto const& s: sources) + { + if (std::holds_alternative(s)) + { + auto const& p = std::get(s); + std::printf(" path='%s' collectionIndex=%d\n", p.value.c_str(), p.collectionIndex); + } + else + std::printf(" (in-memory source)\n"); + } + std::fflush(stdout); + } +#endif + auto renderer = Renderer { pageSize, fonts, colorPalette,