Font size problems #161

Open
opened 2017-03-10 04:18:47 +00:00 by twuky · 6 comments
twuky commented 2017-03-10 04:18:47 +00:00 (Migrated from github.com)

Hi,
I've been working on setting up a game of mine with MKXP (The prebuilt version linked in the README, which I understand is dated), which for the most part is going smoothly. The only issue I'm having is that the size of the font appears drastically different depending on whether I launch from MKXP or not. I'm using a font that I put together myself. The font is pixelated so in order for it to look correctly on the screen it needs to be a certain size. When I was just running the game in RPGmaker I had set the font size to 25 and it looked fine. When Launching from MKXP, however, the font appears much smaller. In order for the font to appear correctly in MKXP I had to set the font size to 40. And while I would have been willing to make that compromise, having a font that large causes issues with text placement, namely the large size causes large vertical gaps between lines of text during message windows. I also tried pulling the MKXP executable out of LISA to test, which displayed a different size text from the other MKXP build.

I checked the other issues, closed and open, and didn't see any similar problems. Do you think this would be alleviated should I migrate to a more current build? I can provide any of the project files if deemed necessary.

Hi, I've been working on setting up a game of mine with MKXP (The prebuilt version linked in the README, which I understand is dated), which for the most part is going smoothly. The only issue I'm having is that the size of the font appears drastically different depending on whether I launch from MKXP or not. I'm using a font that I put together myself. The font is pixelated so in order for it to look correctly on the screen it needs to be a certain size. When I was just running the game in RPGmaker I had set the font size to 25 and it looked fine. When Launching from MKXP, however, the font appears much smaller. In order for the font to appear correctly in MKXP I had to set the font size to 40. And while I would have been willing to make that compromise, having a font that large causes issues with text placement, namely the large size causes large vertical gaps between lines of text during message windows. I also tried pulling the MKXP executable out of LISA to test, which displayed a different size text from the other MKXP build. I checked the other issues, closed and open, and didn't see any similar problems. Do you think this would be alleviated should I migrate to a more current build? I can provide any of the project files if deemed necessary.
Ancurio commented 2017-03-10 07:17:09 +00:00 (Migrated from github.com)

See #22.

A more current build wouldn't change this, there is no simple solution at the moment for mkxp. If there are large vertical gaps, can't you change your message window code to reduce the space?

How did you create the font? Can you show it to me?

See #22. A more current build wouldn't change this, there is no simple solution at the moment for mkxp. If there are large vertical gaps, can't you change your message window code to reduce the space? How did you create the font? Can you show it to me?
twuky commented 2017-03-10 17:09:05 +00:00 (Migrated from github.com)

Sure. I saw that issue before, but didn't think it was the same issue, but now i see what it means. Would it then be possible to adjust my fonts dpi/ppi so it's congruent among both?
The font was made with a pretty simple online tool. I opened it with fontforge and it doesn't seem to have any issues changing it, I'll have to look more into it to see if that type of adjustment can be made.

Changing the line height also crossed my mind, and is certainly something I can toy with but it seems like a roundabout way of fixing it? I guess by setting the font size to 40 I've already given up hope of being able to launch from either MKXP or the standard executable.

Here's the specific font I made.
TQ font.zip

