Closed eglaysher closed 8 years ago
OK, so here's my current theory on what's going on:
If you look in s/s/b/text_window.cc, you'll see that line breaking is all pixel based. However, in the Gameexe.ini files, text windows are sized in full-width characters.
The current font advancement code in text_window.cc actually is putting the exact same number of Roman characters on the same line as the official RealLive.exe. However, the problem comes from all the Japanese fonts I've tested on Linux not having monospace Roman character information. (!)
Possible work around I'll have to think about for a bit: change the line breaking algorithm from being pixel based to character based. Right now, we ignore the width of the non-evenly monospaced Roman characters and lay them out so that they fit 2 * [number of full-width characters] in a line. Instead break by character count; the line can be laid out however the characters fall, but when dealing with Roman characters, we only allow 2n characters on a line. Possible downsides: this could theoretically break Japanese editions of these games, since the whole line breaking thing is very subtle.
So coming back to this, here's the status:
msgothic.ttc
as the font, which Linux users won't have, the text in Planetarian matches the grid layout of the official RealLive.exe perfectly. msgothic.ttc
has monospaced Roman characters.msgothic.ttc
doesn't have font overwrite, but does show off line-breaking problems.So there are really two bugs here:
The kerning here is so bad that we draw the next letter over the last letter.