Today I would like to describe the current state of my Summer of Code project:
In the last post I mentioned that I am looking for a library to do the text shaping.
Initially I would have selected Pango for this task because it does much more
than just shaping. It basically does everything one needs to take care of when
rendering text. However it depends on glib and some other libraries.
So it was decided to use HarfBuzz (the shaping engine also used by Pango) directly
and use ICU as the library to do other Unicode related things.
So the following libraries are used:
Mapnik contains the itemizer (more on this below), supporting code for line
breaking and code to render the glyphs arranged by the other libraries in a
straight line along a curved path (e.g. a street).
Shaping is the process of selecting the right glyph for a character (or
sometimes even multiple characters). The glyph might depend on the position
in the text. This seems to work now using HarfBuzz.
HarfBuzz only takes parts of the text which are one-font, one-script,
one-language and one-direction. So the text has to be split into parts which
satisfy this requirement.
This is not as trivial as it sounds, because the API of ICU only takes the text
and you have to remember the other attributes on your own. Also you usually can
only process the whole text at once and can’t split it into smaller pieces because
that might cause trouble for some of the algorithms.
This is the part I am currently working on. I will update this post when I
have new information.