Dear Guenter,

1) Hmmm ... the code looks a bit strange. Could you try to use the  
following kpsewhich command:
command = 'kpsewhich "--format=%s" %s' % (kpse_file_format, filename)

Does this work without the ugly case differentiation?

2) The pattern was intended to be a single line. Does it help to get  
rid of the error message of the font definition files? (The  
texmessage.ignore is not a proposed solution as it hides all errors  
from being reportet.)

Regarding latex vs. pdflatex please note that latex usually is  
provided by the pdflatex executable nowadays anyway. However, there  
are differences between the two modes, one being the creation of a dvi  
file vs. a pdf file. PyX needs use the dvi output. Now the question is  
whether we just need to use proper mapping files. In PyX 0.10 we do  
not properly handle that -- however, the situation has been completely  
reworked in the current svn head now supporting different font  
mappings depending on the final output (postscript vs. pdf). Does it  
help to properly set the mapping file manually? Try the following code:

     from pyx import *

     text.set(mode="latex", fontmaps="pdftex.map")
     text.preamble(r"\usepackage{times}")

     c = canvas.canvas()
     c.text(0, 0, r"\LaTeX{} doesn't need to look like \LaTeX{} all  
the time.")
     c.writePDFfile("font")


Best,


André


Am 16.11.2008 um 12:20 schrieb Guenter Jaritz:

> Hello Andre,
>
> let me sum up what I've found out.
>
> 1) 8r.enc
> http://sourceforge.net/mailarchive/message.php?msg_id=4683D2E6.60201%40berlin.de
> describes the problem very well.
>
> Simply replacing the original line in __init__.py with
>    def find_file(filename, kpse_file_format):
> #        command = 'kpsewhich --format="%s" %s' % (kpse_file_format,
> filename)
>        command = 'kpsewhich "%s" %s' % (kpse_file_format, filename)
> does not work.
>
> The following does work:
>    def find_file(filename, kpse_file_format):
>        if ' ' in kpse_file_format:
>            command = 'kpsewhich "%s" %s' % (kpse_file_format,  
> filename)
>        else:
>            command = 'kpsewhich --format=%s %s' % (kpse_file_format,
> filename)
>        if not find_file_cache.has_key(command):
>            find_file_cache[command] = os.popen(command,
> "r").readline().strip()
>        return find_file_cache[command]
> ...
>
> I've not found out if this has other side effects. The nag for -- 
> format
> being deprecated shows up when using kpsewhich from the command  
> line. MiKTeX
> is 2.7, the latest staple revision with all updates.
>
> 2)
> have tested the monkey patch. The outcome is:
>
>>>>
> Traceback (most recent call last):
>  File "C:\Dokumente und Einstellungen\nep.TXENON0\Eigene
> Dateien\aee\font\font2.py", line 5, in <module>
>    text._texmessageloaddef.pattern = re.compile(r"\([\"]?(?
> P<filename>(?:(?<!\")[^()\s\n]+(?!\"))|[^()\"\n]+)(\.fd|\.def)[\"]?(?
> P<additional>[^()]*)\)")
>  File "C:\Python25\lib\re.py", line 188, in compile
>    return _compile(pattern, flags)
>  File "C:\Python25\lib\re.py", line 241, in _compile
>    raise error, v # invalid expression
> error: unexpected end of pattern
>>>>
>
> I deleted the EOLs (linebreak in email) in ...(? P<filename...  
> and ...(?
> P<additional..., I hope this was okay. If it is possible to post  
> attachments
> to the list, I could add the source documents.
>
> A way to supress the unhandled LaTeX output and getting output is  
> placing
> the following preamble
> text.set(mode="latex", errordebug=2,
>        texmessagesdefaultrun=[text.texmessage.ignore]
>         )
>
> However, with the above the problems are still not solved yet. I'm  
> using
> pdflatex for all my documents (no, I never-never want go back to  
> DVI): Using
> the following short LaTeX-file
> \documentclass[10pt]{scrartcl}
> \usepackage{times}
> \usepackage{graphicx}
> \begin{document}
> \LaTeX{} doesn't need to look like \LaTeX{} all the time.\\
> \includegraphics{font}% this is the file prduced by font.py
> \end{document}
> gives me two different Times fonts. pdflatex embeds NimbusRomNo9L-Regu
> (Eingebettete Untergruppe), while PyX is using Times-Roman,  
> Originalschrift:
> TimesNewRomanPSMT, obviously not embedding it.
> When using mathpazo in pdflatex gives URWPalladiaL-Roma, while PyX  
> uses
> Palatino-Roma. This is substituted by Acrobat 7 with Adobe-Sans MM
>
> Using the above with DVI output, the fonts show up (kerning is  
> slightly
> different between latex and PyX-output). But this is no option for me,
> because my workflow is having graphics in PDF/JPG (and I think it  
> would be
> stupid to convert back to EPS and forth to PDF by dvips).
>
> Stupid question: Could it help if using pdflatex instead of latex by  
> PyX
> (something like text.set(mode="pdflatex")?
>
> I hope the above is not too confusing, with best regards,
> Guenter
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's  
> challenge
> Build the coolest Linux based applications with Moblin SDK & win  
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in  
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> PyX-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyx-user
>

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


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to