[gs-cvs] gs/src

Igor Melichev igor at ghostscript.com
Mon Oct 18 01:45:36 PDT 2004


Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv31148/gs/src

Modified Files:
      Tag: GS_8_1X
	gxhintn.c 
Log Message:
Fix (Type 1 hinter) : Don't align glyph width to pixels.

DETAILS :

See comment in code.
Bug 687719 "PDFWRITE corrupts letter spacing/placement".

When porting this patch to GS_8_1X please note that the default value
of AlignToPixels is different in HEAD andf GS_8_1X.
Therefore this patch may cause differences witg GS_8_1X.

EXPECTED DIFFERENCES :

None with default settings.

With -dAlignToPixels=1 it causes a minor difference in glyph positions :

normal, 72 dpi :

"H:\AuxFiles\CompareFiles\CAT_LOGO.ps"
"H:\AuxFiles\CompareFiles\UnusualFontMatrix.ps"

noprmal, 300dpi :
"H:\AuxFiles\CompareFiles\401-01.ps" 
"H:\AuxFiles\CompareFiles\CAT_LOGO.ps" 
"H:\AuxFiles\CompareFiles\UnusualFontMatrix.ps" 

pdfwrite 72dpi :
None.

pdfwrite 300dpi :
None.


Index: gxhintn.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gxhintn.c,v
retrieving revision 1.21.2.9
retrieving revision 1.21.2.10
diff -u -d -r1.21.2.9 -r1.21.2.10
--- gxhintn.c	31 Aug 2004 04:03:30 -0000	1.21.2.9
+++ gxhintn.c	18 Oct 2004 08:45:34 -0000	1.21.2.10
@@ -2186,8 +2186,19 @@
 private int t1_hinter__add_trailing_moveto(t1_hinter * this)
 {   t1_glyph_space_coord gx = this->width_gx, gy = this->width_gy;
 
+#if 0 /* This appears wrong due to several reasons :
+	 1. With TextAlphaBits=1, AlignToPixels must have no effect.
+	 2. ashow, awidthshow must add the width before alignment.
+	 4. In the PDF interpreter, Tc must add before alignment.
+	 5. Since a character origin is aligned,
+	    rounding its width doesn't affect subsequent characters.
+	 6. When the character size is smaller than half pixel width,
+	    glyph widths round to zero, causing overlapped glyphs.
+	    (Bug 687719 "PDFWRITE corrupts letter spacing/placement").
+       */
     if (this->align_to_pixels)
 	t1_hinter__align_to_grid(this, this->g2o_fraction, &gx, &gy, this->align_to_pixels);
+#endif
     return t1_hinter__rmoveto(this, gx - this->cx, gy - this->cy);
 }
 



More information about the gs-cvs mailing list