Dear Experts,
Thanks a lot for your comments about Persian font discussion.
but some points about Persian language:
*. It consists of 32 letters.
*. Most of the letters have 2 forms of small and large shape.
*. Large letters are put at the beginning and end letter of words.
*. Small letters are only used in middle part of words.
By knowing above facts l would like to add Persian font support to SDL_ttf library.
But I have no idea where to start.
?
Thus I start with the links that John shared.
Regards
Mahdi,________________________________
From: John Bartholomew <jpa.bartholomew at gmail.com>
To: SDL Development List
Sent: Thursday, December 12, 2013 3:21 PM
Subject: Re: [SDL] persian font support
Rendering complex scripts correctly is a very difficult thing to do: the conventions of orthography have evolved over thousands of years and for the vast majority of that time there has been no pressure for those conventions to follow strict or easily programmed rules. It is possible to do it well, but it is not a task that should be undertaken lightly.
Luckily, this is a problem that is faced by a very large amount of software, and so there are good existing solutions. One good option is to use the HarfBuzz library [1], which implements glyph shaping rules (‘shaping’ is the process of selecting appropriate glyphs and positioning them). On Windows, there are also APIs provided by Microsoft to do this: Uniscribe does it, and on recent versions of Windows I believe DirectWrite includes this functionality (though I’ve never used it myself). I imagine OS X provides similar functionality, probably through CoreText, but I’ve never had reason to investigate.
Glyph shaping is not the only part of the layout problem – as Jared Maddox notes, you also have to find word boundaries, and you’ll probably have to cope with bi-directional text. You could look into using ICU [2] to do these things (or FriBiDi [3] to help handle bi-directional text). I think ICU also includes its own glyph shaping engine, but I haven’t used it and I don’t know how it compares to harfbuzz in quality or ease of use.
I currently use harfbuzz myself, but only for very simple text; basically English and other latin script languages; all left-to-right and easy to deal with.
John B
[1] http://freedesktop.org/wiki/Software/HarfBuzz/
[2] http://site.icu-project.org/
[3] http://fribidi.org/
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org