shaper: proper script/language handling
commitfc3b05f3178a88e5af1e994d91e43fdb0fda1059
authorGrigori Goronzy <greg@blackbox>
Mon, 4 Mar 2013 19:24:35 +0000 (4 20:24 +0100)
committerGrigori Goronzy <greg@blackbox>
Mon, 4 Mar 2013 19:52:21 +0000 (4 20:52 +0100)
treee7a8ac498f28d8645564a09d7c383e3c5d03b204
parent256df617e227af2ed7274f4281756ec38ad30a70
shaper: proper script/language handling

Determine script for each character and use this as an additional
property for splitting up the text into runs. Characters of Common
or Inherited script assume the script of the preceding character. If
that is not possible (First character(s) in a run are Common/Inherited,
for instance), a backwards scan is done so they can assume the script
of the following character.

Additionally, determine default language in case no override is
set. This simply maps a language to a script, if a language exists
that is mostly representative for a given script. Pango's mapping
has been adapted.

This helps with fonts that don't have OpenType features set up
for default script/language pairs. It's also considered to be right
approach by most people, and might help with correct OpenType rendering
in some other cases.

Fixes issue 85.
libass/ass_render.c
libass/ass_render.h
libass/ass_shaper.c