[1/2] wineps.drv: Fixes caching bug in unicode composite glyphs by tracking if the component being downloaded is the toplevel component (resend)

Daniel Horn danielrh at dropbox.com
Thu Sep 4 13:57:07 CDT 2014


-------------- next part --------------
From c57a677438e68362a5cbe7bbfba333528e91fab3 Mon Sep 17 00:00:00 2001
From: Daniel Reiter Horn <danielrh at dropbox.com>
Date: Tue, 22 Apr 2014 20:14:10 +0000
Subject: [PATCH 1/2] Fixes caching bug in unicode composite glyphs by tracking
 if the component being downloaded is the toplevel component or not so as not
 to claim to have cached lower level glyphs when the only item being
 downloaded was the top level glyph

Fixes a bug with caching composite unicode glyphs (if a ñ came before any n in the document,
then all subsequent n's would appear as a box)
This was because the glyph was marked as having been sent down when it was only a component
of a more complex glyph

The patch has been tested on hundreds of print jober under linux ubuntu 12.04 with a wide array
of applications

---
 dlls/wineps.drv/type42.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/dlls/wineps.drv/type42.c b/dlls/wineps.drv/type42.c
index c0cda50..6bbb19e 100644
--- a/dlls/wineps.drv/type42.c
+++ b/dlls/wineps.drv/type42.c
@@ -279,8 +279,8 @@ TYPE42 *T42_download_header(PHYSDEV dev, char *ps_name,
 
 
 
-BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
-			char *glyph_name)
+BOOL T42_download_glyph_helper(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
+                               char *glyph_name, BOOL cache_font_as_downloaded)
 {
     DWORD start, end, i;
     char *buf;
@@ -326,8 +326,8 @@ BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
 	    sg_index = GET_BE_WORD(sg_start + 2);
 
 	    TRACE("Sending subglyph %04x for glyph %04x\n", sg_index, index);
-	    get_glyph_name(dev->hdc, sg_index, sg_name);
-	    T42_download_glyph(dev, pdl, sg_index, sg_name);
+	    get_glyph_name(dev->hdc, FALSE, sg_index, sg_name);
+	    T42_download_glyph_helper(dev, pdl, sg_index, sg_name, FALSE);
 	    sg_start += 4;
 	    if(sg_flags & ARG_1_AND_2_ARE_WORDS)
 	        sg_start += 4;
@@ -363,12 +363,20 @@ BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
     PSDRV_WriteSpool(dev, ">\n", 2);
     sprintf(buf, glyph_def, pdl->ps_name, index, glyph_name, index);
     PSDRV_WriteSpool(dev, buf, strlen(buf));
-
-    t42->glyph_sent[index] = TRUE;
+    if (cache_font_as_downloaded) { /* while making composite glyphs don't
+                                       record as having sent each subglyph */
+        t42->glyph_sent[index] = TRUE;
+    }
     HeapFree(GetProcessHeap(), 0, buf);
     return TRUE;
 }
 
+BOOL T42_download_glyph(PHYSDEV dev, DOWNLOAD *pdl, DWORD index,
+			char *glyph_name)
+{
+    return T42_download_glyph_helper(dev, pdl, index, glyph_name, TRUE);
+}
+
 void T42_free(TYPE42 *t42)
 {
     OTTable *table;
-- 
1.8.4.2



More information about the wine-patches mailing list