Closed RottenBlock closed 6 months ago
I believe the argument of ZB
command is multiplied by 100 and used as the value of lfWeight
of Windows LOGFONT
struct.
System3.9 with MS Gothic font behave as follows:
MS Gothic has only two weights[^1], so it is rendered in bold with ZB 6
or higher. Note that the default value of ZB
is 7, which is bold.
If we implement this faithfully in xsystem35, we would use TTF_SetFontStyle
with TTF_STYLE_BOLD
when ZB
is 6 or more. Trying it with MTLc3m.ttf
(our default font) gives the following result:
The default ZB 7
looks too heavy, especially at larger sizes. This is more obvious when you see it in the actual game screen:
Another problem is that TTF_SetFontStyle
affects text width, while System3.9 does not. This may break the layout.
[^1]: Actually, MS Gothic has only one weight, and the bold version is synthesized by the font rendering engine.
For small sizes, MS Gothic uses bitmap glyphs with 1-pixel thick. This is too thin, so they may have made ZB 7
the default.
Modern vector fonts (including MTLc3m.ttf
) have a slightly thicker regular weight, so it probably makes more sense not to default to bold.
The following is just a list of potential solutions; the order is not meaningful.
Enable embolding with ZB 6
or higher, and change the default font to a lighter one.
For copyright reasons, we cannot bundle MS Gothic. MTLc3m.ttf
has some nice properties (small file size, monospaced, ASCII characters are exactly half the width of full-width characters, etc.), and there are not many fonts that can be an alternative.
Enable embolding with ZB 6
or higher, but only when enabled by a flag in .xsys35rc
.
Game/mod authors who want to take advantage of the ZB
command can enable it explicitly. They may also want to bundle font files with their distributions. In a sense, this is similar to the above, but puts the burden of font selection on the game/mod author.
Improve the font emboldening algorithm.
More modest emboldening might be possible by using the Freetype library directly instead of via SDL_ttf. This would be a somewhat large change.
Do nothing.
Any of the above implies using bold text by default (ZB 7
). Generally, the quality of synthesized bold is not great.
Comments and suggestions are welcome!
I'm personally inclined towards the .xsys35 option, so long as we aren't worried about the look of official Alicesoft games. I've sent a link to SupremeJUMBO to get their opinion.
For the record, the ZB command is fairly rare. These are the only English games that use the ZB command. I did check several Japanese games that I have on hand, none of which used ZB at all, but I don't have all of them. One of these days I need to make a searchable directory.
I do have a collection of ADV files from almost all AliceSoft System 3.x games and some indie games, for regression testing of xsys35c.
Below is a list of games that use the ZB command. (I often do this kind of query to find out the impact of code changes.)
I don't know if in any of these cases the ZB command is used to convey some information rather than just to improve the appearance.
Hello, I'm a big fan of your work! I agree that the simplest solution is to just have a flag in .xsys35rc. I'm not even sure if I'll end up needing the wider font, it was just something I noticed since I was originally using ZB to shrink the font width in the system39 version.
Thanks for the comment. I have implemented the .xsys35rc
solution.
In the game directory put .xsys35rc
file with
enable_zb: Yes
then xsystem35 will respect the ZB
command.
This will be included in the next release, but if you want to try it out right away you can download a Windows binary here. (Note: The debugger is now supported only on 64-bit build.)
If you decide to actually use this feature, please let me know. I will stabilize this feature and make sure that its behavior does not change. In the meantime, consider this an experimental feature and the behavior may be changed if a better solution is found.
Thanks, I appreciate it! Never hurts to have more modding tools available in case I need them. The game runs so much faster and smoother on xsystem35, you did a phenomenal job.
Environment
SupremeJUMBO at the wiki noticed that the ZB command doesn't seem to be working right now. Looking into it, it sets the variable MsgFontBoldSize, but unfortunately, the variable is never actually used when rendering text - just by the ZB command itself. The command apparently does work in System 3.9.