From b1f12a86374015305347ce83cad96f2eb35b0212 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Thu, 14 Jul 2011 00:01:11 +0200 Subject: Use the "font encoding" property as a base direction hint ASS specifies a "font encoding", both in the styles as well as with the \fe override tag. This font encoding is very Windows-specific and libass doesn't use it for charmap matching or anything like that. However, it can be useful for hinting the base direction of text. Make Hebrew and Arabic encodings switch to RTL base direction, other languages to LTR and use neutral base direction for the autodetect setting. --- libass/ass_render.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libass/ass_render.c') diff --git a/libass/ass_render.c b/libass/ass_render.c index 68d747d..3d23e29 100644 --- a/libass/ass_render.c +++ b/libass/ass_render.c @@ -898,6 +898,7 @@ void reset_render_context(ASS_Renderer *render_priv) render_priv->state.frz = M_PI * render_priv->state.style->Angle / 180.; render_priv->state.fax = render_priv->state.fay = 0.; render_priv->state.wrap_style = render_priv->track->WrapStyle; + render_priv->state.font_encoding = render_priv->state.style->Encoding; } /** @@ -1835,6 +1836,8 @@ ass_render_event(ASS_Renderer *render_priv, ASS_Event *event, } // Find shape runs and shape text + ass_shaper_set_base_direction(render_priv->shaper, + resolve_base_direction(render_priv->state.font_encoding)); ass_shaper_find_runs(render_priv->shaper, render_priv, glyphs, text_info->length); ass_shaper_shape(render_priv->shaper, text_info); -- cgit v1.2.3