You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inventory of platform conditionals in plugins/text-freetype2/text-freetype2.c (3 #ifs). Existing pattern: find-font-{cocoa.m,unix.c,windows.c}.
lines
macro
what the branch does
75
_WIN32
flag OBS_SOURCE_DEPRECATED on the source (Windows has the GDI+ text source)
512, 514
_WIN32, __APPLE__
DEFAULT_FACE = Arial / Helvetica / Sans Serif
Proposed facade
Add to the existing find-font-* files: ft2_platform_default_face() and ft2_platform_source_flags() declared in a shared find-font.h and implemented in find-font-windows.c, find-font-cocoa.m, find-font-unix.c.
Likely must stay
Nothing. CMake OS_MACOS / OS_LINUX... / OS_WINDOWS source selection (CMakeLists.txt:11,13,25,53) stays; it is the intended mechanism.
Test approach
Behaviour-preserving moves. Verify with: the plugin's native builds on each platform (ci-full label, since these are outside the quick gate), the existing cmocka tests where the moved function is testable, and ./lint. Where a facade function is pure (path/name/constant selection) add a small unit test per platform implementation. The #847 ratchet lint baseline must go down by the count moved.
ft2_platform_source_flags() and ft2_platform_default_face(), declared in a new text-freetype2-platform.h, implemented in three new dependency-free files text-freetype2-platform-{windows,cocoa,unix}.c that CMake picks per OS like the find-font-* files. One change from the plan above: not inside find-font-*, because those pull in fontconfig/Cocoa/GDI, and the new functions are pure constants that should be unit-testable without them.
A small cmocka test for the Linux/FreeBSD implementation (face "Sans Serif", no deprecated flag), built into the test with just that file. The Windows and macOS values are checked by their native builds compiling the same expectations.
Claim bot: claimed by @zackees. It expires after 48 h (8 h on critical issues) without a progress comment here or a push, comment or review on a linked PR.
Activity
zackees commentedon Oct 16, 2026
Claiming: text-freetype2 facade.
Plan (one PR,
ci-full):ft2_platform_source_flags()andft2_platform_default_face(), declared in a newtext-freetype2-platform.h, implemented in three new dependency-free filestext-freetype2-platform-{windows,cocoa,unix}.cthat CMake picks per OS like thefind-font-*files. One change from the plan above: not insidefind-font-*, because those pull in fontconfig/Cocoa/GDI, and the new functions are pure constants that should be unit-testable without them.text-freetype2.closes its 3 conditionals; the ci: ratchet lint for platform conditionals in shared C/C++ (#847 step 1) #848 baseline drops the file.github-actions commentedon Oct 16, 2026
Claim bot: claimed by @zackees. It expires after 48 h (8 h on
criticalissues) without a progress comment here or a push, comment or review on a linked PR.text-freetype2: Move the platform defaults behind text-freetype2-plat…
text-freetype2: Move the platform defaults behind text-freetype2-plat…
text-freetype2: Move the platform defaults behind text-freetype2-plat…
text-freetype2: Move the platform defaults behind text-freetype2-plat…