bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proposed workaround for apparent ghostscript (>= 8.11) bug


From: Matthias Neeracher
Subject: Proposed workaround for apparent ghostscript (>= 8.11) bug
Date: Sat, 11 Sep 2004 02:40:42 -0700

I've spent the last few days investigating the incompatibility of recent lilypond releases with ghostscript 8.13 and 8.14, an issue which had puzzled me for several weeks.

To recapitulate the issue: When I process a file with ghostscript 8.x (8.13 or 8.14) installed, the horizontal metrics of all characters in the PDF output are messed up and the characters are squished together. The PS file from the same run, however, looks OK, whether I look at it with Apple Preview or with gs.

What I've found out is:
- The issue has to do with the re-encoded fonts, which are created with the following pattern:

/magfontYSYDComXVo { /ecbx10 findfont 010.0000 output-scale div scalefont } bind def magfontYSYDComXVo ISOLatin1Encoding /magfontYSYDComXVoeExtended-TeX-Font-Encoding---Latin reencode-font /magfontYSYDComXVoeExtended-TeX-Font-Encoding---Latin{ /magfontYSYDComXVoeExtended-TeX-Font-Encoding---Latin findfont 1 scalefont } bind def

- The PDF output driver in ghostscript 8.[34] messes up horizontal font metrics when the reencoded font is used. - This seems to only happen when the font that is reencoded was scaled before. An unscaled font will reencode fine. - From the ghostscript ChangeLog, my guess would be that this bug was introduced into ghostscript 8.11. Does anybody run Ghostscript 8.11 or newer on a non-Mac platform and can you confirm or deny that the bug happens on your system?

The workaround I've adopted for lilypond on MacOS, and which I'm proposing to roll into lilypond, is to change the above reencoding pattern to

/magfontYSYDComXVo { /ecbx10 findfont 010.0000 output-scale div scalefont } bind def /ecbx10 findfont ISOLatin1Encoding /magfontYSYDComXVoeExtended-TeX-Font-Encoding---Latin reencode-font /magfontYSYDComXVoeExtended-TeX-Font-Encoding---Latin{ /magfontYSYDComXVoeExtended-TeX-Font-Encoding---Latin findfont 010.0000 output-scale div scalefont } bind def

i.e., instead of deriving the re-encoded font from the scaled font, I derive it from the original and scale it separately. This seems to work fine, and so far I haven't seen any adverse side effects.

Patch attached below; I will take up this issue with the ghostscript developers as well.

Matthias

 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]