Skip to content

text-freetype2: Move the platform defaults behind text-freetype2-platform-<os>.c - #936

Merged
zackees merged 1 commit into
masterfrom
facade/863-text-freetype2
Oct 16, 2026
Merged

zackees merged 1 commit into
masterfrom
facade/863-text-freetype2

Conversation

@zackees

@zackees zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

Fixes #863 (part of #847).

The 3 platform conditionals in plugins/text-freetype2/text-freetype2.c move behind two functions declared in text-freetype2-platform.h, one dependency-free implementation per OS that CMake picks like the find-font-* files:

file ft2_platform_source_flags() ft2_platform_default_face()
text-freetype2-platform-windows.c OBS_SOURCE_DEPRECATED (Windows has the GDI+ text source) Arial
text-freetype2-platform-cocoa.c 0 Helvetica
text-freetype2-platform-unix.c 0 Sans Serif

A static initializer cannot call a function, so obs_module_load ORs the flags into freetype2_source_info_v2 before registering it: the registered flags are unchanged. Not placed in find-font-* (as #863 suggested) because those pull in fontconfig/Cocoa/GDI, and these are pure constants worth unit-testing alone.

  • text-freetype2.c has no platform conditionals left; ci/platform-ifdef-baseline.json drops it.
  • New test_text_freetype2_platform pins the Linux/BSD values (built from that file alone).
  • tests.d/test_text_aa_file.cmake, which compiles the plugin's sources into its test, also builds text-freetype2-platform-unix.c (build wiring only, the test code is unchanged).

Local: ratchet ok, ./lint ok; Tier 2 OFF: test_text_aa_file and test_text_freetype2_platform pass. That run hit test_async_delay_audio (the real-time audio flake, #838), so the harness stopped before the ON build. PR CI runs both; ci-full is set so the Windows and macOS plugin builds compile the other two files.

@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 16, 2026
@zackees
zackees added this pull request to the merge queue Oct 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 16, 2026
@zackees
zackees force-pushed the facade/863-text-freetype2 branch from 8d580ee to 30ae742 Compare October 16, 2026 02:21
@zackees
zackees added this pull request to the merge queue Oct 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 16, 2026
@zackees
zackees force-pushed the facade/863-text-freetype2 branch from 30ae742 to 832b16e Compare October 16, 2026 05:20
@zackees
zackees enabled auto-merge October 16, 2026 05:20
…form-<os>.c

The source's Windows-only OBS_SOURCE_DEPRECATED flag and the per-OS
default face (Arial / Helvetica / Sans Serif) move from #ifdefs in
text-freetype2.c into ft2_platform_source_flags() and
ft2_platform_default_face(), one dependency-free file per OS picked by
CMake. A static initializer cannot call a function, so obs_module_load
ORs the flags in before registering the source: the registered flags
are unchanged. text-freetype2.c has no platform conditionals left; the
Linux/BSD values.

Refs #863
@zackees
zackees force-pushed the facade/863-text-freetype2 branch from 832b16e to b74301a Compare October 16, 2026 06:08
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Rebased onto master after #981 merged: replaced head 832b16ed1 (someone's earlier rebase of this branch, kept as the base) with b74301a7f, verified on the remote. The only conflict was ci/platform-ifdef-baseline.json, regenerated with --update: it now differs from master by exactly the text-freetype2.c line. Ratchet and ./lint ok. Both earlier queue removals were failed_checks from real-time flakes (test_vlc_playlist_gap in run 38850208674), logged on #838.

@zackees
zackees added this pull request to the merge queue Oct 16, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Oct 16, 2026
@zackees
zackees merged commit 66f9f8a into master Oct 16, 2026
30 checks passed
@zackees
zackees deleted the facade/863-text-freetype2 branch October 26, 2026 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

facade: plugins/text-freetype2: move 3 platform conditionals behind a per-platform layer

1 participant