Skip to content

text-freetype2: Default to the bundled JetBrainsMono Nerd Font - #1016

Merged
zackees merged 3 commits into
masterfrom
feat/text-ft2-jetbrains-mono
Oct 16, 2026
Merged

zackees merged 3 commits into
masterfrom
feat/text-ft2-jetbrains-mono

Conversation

@zackees

@zackees zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

Fixes #1012 (maintainer request).

The Text (FreeType 2) source now defaults to JetBrainsMono Nerd Font on every OS (Omarchy's terminal and bar font), bundled with the plugin, so it works without the font installed. Before: Arial on Windows, Helvetica on macOS, Sans Serif on Linux (#936). Existing sources keep their saved font.

  • plugins/text-freetype2/data/fonts/: Regular, Bold, Italic and Bold Italic from the pinned Nerd Fonts v3.4.0 release (JetBrainsMono.zip, sha256 76f05ff3ace48a464a6ca57977998784ff7bdbb65a6d915d7e401cd3927c493c), about 9.9 MB, plus OFL.txt. It's SIL Open Font License 1.1, so redistribution with software is allowed with the license alongside.
  • FT2_DEFAULT_FACE in text-freetype2-platform.h, returned by all three OS files.
  • load_bundled_fonts(dir), called at plugin load with obs_module_file("fonts"). On Linux it's fontconfig's FcConfigAppFontAddDir; on Windows and macOS every face of every .ttf/.otf in the folder joins the plugin's font list (build_font_path_info).
  • Packaging (AGENTS.md, bug: AppImage: releases crash on launch when a scene has a PipeWire screen capture #426): test-appimage.sh fails when the AppImage lacks any of the four styles or OFL.txt under obs-plugins/text-freetype2/fonts/.

Tests:

  • New test_text_freetype2_bundled_font (Linux, the real find-font-unix.c + fontconfig): the default face is JetBrainsMono Nerd Font, and Regular, Bold, Italic and Bold Italic each resolve to their bundled file on a machine without the font (the Tier 2 container).
  • test_text_freetype2_platform (text-freetype2: Move the platform defaults behind text-freetype2-platform-<os>.c #936) is updated to expect the new default. Its existing "Sans Serif" assertion pinned the old per-OS default; this is a deliberate default change, not a port, so the expectation changes with it.

RED 94be809, local Tier 2 OFF build: both tests fail, "Sans Serif" != "JetBrainsMono Nerd Font" and the path check 2 != 0 (resolved outside the bundled folder; stub registers nothing).
GREEN 1856644, local Tier 2 OFF build: 256/256 passed, including both. ON build running locally; result in a comment. clang-format and gersemi pass.

PR CI defers Tier 2 to master pushes (#993), so the local runs above are this PR's Tier 2 evidence. The Windows and macOS code path compiles only there (macOS/Windows jobs).

@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 enabled auto-merge October 16, 2026 07:33
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Local Tier 2 (Docker harness) on GREEN 1856644:

RED 94be809 on the same harness: both font tests fail ("Sans Serif" != "JetBrainsMono Nerd Font"; path check 2 != 0).

@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Added ci-full: Tier 2 macOS/Windows build only libobs and cmocka-tests, so the Windows/macOS load_bundled_fonts path in find-font.c would otherwise compile nowhere before merge. The full macOS and Windows OBS builds compile the plugin.

@zackees zackees closed this Oct 16, 2026
auto-merge was automatically disabled October 16, 2026 08:19

Pull request was closed

@zackees zackees reopened this Oct 16, 2026
@zackees
zackees force-pushed the feat/text-ft2-jetbrains-mono branch from df0be84 to 8c71aa5 Compare October 16, 2026 08:20
@zackees
zackees enabled auto-merge October 16, 2026 08:20
zackees added a commit that referenced this pull request Oct 16, 2026
…ng Qt (#1046)

The Fast Gate's "Build Touched Linux Targets" step configured the tree
without Qt, but plugins/frontend-tools is a core module that calls
find_package(Qt6 REQUIRED Widgets). So every PR that touched a plugin failed
at configure (#1031, #1037, #1016). Install the distro Qt packages for that
step so configure passes. Only the touched non-Qt targets are built, and the
Qt build and tests stay in the path-scoped Qt lane.
@zackees zackees closed this Oct 16, 2026
auto-merge was automatically disabled October 16, 2026 08:40

Pull request was closed

@zackees zackees reopened this Oct 16, 2026
zackees added a commit to chriscoveries/obsrust-fork that referenced this pull request Oct 16, 2026
…ix) (obs-rust#1045)

* test: Qt plugins opt out before requiring Qt (RED)

The Fast Gate (obs-rust#1013) configures the touched Linux targets with no Qt.
frontend-tools calls find_package(Qt6 REQUIRED) unconditionally, so that
configure fails on every PR that builds C (obs-rust#1016, obs-rust#1031, obs-rust#1037).

* frontend-tools: Skip the plugin when the frontend is off (GREEN)

frontend-tools is frontend UI and requires Qt. Return before
find_package(Qt6) when ENABLE_FRONTEND is OFF, as the AJA, DeckLink, VST
and websocket plugins do with their own options, so the Fast Gate's
Qt-free configure succeeds.
@zackees
zackees enabled auto-merge October 16, 2026 08:50
@zackees
zackees force-pushed the feat/text-ft2-jetbrains-mono branch from 8c71aa5 to f595f58 Compare October 16, 2026 08:50
…(RED, Refs #1012)

Bundles JetBrainsMono Nerd Font Regular, Bold, Italic and Bold Italic
(Nerd Fonts v3.4.0, SIL OFL 1.1, OFL.txt alongside) in the plugin's
data/fonts. test_text_freetype2_bundled_font expects the default face to
be JetBrainsMono Nerd Font and each style to resolve to its bundled file
without the font installed; test_text_freetype2_platform expects the new
default. Fails: load_bundled_fonts is a stub and the default is still
Sans Serif.
…1012)

The default face is JetBrainsMono Nerd Font on every OS (FT2_DEFAULT_FACE)
instead of Arial, Helvetica or Sans Serif. load_bundled_fonts makes the
plugin's data/fonts findable without installing them: fontconfig's
FcConfigAppFontAddDir on Linux, and on Windows and macOS each bundled
face joins the plugin's font list. test-appimage.sh checks the AppImage
ships the four styles and OFL.txt.
@zackees zackees removed 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 force-pushed the feat/text-ft2-jetbrains-mono branch from f595f58 to 95e4a36 Compare October 16, 2026 09:00
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

With #1047 merged, the AppImage now builds. The new packaging check from this PR fails on Arch and Debian:

text-freetype2's bundled font file JetBrainsMonoNerdFont-Regular.ttf is missing   (and Bold, Italic, BoldItalic, OFL.txt)

So the fonts aren't in the AppImage. That's the check doing its job, and it's a real GREEN gap. What I've ruled out:

  • Path in the test: it's right. The AppImage reports OBS-Studio-Rust 0.1.0, so PACKAGE_DATA is usr/share/obs-studio-rust.
  • Git LFS: the fonts are real 2.4 MB blobs in git.
  • AppDir pruning: assemble-appdir.sh deletes no data files.
  • Stale build: Build AppImage did a real 6-minute build. Only the ccache and cargo caches were restored.
  • CMake install: target_install_resources in cmake/linux/helpers.cmake GLOB_RECURSEs and installs the whole data/ folder, so data/fonts/ should install.

Worth checking next: whether share/obs-studio-rust/obs-plugins/text-freetype2/ exists in the AppImage at all, for example locale/. Also check whether the AppImage Dockerfile builds from a checkout that has this PR's data/fonts, as opposed to a cached or pinned source tree.

…ata (Refs #1012)

Plugin data sits at $PACKAGE_DATA/obs-modules/core/<plugin>/, not
obs-plugins/<plugin>/. The check looked in the wrong place and reported
all five files missing although the AppImage ships them
(usr/share/obs-studio-rust/obs-modules/core/text-freetype2/fonts/).
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

The AppImage distro tests flagged the bundled fonts as missing. That was my check's path (obs-plugins/text-freetype2/fonts), not the package: the built AppImage (run 38877476092) ships all five files at usr/share/obs-studio-rust/obs-modules/core/text-freetype2/fonts/. The check now finds the plugin's fonts/ dir under $PACKAGE_DATA; verified against the extracted AppImage (all 5 found) and against an empty tree (reports missing).

The distro tests' other failure, 240 bundled ELF files do not load from the bundle, is master-wide (#1047's own four distro tests fail on it). The ELF check still expects bundled glibc, which the glibc 2.28 change (#926/#927) stopped shipping. It's not from this PR.

@zackees
zackees added this pull request to the merge queue Oct 16, 2026
Merged via the queue into master with commit 29b6d27 Oct 16, 2026
29 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

text-freetype2: Bundle JetBrainsMono Nerd Font and make it the default face on every OS

1 participant