The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL Digest, Vol 95, Issue 30
Jared Maddox
Guest

Quote:
Date: Thu, 20 Nov 2014 08:13:52 +0400
From: Alexander Sabourenkov
To: SDL Development List
Subject: [SDL] TTF text shaping
Message-ID:
<CABZtw9OTxA=
Content-Type: text/plain; charset="utf-8"

Hello.

https://github.com/lxnt/zhban

A library for rendering lots of pretty text fast.

Aimed more at OpenGL than pure SDL, though can be used with pure SDL - see
test.py.

Pure C. Does not reinvent text shaping. Caches as much as makes sense. Will
support vertical and RTL scripts if there would be a test case.

I think there's a few Japanese users of SDL, maybe one will provide
some test text and a "correct" image.


Quote:
Correctly
renders most sorts of obscure scripts including Tengwar
(freemono/telcontar). Supports per-cluster fg/bg coloring.


Does it properly support all four "cases" of Arabic? There was someone
wanting to display that a few months ago.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL Digest, Vol 95, Issue 30
Alexander Sabourenkov
Guest

On Fri, Nov 21, 2014 at 3:05 AM, Jared Maddox wrote:
Quote:

Quote:
Correctly
renders most sorts of obscure scripts including Tengwar
(freemono/telcontar). Supports per-cluster fg/bg coloring.


Does it properly support all four "cases" of Arabic? There was someone
wanting to display that a few months ago.


Same thing as with vertical scripts, only it does render something instead of failing miserably, like this: http://img.ie/9t5t0.png


I haven't got a slightest idea how the correct Arabic looks like, someone with domain knowledge will have to step up and help.

 
The code behind the renderer, though, is also behind most if not all text shaping on Linux, so at most there are minor bugs in glyph/line positioning, not a question of supporting this or that feature.
SDL Digest, Vol 95, Issue 30
Jared Maddox
Guest

Really wish I hadn't used the wrong reply title last post...

Quote:
Date: Fri, 21 Nov 2014 04:21:09 +0400
From: Alexander Sabourenkov
To: SDL Development List
Subject: Re: [SDL] SDL Digest, Vol 95, Issue 30
Message-ID:

Content-Type: text/plain; charset="utf-8"

On Fri, Nov 21, 2014 at 3:05 AM, Jared Maddox
wrote:

Quote:

Quote:
Correctly
renders most sorts of obscure scripts including Tengwar
(freemono/telcontar). Supports per-cluster fg/bg coloring.


Does it properly support all four "cases" of Arabic? There was someone
wanting to display that a few months ago.


Same thing as with vertical scripts, only it does render something instead
of failing miserably, like this: http://img.ie/9t5t0.png

I haven't got a slightest idea how the correct Arabic looks like, someone
with domain knowledge will have to step up and help.


I don't actually know Arabic so I have no idea if that displayed
correctly, but I doubt it. Properly formatted Arabic apparently has
"isolated", "first letter of word", "last letter of word", and
"interior of word" cases, and multi-letter words flow like cursive
(maybe Arabic inspired cursive? I don't know.). Given that it looks
(at least to my untrained eye) like that's a bunch of individual
letters, I think the rendering is off.

On the upside, Hindu probably displays fine, since I understand that
to look like Morse code.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL Digest, Vol 95, Issue 30
slvn


Joined: 06 Oct 2012
Posts: 88
Hi, I would say the say the same. Though I don't know Arabic, it does
not look well displayed : it should be written from Righ To Left
(RTL).
Look at the "." that should end a paragraph : it's positioned at the
lower right, whereas it should be at the lower left.

Other language are also RTL like Persian, Hebrew, etc.



On Sat, Nov 22, 2014 at 1:22 PM, Jared Maddox wrote:
Quote:
Really wish I hadn't used the wrong reply title last post...

Quote:
Date: Fri, 21 Nov 2014 04:21:09 +0400
From: Alexander Sabourenkov
To: SDL Development List
Subject: Re: [SDL] SDL Digest, Vol 95, Issue 30
Message-ID:

Content-Type: text/plain; charset="utf-8"

On Fri, Nov 21, 2014 at 3:05 AM, Jared Maddox
wrote:

Quote:

Quote:
Correctly
renders most sorts of obscure scripts including Tengwar
(freemono/telcontar). Supports per-cluster fg/bg coloring.


Does it properly support all four "cases" of Arabic? There was someone
wanting to display that a few months ago.


Same thing as with vertical scripts, only it does render something instead
of failing miserably, like this: http://img.ie/9t5t0.png

I haven't got a slightest idea how the correct Arabic looks like, someone
with domain knowledge will have to step up and help.


I don't actually know Arabic so I have no idea if that displayed
correctly, but I doubt it. Properly formatted Arabic apparently has
"isolated", "first letter of word", "last letter of word", and
"interior of word" cases, and multi-letter words flow like cursive
(maybe Arabic inspired cursive? I don't know.). Given that it looks
(at least to my untrained eye) like that's a bunch of individual
letters, I think the rendering is off.

On the upside, Hindu probably displays fine, since I understand that
to look like Morse code.
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org



--
Sylvain Becker
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL Digest, Vol 95, Issue 30
Rainer Deyke
Guest

On 22.11.2014 13:31, Sylvain Becker wrote:
Quote:
Hi, I would say the say the same. Though I don't know Arabic, it does
not look well displayed : it should be written from Righ To Left
(RTL).
Look at the "." that should end a paragraph : it's positioned at the
lower right, whereas it should be at the lower left.

I do know a bit of Arabic, and I can confirm what everybody else has
been saying: the text is in the wrong direction and using the wrong
letter forms. Fixing this is for the general case is unfortunately
nontrivial: the Unicode rules for bidirectional text are incredibly
complicated, and I don't think Harfbuzz can handle this on its own.


--
Rainer Deyke
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL Digest, Vol 95, Issue 30
Alexander Sabourenkov
Guest

Many thanks for the feedback.


I have now exposed HarfBuzz settings for direction, script and language.


Does this http://img.ie/vetz5.png  look better ?



Spaces and general positioning are obviously off, but that's due to a crude hack on a (generic LTR) line-breaking algorithm, which is not even a part of the library yet.


I wonder if there is somewhere an adequately defined use-case for eastern script rendering with SDL. I'd hate to not fully expose in a convenient way what Harfbuzz can do while I'm at writing a front-end of sorts to it.
SDL Digest, Vol 95, Issue 30
Rainer Deyke
Guest

On 22.11.2014 21:50, Alexander Sabourenkov wrote:
Quote:
Many thanks for the feedback.

I have now exposed HarfBuzz settings for direction, script and language.

Does this http://img.ie/vetz5.png look better ?

Yes, much better.


--
Rainer Deyke
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org