Skip to content

Question: UTF-8 characters handling #11

@rodizio1

Description

@rodizio1

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions