[gs-cvs] gs/src

Igor Melichev igor at casper.ghostscript.com
Wed Jul 24 11:58:30 PDT 2002


Update of /cvs/ghostscript/gs/src
In directory casper:/tmp/cvs-serv28819/gs/src

Modified Files:
	gdevpdte.c 
Log Message:
pdfwrite/pdxtext: Fixing WMode 1 for simple fonts that have no Metrics2.


Index: gdevpdte.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpdte.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- gdevpdte.c	24 Jul 2002 07:45:28 -0000	1.8
+++ gdevpdte.c	24 Jul 2002 18:58:28 -0000	1.9
@@ -310,12 +310,27 @@
 	code = pdf_glyph_widths(pdfont, glyph, font, pwidths);
 	if (code < 0)
 	    return code;
+	if (pdfont->u.simple.v != 0)
+	    pdfont->u.simple.v[ch] = pwidths->v;
+	if (font->WMode != 0 && code > 0 &&
+	    pwidths->v.x == 0 && pwidths->v.y == 0) {
+	    /*
+	     * The font has no Metrics2, so it must be written
+	     * horizontally due to PS spec.
+	     * Therefore we need to fill Width array,
+	     * which is required by PDF spec.
+	     * Take it from WMode=0.
+	     */
+	    int save_WMode = font->WMode;
+	    font->WMode = 0; /* Temporary patch font because font->procs.glyph_info
+	                        has no WMode argument. */
+	    code = pdf_glyph_widths(pdfont, glyph, font, pwidths);
+	    font->WMode = save_WMode;
+	}
 	if (code == 0) {
 	    pdfont->Widths[ch] = pwidths->Width.w;
 	    pdfont->real_widths[ch] = pwidths->real_width.w;
 	}
-	if (pdfont->u.simple.v != 0)
-	    pdfont->u.simple.v[ch] = pwidths->v;
     } else {
 	pwidths->Width.w = pdfont->Widths[ch];
 	pwidths->real_width.w = pdfont->real_widths[ch];




More information about the gs-cvs mailing list