summaryrefslogtreecommitdiffstats
path: root/libass/ass_render.c
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2013-03-04 20:24:35 +0100
committerGrigori Goronzy <greg@blackbox>2013-03-04 20:52:21 +0100
commitfc3b05f3178a88e5af1e994d91e43fdb0fda1059 (patch)
treee7a8ac498f28d8645564a09d7c383e3c5d03b204 /libass/ass_render.c
parent256df617e227af2ed7274f4281756ec38ad30a70 (diff)
downloadlibass-fc3b05f3178a88e5af1e994d91e43fdb0fda1059.tar.bz2
libass-fc3b05f3178a88e5af1e994d91e43fdb0fda1059.tar.xz
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.
Diffstat (limited to 'libass/ass_render.c')
-rw-r--r--libass/ass_render.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libass/ass_render.c b/libass/ass_render.c
index 6681612..a580b29 100644
--- a/libass/ass_render.c
+++ b/libass/ass_render.c
@@ -2256,8 +2256,7 @@ ass_start_frame(ASS_Renderer *render_priv, ASS_Track *track,
render_priv->border_scale *= settings_priv->font_size_coeff;
ass_shaper_set_kerning(render_priv->shaper, track->Kerning);
- if (track->Language)
- ass_shaper_set_language(render_priv->shaper, track->Language);
+ ass_shaper_set_language(render_priv->shaper, track->Language);
ass_shaper_set_level(render_priv->shaper, render_priv->settings.shaper);
// PAR correction