Sure. I saw that issue before, but didn't think it was the same issue, but now i see what it means. Would it then be possible to adjust my fonts dpi/ppi so it's congruent among both? The font was made with [a pretty simple online tool](http://www.pentacom.jp/pentacom/bitfontmaker2/). I opened it with fontforge and it doesn't seem to have any issues changing it, I'll have to look more into it to see if that type of adjustment can be made. Changing the line height also crossed my mind, and is certainly something I can toy with but it seems like a roundabout way of fixing it? I guess by setting the font size to 40 I've already given up hope of being able to launch from either MKXP or the standard executable. Here's the specific font I made. [TQ font.zip](https://github.com/Ancurio/mkxp/files/834605/TQ.font.zip)
Ancurio commented 2017-03-14 15:50:08 +00:00 (Migrated from github.com)

Unfortunately I don't have enough background knowledge to tell whether there are any dpi settings one could manipulate within the font. I just feed it into SDL_ttf, hoping that it does the right thing, and use its output.

You could adjust the percentage value embedded in mkxp that's quoted in #22 so that the RMXP size almost matches up with mkxp's size for normal text boxes, but then there would be mismatches again at other font sizes (assuming you use the font in multiple sizes within the game).

But you said all you wanted was a font that is literally just built from square pixels, right? Normally one uses fonts for actual scalabe vector data. If it's just colored squares, you could simply use a bitmap atlas and have the game blit / scale characters from that. Of course that would entail rewriting all relevant RGSS parts that deal with text drawing (but it would ensure 100% same results across engines).

mkxp is never going to be able to perfectly replicate RMXP's font drawing, because Enterbrain's code uses native Windows functionality for it (to which I obviously have no access, espeically in a cross-platform context).

Unfortunately I don't have enough background knowledge to tell whether there are any dpi settings one could manipulate within the font. I just feed it into `SDL_ttf`, hoping that it does the right thing, and use its output. You could adjust the percentage value embedded in mkxp that's quoted in #22 so that the RMXP size almost matches up with mkxp's size for normal text boxes, but then there would be mismatches again at other font sizes (assuming you use the font in multiple sizes within the game). But you said all you wanted was a font that is literally just built from square pixels, right? Normally one uses fonts for actual scalabe vector data. If it's just colored squares, you could simply use a bitmap atlas and have the game blit / scale characters from that. Of course that would entail rewriting all relevant RGSS parts that deal with text drawing (but it would ensure 100% same results across engines). mkxp is never going to be able to perfectly replicate RMXP's font drawing, because Enterbrain's code uses native Windows functionality for it (to which I obviously have no access, espeically in a cross-platform context).
twuky commented 2017-03-20 01:23:59 +00:00 (Migrated from github.com)

Hey, sorry about the late response -

Thanks for the info on this, these seem to be some pretty decent routes to look down.
Because it's a pixel font, I (at least at this point) always use it at the same size, and I don't really use any other fonts. If i did need it at other sizes, it probably wouldn't be in places like Game_Message where it pays attention to line height. So modifying font.cpp seems like the least headache-inducing strategy. I'll try to explore that this week.

Hey, sorry about the late response - Thanks for the info on this, these seem to be some pretty decent routes to look down. Because it's a pixel font, I (at least at this point) always use it at the same size, and I don't really use any other fonts. If i did need it at other sizes, it probably wouldn't be in places like Game_Message where it pays attention to line height. So modifying font.cpp seems like the least headache-inducing strategy. I'll try to explore that this week.
hanetzer commented 2017-07-24 15:12:16 +00:00 (Migrated from github.com)

@votetuckie You may want to look into the various SFont scripts which just take a bitmap/png with a key color showing where to break it and does the various blit/scaling @Ancurio mentions. Would require less dealing in the cpp code and should be roughly equivalent for windows/linux/etc.

@votetuckie You may want to look into the various SFont scripts which just take a bitmap/png with a key color showing where to break it and does the various blit/scaling @Ancurio mentions. Would require less dealing in the cpp code and should be roughly equivalent for windows/linux/etc.
pulsejet commented 2018-05-21 11:33:11 +00:00 (Migrated from github.com)

I think this might be something related to the bold attribute. Wherever I am rendering fonts with regular attributes, it looks fine, but as soon as I make it bold, spacing is broken and it is bigger/looks terrible

I think this might be something related to the bold attribute. Wherever I am rendering fonts with regular attributes, it looks fine, but as soon as I make it bold, spacing is broken and it is bigger/looks terrible
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: MapleShrine/mkxp#161
No description provided.