Skip to content

Conversation

@florianessl
Copy link
Member

This came up in yesterday's discussion on EasyRPGs chat:

The Mexican fangame "Necklace of Elements" (https://rmarchiv.de/games/3824) uses its own custom font that was based on the broken RM2000.fon file which needs to be interpreted & rendered with a fixed size of 6 pixels.

EasyRPG loading up this custom "TLOZFONT":
image

Previously, the Player only checked for the font's name which was replaced in this case, so some other heuristics are needed to identify it.

This PR adds a new check, that loads up some glyph sizes and checks if the characters for uppercase 'I' & ' ' are unusually wide (15 pixels) while other characters ('h', lowercase 'l') have a fixed size of 6 & 4 respectively.

@github-actions github-actions bot added the Fonts label Aug 2, 2025
@florianessl florianessl changed the title Imrprove heuristics check to detect broken RM2000-based fonts Improve heuristics check to detect broken RM2000-based fonts Aug 2, 2025
@carstene1ns
Copy link
Member

Question is, do we need the cheap name check at all now? What about fonts that are called like that and have been changed in other ways? IMO the new size check is sufficient as it covers more edge-cases.

@Ghabry
Copy link
Member

Ghabry commented Oct 12, 2025

I checked this now with the name check removed (as suggested by c1) and testing with various RM2000 fonts I found:

Fonts.zip

This heuristic works for the fonts RM2000_8 and RM2003_8.

The other font files in the archive appear to have 15 as the width for h and l (actually they have 15 for all glyphs in the font). So their are different types of broken metrics fonts. xD

Question is if @florianessl wants to tune the heuristic to also detect this so we can get rid of the name check or is this a bad idea as can cause false positives?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants