On 26.03.08, André Wobst wrote:
> Maybe we should think about moving the encoding handling into the  
> registry somehow. I think this could work out quite well, but this is  
> just a wild guess at the moment. I have to look into the details and I  
> have to think about it.
>
> Anyway, for the moment I don't have any real  
> problem with the code in it's current state.

Hm, I have been preparing a talk with pyx the last days, 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.

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 -----------

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.

Michael

-------------------------------------------------------------------------
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

Reply via email to