EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
965 stars 183 forks source link

FreeType: Calculate font size correctly depending on whether it is a pixel or a truetype font. #3179

Closed Ghabry closed 5 months ago

Ghabry commented 6 months ago

@Goburinbro

Fix #2953

Player before:

screenshot_18 png

Player after:

screenshot_19 png

RPG_RT:

grafik

Ghabry commented 6 months ago

Very very good news: I figured out why the spacing was wrong (glyphs too close to each other): Rounding error :/

@Mimigris guess this resolves your "custom spacing option" request. As there is no need for it anymore :)

Old (EasyRPG) New (EasyRPG)
screenshot_1 png hb_1
screenshot_2 png hb_2
screenshot_3 png hb_3

New compared to RPG_RT:

New (EasyRPG) RPG_RT (for reference)
hb_1 rpgrt1
hb_2 rpgrt2
hb_3 rpgrt3

The 3rd case has different metrics but otherwise it matches perfectly :)

Ghabry commented 6 months ago

I changed the rounding algorithm for better accuracy (round instead of ceil works better). The metrics are now shown in the message boxes below. This is ready

Noto Sans Mono:

New (EasyRPG) RPG_RT (for reference)
grafik grafik
grafik grafik
grafik grafik

Mother 12px Font: (one small mismatch in the 2nd row)

New (EasyRPG) RPG_RT (for reference)
grafik grafik
grafik grafik
grafik grafik