Bug 687156

Summary: some characters shifted higher in acrobat4 generated eps
Product: Ghostscript Reporter: Jack Moffitt <jack>
Component: PS InterpreterAssignee: Igor Melichev <igor.melichev>
Status: NOTIFIED FIXED    
Severity: normal CC: alex, raph.levien
Priority: P2    
Version: master   
Hardware: All   
OS: All   
Customer: 710 Word Size: ---
Attachments: patch.txt
patch2.txt
patch3.txt

Description Jack Moffitt 2003-11-20 16:03:48 UTC
If one generates an EPS file from the PDF in Acrobat 4, Ghostscript renders this
file with the characters shifted up, but the EPS created by Acrobat5 looks fine.
Comment 1 Jack Moffitt 2003-11-20 16:04:22 UTC
Created attachment 378 [details]
acro4_gs811.tar.gz
Comment 2 Igor Melichev 2003-11-21 04:30:59 UTC
Wanted to run it with CPSI, but could not unpack the TAR file on Windows. gzip 
suceeds but tar fails. Could you re-pack it please ?
Comment 3 Igor Melichev 2003-11-21 07:51:46 UTC
I've got the files from Alex.
CPSI renders both files fine.
I confirm the problem with Ghostscript.
Comment 4 Igor Melichev 2003-11-27 05:22:58 UTC
GS_7_0X renders fine.
Comment 5 Igor Melichev 2003-11-27 07:14:21 UTC
gs8_00 renders it fine.
Interesting that in the wrong rendering with CVS HEAD the lower bounary of a 
character bbox appears equal to the upper boundary of the correct rendering 
with gs8.00.
Comment 6 Igor Melichev 2003-11-27 07:15:12 UTC
Created attachment 385 [details]
acrobat4-.eps

Attacing a reduced test.
Comment 7 Alex Cherepanov 2003-11-29 20:22:42 UTC
This problem was introduced on 2003-01-27 with activation of the new hinter.
Comment 8 Igor Melichev 2003-11-30 11:04:40 UTC
The test document embeds a font, which has a big Y component of lsb. The old 
code (NEW_TYPE1_HINTER 0) ignores the y-component of lsb with the command 
ce1_sbw. I have no idea why it was done so. The new code (NEW_TYPE1_HINTER 1) 
does not ignore it, and we get the shift.
Comment 9 Igor Melichev 2003-12-01 03:12:33 UTC
The previous comment isn't correct. The old code accounts the Y coordinate at 
the end of gs_type1_finish_init. Still didn't find where the new code diverges.
Comment 10 Igor Melichev 2003-12-01 04:20:12 UTC
Well, I found the reason. The new hinter imports the side bearing when 
import_shift is not initialized. Need to initialize it in t1_hinter__init 
rather than in t1_hinter__set_mapping.
Comment 11 Igor Melichev 2003-12-01 05:06:27 UTC
Created attachment 386 [details]
patch.txt

The attached patch fixes the problem.
Comment 12 Igor Melichev 2003-12-02 02:32:51 UTC
An improved patch
http://www.ghostscript.com/pipermail/gs-code-review/2003-December/004275.html
Comment 13 Igor Melichev 2003-12-02 02:33:47 UTC
Created attachment 388 [details]
patch2.txt 

Attaching an improved patch.
Comment 14 Igor Melichev 2003-12-02 03:10:50 UTC
Created attachment 390 [details]
patch3.txt

Attaching an improved patch3.txt
(same as
http://www.ghostscript.com/pipermail/gs-code-review/2003-December/004276.html)
Comment 15 Igor Melichev 2003-12-04 01:38:18 UTC
Patch
http://www.ghostscript.com/pipermail/gs-cvs/2003-December/003799.html
has been committed.