Improve heuristics check to detect broken RM2000-based fonts#3463
Improve heuristics check to detect broken RM2000-based fonts#3463carstene1ns merged 2 commits intoEasyRPG:masterfrom
Conversation
…sed on RM2000.fon
|
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. |
|
I checked this now with the name check removed (as suggested by c1) and testing with various RM2000 fonts I found: This heuristic works for the fonts The other font files in the archive appear to have 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? |
|
Let's keep it as is for now. And then wait for bug reports (as usual :D) |
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":

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.