[gs-cvs] gs/src

L. Peter Deutsch lpd at casper.ghostscript.com
Fri Jul 5 19:54:35 PDT 2002


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

Modified Files:
	gdevpsft.c 
Log Message:

Fix: The hmtx/vmtx tables generated from the glyph metric data for embedded
TrueType fonts in PDF output were incorrect, due to a misreading of the
TrueType spec.  (This only affects the new pdfwrite text code: the old code
does not generate the tables this way.)


Index: gdevpsft.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gdevpsft.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- gdevpsft.c	18 Jun 2002 22:50:51 -0000	1.19
+++ gdevpsft.c	6 Jul 2002 02:54:32 -0000	1.20
@@ -417,27 +417,24 @@
 size_mtx(gs_font_type42 *pfont, gs_type42_mtx_t *pmtx, uint max_glyph,
 	 int wmode)
 {
-    int prev_lsb = min_int, prev_width = min_int;
-    uint last_lsb = 0, last_width = 0; /* pacify compilers */
+    int prev_width = min_int;
+    uint last_width = 0; /* pacify compilers */
     double factor = pfont->data.unitsPerEm * (wmode ? -1 : 1);
     uint i;
 
     for (i = 0; i <= max_glyph; ++i) {
 	float sbw[4];
 	int code = pfont->data.get_metrics(pfont, i, wmode, sbw);
-	int lsb, width;
+	int width;
 
 	if (code < 0)
 	    continue;
-	lsb = (int)(sbw[wmode] * factor);
 	width = (int)(sbw[wmode + 2] * factor);
-	if (lsb != prev_lsb)
-	    prev_lsb = lsb, last_lsb = i;
 	if (width != prev_width)
-	    prev_width = width, last_width = last_lsb = i;
+	    prev_width = width, last_width = i;
     }
     pmtx->numMetrics = last_width + 1;
-    pmtx->length = pmtx->numMetrics * 4 + (last_lsb - last_width) * 2;
+    pmtx->length = pmtx->numMetrics * 4 + (max_glyph - last_width) * 2;
     return pmtx->length;
 }
 




More information about the gs-cvs mailing list