]> granicus.if.org Git - libass/commitdiff
Render NBSP (\h) as normal space
authorGrigori Goronzy <greg@blackbox>
Thu, 10 Sep 2009 02:47:21 +0000 (04:47 +0200)
committerGrigori Goronzy <greg@blackbox>
Wed, 16 Sep 2009 00:36:03 +0000 (02:36 +0200)
Many fonts don't have a non-breaking space (NBSP) character and this
can cause problems when these glyphs are substituted.  Render them
like a regular space.

libass/ass_font.c

index 2e8548c5b8fe704b0c6ebb098678df78e47f03eb..7d848a28073f637880f12c47e5c2572c467454c6 100644 (file)
@@ -421,6 +421,9 @@ FT_Glyph ass_font_get_glyph(void *fontconfig_priv, ASS_Font *font,
 
     if (ch < 0x20)
         return 0;
+    // Handle NBSP like a regular space when rendering the glyph
+    if (ch == 0xa0)
+        ch = ' ';
     if (font->n_faces == 0)
         return 0;