Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jan 28, 2024

Conversation

Ghabry
Copy link
Member

@Ghabry Ghabry commented Dec 24, 2023

@Goburinbro

Fix #2953

Player before:

screenshot_18 png

Player after:

screenshot_19 png

RPG_RT:

grafik

@Ghabry Ghabry added this to the 0.8.1 milestone Dec 24, 2023
@Ghabry
Copy link
Member Author

Ghabry commented Dec 24, 2023

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 :)

src/font.cpp Outdated Show resolved Hide resolved
…pixel or a true type font.

Fix small rendering issues.

Fix EasyRPG#2953
@Ghabry
Copy link
Member Author

Ghabry commented Jan 4, 2024

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

@carstene1ns carstene1ns merged commit 1696ae8 into EasyRPG:master Jan 28, 2024
13 checks passed
@Ghabry Ghabry deleted the issue-2953 branch September 2, 2024 18:52
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.

Font filetype priority, font rendering issues, ignoring bitmap fonts contained within .ttf / .otf
3 participants