kichikuou / xsystem35-sdl2

Multi-platform implementation of AliceSoft's System3.x game engine.
https://kichikuou.github.io/web/
GNU General Public License v2.0
57 stars 8 forks source link

Add SDL_ttf font device #13

Closed nunuhara closed 4 years ago

nunuhara commented 4 years ago

Add higher performance SDL_ttf font device, as per #12

I don't know how much you reviewed the implementation from my vita port, but I've made a few changes here. In particular this line:

y = max(0, y - (TTF_FontAscent(fontset->id) - fontset->size * 0.9));

...which fixes a bug I noticed in Daiakuji when using mincho.otf from Source Han Serif (i.e. the font that Kichikuou Web uses). I'm not sure where the 0.9 multiplier comes from (font_freetype2.c uses the same multiplier) but it seems to produce the correct result (at least on Source Han Serif mincho and MS mincho).

nunuhara commented 4 years ago

Fixed. I couldn't see any difference between rounding and shifting the alpha.

kichikuou commented 4 years ago

Thanks!