Michael,
Am 26.03.2008 um 13:50 schrieb Michael SCHINDLER:
> ... and I am
> using non-standard fonts for it. This is always a delicate issue as it
> brings together the complications in LaTeX and the ones in PyX. In a
> way, I am testing the limits of the current implementation.
Great!
> I do have a new problem with the code, which is probably related to
> another
> issue in the font handling. I encounter a glyphname "None" at some
> part in the
> encoding which breaks the afm width information. (The very same code
> worked
> with 0.10) It seems to be necessary to catch the glyphname None at
> some point.
> The code runs to the end if I insert the catch in afmfile.py around
> line 1358,
> but I am not convinced that this is the best choice for the catch.
>
>
> def width_ds(self, glyphname):
> if glyphname is None:
> return 0
> return self.charmetricsdict[glyphname].widths[0][0]
>
>
>
> ------- traceback -------
> File "/home/michael/python/PyX-0.10+/pyx/document.py", line 171, in
> writePDFfile
> pdfwriter.PDFwriter(self, _outputstream(file, "pdf"), **kwargs)
> File "/home/michael/python/PyX-0.10+/pyx/pdfwriter.py", line 318, in
> __init__
> registry.write(file, self, catalog)
> File "/home/michael/python/PyX-0.10+/pyx/pdfwriter.py", line 77, in
> write
> object.write(file, writer, self)
> File "/home/michael/python/PyX-0.10+/pyx/font/font.py", line 201, in
> write
> file.write("%i" % self.metric.width_ds(encoding[i]))
> File "/home/michael/python/PyX-0.10+/pyx/font/afmfile.py", line
> 1361, in width_ds
> return self.charmetricsdict[glyphname].widths[0][0]
> KeyError
> --------end traceback -----------
I don't like None as glyphname to have a special meaning for metric
information. There is no glyph None. Thus it's better to to fix the
lookup itself. What happens here is that you use a font with encoding
vector items being None and you try to use this font in the PDF file
within the firstchar-lastchar range where you need to output a
character width. Better to output a zero right there. See changeset
2976.
BTW: IIRC pdfLaTeX sets the width information to 0 for glyphs not used
to reduce the file size as we did too (do I remember correctly?). We
might want to restore this behaviour and the issue should be gone as
well ...
> It may be important to note that I have not managed to use the afm
> files in my installation. Therefore, I obtain warnings such as
>
> We are about to extract font information for the Type 1 font
> 'SFSX1440' from its pfb file. This is bad practice (and it's slow).
> You should use an afm file instead.
That's fine. The message does exactly tell you the truth.
André
--
by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
/ \ \ / ) [EMAIL PROTECTED], http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
PyX-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-devel