-
Notifications
You must be signed in to change notification settings - Fork 183
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
Different bitmap fonts #1143
Different bitmap fonts #1143
Conversation
Japanese fonts have a few quirks that don’t need to be reproduced in other languages. So, it makes sense to have separate Japanese fonts for official translations, and other fonts for unofficial translations. The major differences of Japanese fonts are: — ` (grave accent) is opening quote, — ' (straight apostrophe) is a closing quote, — " (straight double quote) is a closing double quote, — Cyrillic and Greek characters are double-width, — ellipsis is in the middle of the line (also useful for Chinese and maybe Korean). For RMG2000, a font similar to Shinonome is used (but without the peculiarities described above). For RM2000, a new font is added. Like Don Miguel's RM2000, it has different style for Cyrillic and Latin, Cyrillic is bigger than Latin. For Cyrillic, I've used a 'straight italic' style (so-called Bulgarian cyrillic). Its look-and-feel is similar to Don's RM2000 font.
It's in the bottom of the line, and halfwidth.
I will need to overload them to accept a font argument, effectively doubling the number of functions. So, to get the complexity under control, I’ve removed some overloads that accept x, y, width, height because the functions with rect do the same thing.
I've decided against overloading TextDraw to allow calling it without font because this function is already overloaded too much. Instead, I've made font a required argument, and added calls to Font::Default() in the places where TextDraw is called.
I’ve replaced the RM2000-compatible font with ttyp0, as suggested in chat. The left screenshot now looks like this (the right one hasn’t changed, attaching it for completeness): The best thing about ttyp0 is its wide coverage of scripts. We just got support for Georgian, Armenian and Greek without doing anything. Here’s the first stanza from Sappho’s Hymn to Aphrodite: |
Please check your whitespace, is partly space instead of tab. About TextDraw: Because you pass Font::Default() everywhere anyway how about simply hardcoding the font to Font::Default() in TextDraw instead of adding a FontRef argument? |
The original idea behind using Japanese fonts for the official English release was that it used MS Mincho/MS Gothic. However, upon closer inspection I've noticed that the official releases use EDITED MS Mincho and MS Gothic (in the official RM2kE, they are called RPG2000 and RPG2000G), and those edited fonts use a European … and not Japanese). So, I think it’s safe to lump them alongside with the unofficial translations and use ttyp0 for them.
Sorry! I’ve changed by vim settings so this shouldn’t happen again. The whitespace was in the function for checking if Engine is an official release. I think this function is not needed. I’ve noticed that the official English release doesn’t use the same font as Japanese release (e.g. … is European, not Japanese in RPG2k3E), so I think it makes sense to use ttyp0/RMG2000 for RPG2k3E too, in the same way as for Don’s translation.
Yes, I can do this. I don’t think anyone relies on the ability to change the font. |
Our current naming became confusing when we added other fonts (WenQuanYi, ttyp0). They are not Shinonome, and they are kept as separate entities, but they were still referenced as Shinonome in the code.
resources/wenquanyi/README
Outdated
@@ -20,20 +20,22 @@ from wqy-bitmapsong-bdf-1.0.0-RC1.tar.gz | |||
wenquanyi_cjk_basic_9pt.bdf | |||
GPLv2+FE | |||
|
|||
is generated by the following coommand: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added this change to make the English text correspond to the Chinese text below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typoo
@kakurasan Thank you very much for the testing, I wouldn’t have found this myself!
Look like I’ve swapped Mincho and Gothic by accident! I’ll fix this in less than an hour.
Thanks for noticing! Shinomome Mincho doesn’t contain all the characters and is expected to fallback on Shinonome Gothic, so those messages are not useful. I’ll change the code so that the messages are only shown if a glyph is missing in all the fonts, not just in the first font. I’ll update my pull request in less than an hour. |
If the glyph is not found in just one font, but is found in another (e.g. not found in Mincho, but found in Gothic), this is not something that needs reporting. Also, moving the <?> handling into find_fallback_glyph makes other glyph-finding functions cleaner since they only need to check for NULL.
I’ve swapped Gothic with Mincho for Japanese games, the codes are now like this:
And I’ve changed the error reporting: now the error is only displayed when all the fonts lack a glyph, not when just one font lacks a glyph. Yume Nikki is now displayed in Gothic, again. |
Somehow the font switching doesn't work for me. I always get that new, small font. I assumed that RMG2000 should still give Shinonome? And isn't RMG2000 ID=0? Based on RPG2k:
⋊> ~/Spiel/RPG M/OFF diff RPG_RT_RM2000.xml RPG_RT_RMG2000.xml
133947c133947
< <font_id>1</font_id>
---
> <font_id>0</font_id> About detecting other languages, see Player::IsCP932. The checks for korean would be: "windows-949-2000" (or "949") and for chinese: "windows-936-2000" and "936". For traditional chinese I don't have a game floating around. Simply run it and check what "Detected encoding:" shows. |
I think there is an error in Don’s RM2k translation. The Editor says that RMG2000 is 0, RM2000 is 1. However, the RPG_RT displays RM2000 for 0, RMG2000 for 1. This pull request matches the behaviour of the Player, so it gives ttyp0 as ID 0, RMG2000 (=edited Shinonome) for ID 1. This is also consistent with the official RPG Maker 2000 release, which uses RPG2000 (serif font) for ID 0, RPG2000G (sans-serif font) for ID 1. I can swap them if you want, as there are little consistency between the versions: some RPG_RT translations assign IDs to RM2000 and RMG2000 differently.
Maybe? I’m following Don’s RPG_RT (not editor) and the official English RPG Maker 2000 release. Some other releases seem to assign font IDs differently. It depends on what we should consider a reference.
Indeed, I can confirm this bug. Thanks for noticing! I’ll fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code itself looks fine to me. I just need some extra testing time to find sense in the chaos of RPG Maker.
Just as a showcase of Armenian support in ttyp0, here’s an extract from a poem Like Wild Lilies by Hovhannes Shiraz: I’ve used lcf2xml to add Armenian text because EasyRPG editor is not finished yet, and RPG Maker 2000/2003 doesn’t support Armenian. |
Btw. this increases our executable size by ~100 kb. |
This pull request adds 470 characters in BITMAPFONT_RMG2000 and 3074 characters in BITMAPFONT_TTYP0. If the size is important, we can reduce the size this way:
The following changes could be visible to the user:
I think removing unused characters from WenQuanYi seems the best way to reduce the font size. It could also be nice to merge shinonome/generate_cxx_font.rb and wenquanyi/gen_wqy_font_cpp.py into one script, since they basically do the same thing. |
Finally found some time to test games under Windows for visual comparison. That ttyp0 font matches quite closely to the RPG_RT font but the RPG_RT font is waaaay uglier (completely forgot about this, too much used to EasyRPG fonts) :D |
Yeah, same here. I do not really like the |
Different bitmap fonts
This pull request:
Here is a comparison of how this looks like:
I’ve removed the
font
field from theBitmap
, and now pass font to text-drawing routines. This is neccessary because otherwise, theFont::Default()
is only called once for every bitmap, when the bitmap is instantiated, and then it’s difficult to switch from Mincho to Gothic (from RMG2000 to RM2000).