Marmalade. Read string from UTF-8 encoded text file and draw it with IwGxFont

131 Views Asked by At

Now I use only drawing like this

    char str[10];
    strcpy(str, "str");
    CIwGxFontPreparedData data;

    data.Clear();
    IwGxFontPrepareText(data, str);
    IwGxFontSetRect(CIwRect(10, 10, Iw2DGetSurfaceWidth(), Iw2DGetSurfaceWidth()));
    IwGxFontDrawText(data);     

    data.Clear();
    IwGxFontPrepareText(data, "Const Literal");
    IwGxFontSetRect(CIwRect(10, 200, Iw2DGetSurfaceWidth(), Iw2DGetSurfaceWidth()));
    IwGxFontDrawText(data);

    data.Clear();

But I want render strings loaded from UTF-8 file. Does marmalade have possibility to read string from UTF-8 encoded text file and draw it with IwGxFont?

As far as I see in documentation s3eFile Api doesn't containt functionality for reading utf8 strings from file.

Can anybody show me a small example or give me a right direction?

Thanks.

1

There are 1 best solutions below

0
On

I have used utf8 strings and there was nothing to it. UTF8 is what IwGxFontPrepareText expects. Just read your utf8 string into the char buffer and it should all work fine.