[Development] Why can't QString use UTF-8 internally?

Konstantin Ritt ritt.ks at gmail.com
Thu Feb 12 11:18:18 CET 2015

2015-02-12 13:11 GMT+04:00 Rutledge Shawn <Shawn.Rutledge at theqtcompany.com>:

> Consequently we have to do conversion each time we need the renderable
> text, and/or cache the results to avoid converting repeatedly.  Right?

Pnrftm... what? Cache what? And where? I've missed the point...

>   And we still need to be able to do conversion to renderable glyphs, and
> maybe cache them.

Glyphs? Where glyphs came from?

> So Unicode is a mini-language which has to be interpreted at some point on
> the way to rendering; there’s no pre-interpreted form we could store it
> in.  TrueType is also a mini-language.  Maybe it would be possible to write
> a compiler which reads UTF-8 and TrueType and writes (nearly) branch-free
> code to render a whole line or block of text, so we could cache code
> instead of data.  It could be more compact and CPU cache-friendly.  I
> imagine nobody has done that yet.  But then if you think about all the
> fancy stuff TeX can do, it could get even more complex than what Qt
> currently does.  And I don’t understand much about what Harfbuzz does yet,
> either.

TrueType doesn't define a codepoint to glyph mapping. In fact, glyph
indices for the same codepoints would be different for two arbitrary TT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150212/d51813d8/attachment.html>

More information about the Development mailing list