sftdlib icon indicating copy to clipboard operation
sftdlib copied to clipboard

Drawing the same font multiple times with different sizes causes issues

Open videah opened this issue 10 years ago • 2 comments

As you can see from the sample, any letter that has been drawn before at a different size appears blurry in Citra, but on hardware the sample wont even load and just simply hangs.

videah avatar Dec 30 '15 05:12 videah

Yeah I know about the blurry thing. And for me it works on the 3DS.

xerpi avatar Dec 30 '15 10:12 xerpi

OK sooo! If you wanna use this, draw a string with your BIGGEST font size right after init but before any code, the end-user will never see it and it will cache all the font glyphs in the max font size then scale DOWN instead of trying to scale UP and artifacting. I did it like this: sftd_draw_textf(font, 0, 0, RGBA8(255, 0, 0, 255), 15, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890:-.'!?()\"end");

with 15 being my biggest font size. You need to pre-cache every character you are going to use, the code I posted should be everything you need... probably :P

SonyUSA avatar Apr 29 '16 21:04 SonyUSA