[osg-users] Trouble Drawing Text in Arabic

Jan Ciger jan.ciger at gmail.com
Wed Nov 2 02:36:40 PDT 2016

On Tue, Nov 1, 2016 at 9:35 PM, Erik Hensens <ehensens at hunter.com> wrote:

> Hello!
> I am having some trouble drawing text correctly in Arabic. I can get the
> Arabic letters themselves to show up correctly, but the letters do not
> connect together as they should.
> I am not an Arabic speaker, but my understanding is that when letters in
> Arabic are adjacent to each other within a word, the letters take different
> shapes and connect to each other, similar to cursive English.
> As a sanity check, I used the exact same TTF font and showed the same
> Arabic string on a 2D drawing area using Gtk. This 2D drawing area window
> shows the text correctly rendered with the letters connected properly.

Uff, I think you are pushing the poor old osgText far beyond its design
limits. This sort of thing requires some special treatment in the code,
which GTK does but osgText doesn't. osgText only takes the glyphs rendered
by FreeType, one by one. So if there are alternative glyphs to use in
certain situations (like ligatures) or something else, FreeType needs to
handle it and I believe it doesn't currently (or at least not
automatically). GTK uses Pango/Cairo combination, not raw FreeType for font
rendering, I believe.

So you could be out of luck here and may have to write your own text
rendering module - e..g use Pango/Cairo to render into a texture and
display it on a quad.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161102/517407ff/attachment-0003.htm>

More information about the osg-users mailing list