[cairo-commit] src/cairo-scaled-font-subsets.c

Adrian Johnson ajohnson at kemper.freedesktop.org
Thu Oct 7 05:40:53 PDT 2010


 src/cairo-scaled-font-subsets.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit ef60650bd6e0b3a354c85dc2e1be8550be6f7c91
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Thu Oct 7 23:09:52 2010 +1030

    Fix bug in subsetting check for winansi characters

diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c
index 5987a99..7bc42f8 100644
--- a/src/cairo-scaled-font-subsets.c
+++ b/src/cairo-scaled-font-subsets.c
@@ -357,15 +357,13 @@ _cairo_unicode_to_winansi (unsigned long uni)
 
     /* exclude the extra "hyphen" at 0xad to avoid duplicate glyphnames */
     if ((uni >= 0x20 && uni <= 0x7e) ||
-	(uni >= 0xa1 && uni <= 0xff && uni != 0xad))
+	(uni >= 0xa1 && uni <= 0xff && uni != 0xad) ||
+	uni == 0)
         return uni;
 
-    if (uni >= 0x80 && uni <= 0x9f) {
-	for (i = 0; i < 32; i++) {
-	    if (_winansi_0x80_to_0x9f[i] == uni)
-		return i + 0x80;
-	}
-    }
+    for (i = 0; i < 32; i++)
+	if (_winansi_0x80_to_0x9f[i] == uni)
+	    return i + 0x80;
 
     return -1;
 }


More information about the cairo-commit mailing list