Repository navigation
Make the bundled Liberation Sans the default font - #2957
Merged
Merged
Conversation
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>
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Measured here at 24 pt on a 54-character line:
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
("Liberation Sans", "arial"), is used by:Text,draw_text(),create_text_sprite()andTextPoolUILabel,UITextArea,UIInputTextandUITypedTextInput("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.import arcadetakes no longer.font_name="Liberation Mono"now works withoutload_liberation_fonts(), which stays available for loading them ahead of time.UITextAreaandUIInputTextpassedfont_namestraight to pyglet. They now resolve it likeTextdoes, so they also accept font file paths and resource handles.("calibri", "arial"), and now list the real one.Tests
New
tests/unit/text/test_default_font.py:Textuses Liberation Sans by default, including bold and italic.create_text_spriteworks with the default.UITextAreaandUIInputTexttake a font file path.5 of the 6 fail on development; the sixth is the
create_text_spritesmoke test.tests/conftest.pyloads 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.pynow expects the resolved font name,"Arial", instead of the tuple("Arial",).Checks
net_process_animal_factscan't run in my test harness because of multiprocessing.🤖 Generated with Claude Code