blend2d-apps icon indicating copy to clipboard operation
blend2d-apps copied to clipboard

Chinese characters are not supported to display garbled

Open HerryJessica opened this issue 3 years ago • 1 comments

Chinese characters are not supported when i tried run samples bl_qt_text ;

BLFont font;
font.createFromFace(_face, _slider->value());
ctx.setFillStyle(BLRgba32(0xFF000000));
ctx.fillAll();
QString text = _text->text();
ctx.setFillStyle(BLRgba32(0xFFFFFFFF));
ctx.fillUtf16Text(BLPoint(10, 10 + font.size()), font, reinterpret_cast<const uint16_t*>(text.constData()), text.length());

The result is like this image

HerryJessica avatar Oct 31 '22 02:10 HerryJessica

I've tested writing Chinese characters and they work with the right font, I used DroidSansFallbackFull.ttf on Linux.

Image

As for the Arabic language, by using harfbuzz, render time went from around 0.002ms into ~0.200 ms (and styles are still broken in my dev, but still faster than Qt which have values from 0.8ms to 18. ms)

Image

boulabiar avatar Feb 24 '25 17:02 boulabiar