Closed Krakean closed 6 years ago
Hi,
Take a look at this string in the Game1.cs:
StbTrueType.stbtt_BakeFontBitmap(buffer, 0, 48, tempBitmap, FontBitmapWidth, FontBitmapHeight, 32, 96, charData);
It tells StbTrueType to bake a font bitmap with 96 characters starting from index 32(space).
Probably that range doesnt include accented characters.
So if you replace that string with say
StbTrueType.stbtt_BakeFontBitmap(buffer, 0, 48, tempBitmap, FontBitmapWidth, FontBitmapHeight, 32, 224, charData);
Then at least accented characters will show up.
Unsure how to add ranges with cyrillic & chinese characters as I dont know original stb_truetype well.
I've added FontBaker class. It allows to bake glyphs from multiple ttfs with arbitrary character ranges. I've updated the sample we were discussing. Now it bakes font atlas from two different ttf(one regular and one japanese). Now the sample has following look:
I've removed that string: "I: An ḃfuil do ċroí ag bualaḋ ó ḟaitíos" as it uses characters from this range: http://jrgraphix.net/r/Unicode/1E00-1EFF
And I couldn't find ttf containing all characters from that range. Thanks for reporting this issue. I am closing it.
Hello Trying to test stb_truetype for unicode text output:
But see this: https://i.imgur.com/Kc3cmNu.png Tried different fonts, no result. Can you please tell me what I do wrong, or is it a restriction of StbSharp?