Skip to content

Make the bundled Liberation Sans the default font - #2957

Merged
pvcraven merged 2 commits into
developmentfrom
liberation-sans-default
Oct 8, 2026
Merged

pvcraven merged 2 commits into
developmentfrom
liberation-sans-default

Conversation

@pvcraven

@pvcraven pvcraven commented Oct 8, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #1135: the default font is now Liberation Sans, which comes with Arcade, instead of ("calibri", "arial").

Why

The system-font default looked different on each computer: Calibri on Windows, usually Arial on macOS, and whatever fontconfig picks for Arial on Linux. Liberation Sans was pushfoo's recommendation in the issue:

  • It's already bundled with Arcade.
  • It's under the SIL Open Font License.
  • It's metric-compatible with Arial.

Measured here at 24 pt on a 54-character line:

Font Width
Calibri (today's default on Windows) 746 px
Arial 828 px
Liberation Sans 828 px

So macOS and most Linux users see text the same size as before, and text on Windows gets about 10% wider. The changelog entry is under Unreleased → Breaking Changes, and says font_name=("calibri", "arial") brings back the old look.

Changes

  • The new default, ("Liberation Sans", "arial"), is used by:
    • Text, draw_text(), create_text_sprite() and TextPool
    • UILabel, UITextArea, UIInputText and UITypedTextInput
  • Buttons default to ("Kenney Future", "Liberation Sans", "arial"). Kenney Future is still used first if you've loaded the Kenney fonts. Before, it fell back to Arial or Calibri.
  • Loaded on first use: when a requested font list includes a Liberation family (Sans, Serif or Mono, in any case), its four styles are loaded the first time, which takes about 18 ms. Nothing has to be loaded first, and import arcade takes no longer. font_name="Liberation Mono" now works without load_liberation_fonts(), which stays available for loading them ahead of time.
  • UITextArea and UIInputText passed font_name straight to pyglet. They now resolve it like Text does, so they also accept font file paths and resource handles.
  • Docs:
    • The text guide, the GUI style and concepts pages, and the Liberation resources page describe the new default and loading.
    • The GUI concepts tables already listed the wrong button default, ("calibri", "arial"), and now list the real one.

Tests

New tests/unit/text/test_default_font.py:

  • Text uses Liberation Sans by default, including bold and italic.
  • create_text_sprite works with the default.
  • Using a Liberation family's name loads its four files, and other names load nothing.
  • The GUI text widgets use Liberation Sans.
  • UITextArea and UIInputText take a font file path.

5 of the 6 fail on development; the sixth is the create_text_sprite smoke test. tests/conftest.py loads the Liberation fonts for every test, so the first-use test records which files are loaded rather than checking whether the font exists.

test_uitextarea_styles.py now expects the resolved font name, "Arial", instead of the tuple ("Arial",).

Checks

  • Examples: the 59 text and GUI examples ran in a hidden window. 58 run, and net_process_animal_facts can't run in my test harness because of multiprocessing.
  • Full suite: 1825 passed.
  • Code checks: ruff, mypy and pyright pass.

🤖 Generated with Claude Code

Paul V Craven and others added 2 commits October 8, 2026 14:55
The default font was ("calibri", "arial"), so text looked different on
each computer: Calibri on Windows, usually Arial on macOS, and whatever
fontconfig picked on Linux. Liberation Sans comes with Arcade under the
SIL Open Font License and has Arial's metrics, so text now looks the
same everywhere (#1135). Text on Windows is about 10% wider than with
Calibri.

The default is ("Liberation Sans", "arial") for Text, draw_text,
create_text_sprite, TextPool, UILabel, UITextArea, UIInputText and
UITypedTextInput, and buttons use ("Kenney Future", "Liberation Sans",
"arial"). Using a Liberation family's name loads its four styles the
first time, so nothing has to be loaded first and import time doesn't
change. UITextArea and UIInputText now resolve font names like Text, so
they also take font file paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arial isn't installed on the Linux CI machines, so ("Arial",) resolved
to DejaVu Sans there. Liberation Serif comes with Arcade, so it resolves
to the same name everywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pvcraven
pvcraven merged commit 9ec7bc8 into development Oct 8, 2026
7 checks passed
@pvcraven
pvcraven deleted the liberation-sans-default branch October 8, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundle a ttf for Arcade's default font

1 participant