Font sizes are broken #22
Labels
No Label
RGSS accuracy
bug
compilation
discussion
documentation
duplicate
enhancement
invalid
performance issue
port request
question
ruby incompatibility
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: MapleShrine/mkxp#22
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Yep.
https://github.com/Ancurio/mkxp/blob/dev/src/font.cpp#L119:
this mostly works when substituting the compiled-in Liberation Sans for Arial, at the default size of 22, but is otherwise horribly broken. I have tried to determine the font scaling factors for both SDL_TTF and RMXP (using the char '_'), using the resulting ratio to compensate for the difference, but it turns out the ratio is different for each font; at the moment I'm just at an dead end.
I'm not even sure how RMXP does font rendering (I'd guess DirectWrite??)RMXP uses GDI for font rendering. There must be something like a hint hidden in the metadata on how to scale fonts correctly.The good old GDI: CreateFontIndirect and GetGlyphOutline. DirectWrite is only available on Vista and newer.
Is RM's font size by pixel and SDL_TTF's by point?
SDL_ttf is point size, based on 72DPI.
I changed the scaling factor from 0.9 to 1. When mkxp displays Chinese font SimHei, the size is exactly the same as rmxp. But somehow I am not able to test English fonts. For example, if I put arial.ttf in Fonts folder, and add a line Font.default_name = (["Arial"]), it does not use that font at all.