]> granicus.if.org Git - libass/commitdiff
shaper: fix control character filtering
authorGrigori Goronzy <greg@hein>
Fri, 18 May 2012 23:01:30 +0000 (01:01 +0200)
committerGrigori Goronzy <greg@hein>
Sat, 19 May 2012 11:11:49 +0000 (13:11 +0200)
Correct off-by-one error and add 0x200c-0x200f range. This range
is compromised of explicit direction and join marks.

Fixes issue 54
Fixes issue 55

libass/ass_shaper.c

index cf563ada72ba2c88e100cc7b9703cdfb78500133..27c1dadcffb727a030f76d27105fd23383e71ea7 100644 (file)
@@ -640,7 +640,8 @@ void ass_shaper_shape(ASS_Shaper *shaper, TextInfo *text_info)
         // Skip direction override control characters
         // NOTE: Behdad said HarfBuzz is supposed to remove these, but this hasn't
         // been implemented yet
-        if (glyphs[i].symbol <= 0x202F && glyphs[i].symbol >= 0x202a) {
+        if ((glyphs[i].symbol <= 0x202e && glyphs[i].symbol >= 0x202a)
+                || (glyphs[i].symbol <= 0x200f && glyphs[i].symbol >= 0x200c)) {
             glyphs[i].symbol = 0;
             glyphs[i].skip++;
         }