Ruby text overlaps normal text (Korean)

Create issue
Issue #47 resolved
VBChunguk created an issue

Sample image

{{ruby|너희들|오니들}}이 약속을 어기진 않았을 거야.

Ruby text overlaps normal text, and is hard to read.

Comments (2)

  1. nmlgc repo owner

    This is, unfortunately, a systemic flaw in our custom ruby system.

    We can't use the original one at all: Firstly, it requires absolute pixel coordinates for both the position of the text and the character spacing. Since we don't know about the font widths on the server side (which is also why we can't do automatic line breaks), we would have to guess these, which practically never worked. Secondly, it is hardcoded to parse two-byte characters only, which of course would break UTF-8.

    As far as I can tell, this is the best Ruby support we can offer without having to write rather extensive hacks for every single game. Since we don't have the text sprite the game originally renders ruby text to, we have to shift down the normal text by a few pixels and then render correctly aligned ruby text in a smaller front above that. This shows acceptable results for th14 (thanks to the higher resolution) and languages using Latin script, but apparently fails with anything else.

    After I thought about that for a while, I realized that there might actually be a way to tell our layout engine about the ruby text sprite and render the text there. This would keep the game-specific hacks at a minimum while still looking exactly like what the game does by itself. However, I'm not really sure about any of this. I'll give it a try later this week.

  2. nmlgc repo owner

    Turns out that the idea worked out just fine, and the result is included in the 2014-01-27 build:

    The same text in 2014-01-27

    ... and that's probably the best we will get in terms of legibility, since we only have these 6 pixels of height. For languages using Latin script, increasing the size of the ruby font helps a lot:

    ... as in this example from the Italian translation

    I can't really see this working for Korean with its monospaced, square characters, though.

    If the screenshot above is not enough, I can take a further look at what can be done to improve legibility for Korean, but the basic issue (overlapping ruby text) would be resolved now.

  3. Log in to comment