blend2d-apps
blend2d-apps copied to clipboard
Chinese characters are not supported to display garbled
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

I've tested writing Chinese characters and they work with the right font, I used DroidSansFallbackFull.ttf on Linux.
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)