Unicode characters appear as boxes on Android

356 views
Skip to first unread message

Vivek Kumar

unread,
Mar 4, 2015, 4:27:54 AM3/4/15
to skia-d...@googlegroups.com
Hi everyone,

I downloaded the latest source code of skia and built it as a static library to link against my android code.

I am using SkCanvas -> drawText(text /* unicode char */, length /* 2 */, SkFloatToScalar(x), SkFloatToScalar(y), paint) function to render text.

ASCII characters are rendered fine, but unicode characters appear as blank boxes.

Is this supported on skia for android?

PS : This used to work when I was using skia from Android 4.0.1 sources.

Thanks
Vivek

Menci

unread,
Mar 4, 2015, 7:32:27 PM3/4/15
to skia-d...@googlegroups.com
Are you using UTF-16?If so, try it:
paint.setTextEncoding(SkPaint::kUTF16_TextEncoding);
I haven't used Skia on Android yet, but on Windows and Fedora it runs fine.
By default, Skia will render UTF8 text.

If the problem is not about text encoding, try changing another font.

And what unicode chars are you rendering?Skia renders UTF-8 Chinese fine on my Wndows and Fedora.

在 2015年3月4日星期三 UTC+8下午5:27:54,Vivek Kumar写道:
Reply all
Reply to author
Forward
0 new messages