Hi Michael,

On 21.02.06, Michael Strass wrote:
> So far so good. It works for my example now. Strangely enough, going a
> step further an using math, I run into the following error:
> 
> Traceback (most recent call last):
>   File "test-mathpazo.py", line 16, in ?
>     c.writePDFfile(__file__[:-3], paperformat=document.paperformat.A4)
>   File "../../pyx/canvas.py", line 330, in wrappedindocument
>   File "~/python/PyX-0.8.1+/pyx/document.py", line 144, in writePDFfile
>     pdfwriter.PDFwriter(self, filename, *args, **kwargs)
>   File "../../pyx/pdfwriter.py", line 503, in __init__
>   File "../../pyx/pdfwriter.py", line 138, in __init__
>   File "../../pyx/pdfwriter.py", line 195, in __init__
>   File "../../pyx/pdfwriter.py", line 230, in __init__
>   File "../../pyx/canvas.py", line 189, in registerPDF
>   File "~/python/PyX-0.8.1+/pyx/text.py", line 703, in registerPDF
>     canvas._canvas.registerPDF(self, registry)
>   File "../../pyx/canvas.py", line 189, in registerPDF
>   File "../../pyx/canvas.py", line 189, in registerPDF
>   File "../../pyx/canvas.py", line 189, in registerPDF
>   File "../pyx/type1font.py", line 145, in registerPDF
>   File "../../pyx/pdfwriter.py", line 322, in __init__
>   File "../../pyx/pdfwriter.py", line 393, in __init__
>   File "~/python/PyX-0.8.1+/pyx/dvifile.py", line 447, in fontinfo
>     fontinfo.fontbbox = (0,
>   File "~/python/PyX-0.8.1+/pyx/dvifile.py", line 529, in getheight_ds
>     return
> self._convert_tfm_to_ds(self.tfmfile.height[self.tfmfile.char_info[charcode].height_index])
> AttributeError: 'NoneType' object has no attribute 'height_index'
> 
> 
> What's going wrong here?

The "best guess" calculation of some fontinfo properties (like the
font bounding box) failes for some of the fonts, since there are no
glyphs. Note that pdfTeX extracts those data from the pfb, which we
might want to start as well (since we have our own font stripping
stuff now, it's kind of easy). Furthermore by using the new AFM
reader, which Jörg recently wrote, we could even do the correct thing
(when we have afm files for the fonts, which is unfortunately not
always the case in the typical texmf-trees).

Beside that I've just checked in a quick fix, which just writes some
arbitrary values in case we can't create an educated guess from the
font metric. See rev. 1.61 of dvifile.py. (Since the font's are
included in the pdf, the wrong font info doesn't harm at all -- it's
used to find a proper replacement, when the font is missing from the
file -- that's at least how I understand the PDF docus.)


André

-- 
by  _ _      _    Dr. André Wobst
   / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to