You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks a lot for your work on this library. The dynamic font loading feature is really great.
I have a question about "special" UTF-8 characters. I would like to implement different graphical elements like a signal strength bar by using font icons. What I've tried and what works is simply putting the special characters into a buffer and then drawing it with the Text function like this:
sprintf(buffer, "▁▂▃▄▅▆▇");
Text(x, y, buffer, myfont, text_scale);
I guess this works because the above characters are from the dejavu font which is a system font on Raspbian and the editor and everything supports utf-8.
Now I have made another TTF font from a bunch of SVGs and the above doesn't work anymore,
is there a way to print these characters by their numbers? The usual \x0A C-like escaping doesn't seem to work with multibyte characters.
The text was updated successfully, but these errors were encountered:
If your font has correct cmap tables for mapping the character codes used in the string to the correct glyphs then it should work (though there isn't any way to choose which cmap table if multiple ones exist. The Text() function converts the string from multibyte to wide_char depending on the C locale setting, Each wide_char is then looked up in the font's mapping table to select the correct glyph to draw. The way it is set up is that the FreeType library will pick a unicode cmap as being the active cmap with no way to select anything else,
First of all, thanks a lot for your work on this library. The dynamic font loading feature is really great.
I have a question about "special" UTF-8 characters. I would like to implement different graphical elements like a signal strength bar by using font icons. What I've tried and what works is simply putting the special characters into a buffer and then drawing it with the Text function like this:
I guess this works because the above characters are from the dejavu font which is a system font on Raspbian and the editor and everything supports utf-8.
Now I have made another TTF font from a bunch of SVGs and the above doesn't work anymore,
is there a way to print these characters by their numbers? The usual
\x0A
C-like escaping doesn't seem to work with multibyte characters.The text was updated successfully, but these errors were encountered: