Skip to content

Text: a font of the player's, and every letter on the same baseline - #111

Merged
Mango77x merged 1 commit into
mainfrom
feat/text-font
Nov 14, 2026
Merged

Mango77x merged 1 commit into
mainfrom
feat/text-font

Conversation

@Mango77x

Copy link
Copy Markdown
Owner

A font of the player's for the game's text, in Freedom Unite and Freedom, and every letter on the same baseline.

Text font

  • Game settings > Video > Text font: Choose… takes a .ttf or .otf file for that copy of the game; Default goes back to Liberation Sans with Kaneda's HD text.
  • The launcher checks the file is a font (by its first bytes), copies it into its data folder (fonts/<disc id>, so moving the original changes nothing) and passes it to the game as --font.
  • Both game programs take --font: sceLibFont measures and draws the text with that font, sharp at any resolution, and takes the characters it lacks from Liberation Sans (accents, symbols) and Noto Sans JP. Kaneda's glyphs, drawn for Liberation Sans, are left out with a font of the player's.
  • MHForever-cli --font <file> | default [--disc <id>] does the same without the window.

Straight letters

Letters such as the b of "Combine" or the f of "Info" sat a pixel high or low. The game places each glyph by the corner it works out from the bearings sceFontGetCharInfo reports, and the bitmap drawn at the pen's fraction of a pixel can start a pixel off that corner. Each glyph is now placed by its pen, so every letter rests on the baseline, with the default font and with any other.

Tested

  • Freedom Unite (EU) at 2560×1440: village menu with the default font (Kaneda's glyphs, straight) and with a system font.
  • Freedom (EU): starts with and without --font, text drawn with the chosen font.
  • Launcher: --font set, rejected for a file that is not a font, game started with it (using verdana.ttf in game.log), back to default; the Text font row in the UI. Tested by the maintainer in the launcher.

Game settings > Video > Text font takes a TrueType or OpenType file for a copy of the game. The launcher checks it
is a font, copies it into its data folder (fonts/<disc id>) and passes it to the game as --font; Default goes back
to Liberation Sans with Kaneda's HD text. MHForever-cli --font <file> | default does the same without the window.

Both game programs (Freedom Unite and Freedom) take --font: sceLibFont measures and draws the text with that font,
sharp at any resolution as the HD text is, and takes the characters it lacks from Liberation Sans and Noto Sans JP.
Kaneda's glyphs, drawn for Liberation Sans, are left out with a font of the player's.

Letters no longer sit a pixel high or low (the b of "Combine", the f of "Info"): the game places each glyph by the
corner it works out from the bearings sceFontGetCharInfo reports, and the bitmap drawn at the pen's fraction of a
pixel can start a pixel off that corner. Each glyph is now placed by its pen, so every letter rests on the baseline.
@Mango77x
Mango77x merged commit fc3f3a0 into main Nov 14, 2026
8 checks passed
@Mango77x
Mango77x deleted the feat/text-font branch November 14, 2026 11:10
@Mango77x Mango77x mentioned this pull request Nov 14, 2026
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.

1 participant