[PATCH libXfont] Use default glyphs when getting 16-bit font with 8-bit text

Keith Packard keithp at keithp.com
Mon Apr 21 13:37:00 PDT 2014


When accessing a 16-bit font with firstRow > 0 with 8-bit text, check
to see if the font has a default character and return that for every
incoming character.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 src/bitmap/bitmap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/bitmap/bitmap.c b/src/bitmap/bitmap.c
index 9b20faf..0a379eb 100644
--- a/src/bitmap/bitmap.c
+++ b/src/bitmap/bitmap.c
@@ -63,8 +63,12 @@ bitmapGetGlyphs(FontPtr pFont, unsigned long count, unsigned char *chars,
 
     case Linear8Bit:
     case TwoD8Bit:
-	if (pFont->info.firstRow > 0)
+	if (pFont->info.firstRow > 0) {
+            if (pDefault)
+                while (count--)
+                    *glyphs++ = pDefault;
 	    break;
+        }
 	if (pFont->info.allExist && pDefault) {
 	    while (count--) {
 		c = (*chars++) - firstCol;
-- 
1.9.2



More information about the xorg-devel mailing list