Hi Guenter,

Regarding the first problem with the times package, we need to find  
out why kpsewhich does not resolve the request for an postscript  
snippet. The following code seems to return None for you, and the  
question is, why (and how we should call kpsewhich to get the proper  
path back):

     from pyx.pykpathsea import *
     print find_file("8r.enc", kpse_tex_ps_header_format)

(This code is just a wrapper for a call of the kpsewhich executable.  
See the trivial pyx/pykpathsea/__init__.py. Please try to find out,  
why the encoding file is not found and tell me how to improve the  
situation for your MikTeX installation.)

The second issue is a clear bug in PyX (for handling file names with  
white space). Please check whether the following code (in the  
beginning of your pyx script) fixes the issue:

     from pyx import *

     # insert this monkey patch
     import re
     text._texmessageloaddef.pattern = re.compile(r"\([\"]?(? 
P<filename>(?:(?<!\")[^()\s\n]+(?!\"))|[^()\"\n]+)(\.fd|\.def)[\"]?(? 
P<additional>[^()]*)\)")
     # end of monkey patch


Best,


André



Am 13.11.2008 um 10:48 schrieb Guenter Jaritz:

> Hello,
>
> I also have the same problem: using other fonts than CM in "latex"  
> mode on Windows. I have to admit I don't understand the background  
> of changing fonts in TeX/LaTeX, luckily, the packages are doing all  
> the work for me.
>
> Have got MikTeX 2.7 here, Basic installation with no path change.  
> Python is 2.5.2, using IDLE for all script runs
>
> Let's consider switching to Times: On LaTeX, \usepackage{times}  
> compiles like a hitch. The following minimal PyX example does *not*  
> work:
>
> from pyx import *
>
> text.set(mode="latex")
> 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.writeEPSfile("font")
> c.writePDFfile("font")
>
> having the following error (I save you from reading the whole  
> message, just first and last three lines)
>
> Traceback (most recent call last):
>  File "D:\Daten\zipp\PyX\PyX-0.10\examples\text\font.py", line 8, in  
> <module>
>    c.writeEPSfile("font")
> ...
>  File "C:\Python25\lib\site-packages\pyx\dvifile.py", line 753, in  
> putchar
>    raise RuntimeError("cannot find font encoding file %s" %  
> fontmapinfo.encodingfile)
> RuntimeError: cannot find font encoding file 8r.enc
>
> However, when searching the 8r.enc and copying to the local working  
> directory, it works.
>
> With other packages ({mathptmx}, [charter]{mathdesign},  
> {mathpazo}, ...) I get the following error (for example using  
> r"\usepackage{mathptmx}" as preamble, errordebug = 2):
>
> Traceback (most recent call last):
>  File "D:\files\latex\font\font.py", line 7, in <module>
>    c.text(0, 0, r"\LaTeX{} doesn't need to look like \LaTeX{} all  
> the time.")
> ...
> The expression passed to TeX was:
>  \ProcessPyXBox{\LaTeX{} doesn't need to look like \LaTeX{} all the  
> time.%
>  }{1}%
>  \PyXInput{6}%
> The return message from TeX was:
>  *
>  *("C:\Program Files\MiKTeX 2.7\tex\latex\psnfss\ot1ztmcm.fd")
>  ("C:\Program Files\MiKTeX 2.7\tex\latex\psnfss\omlztmcm.fd")
>  ("C:\Program Files\MiKTeX 2.7\tex\latex\psnfss\omsztmcm.fd")
>  ("C:\Program Files\MiKTeX 2.7\tex\latex\psnfss\omxztmcm.fd")
>  PyXBox:page=1,lt=0.0pt,rt=199.3498pt,ht=6.81989pt,dp=2.24998pt:
>  [80.121.88.1]
>  *PyXInputMarker:executeid=6:
> After parsing this message, the following was left:
>  *
>  *("C:\Program Files\MiKTeX 2.7\tex\latex\psnfss\ot1ztmcm.fd")
>  ("C:\Program Files\MiKTeX 2.7\tex\latex\psnfss\omlztmcm.fd")
>  ("C:\Program Files\MiKTeX 2.7\tex\latex\psnfss\omsztmcm.fd")
>  ("C:\Program Files\MiKTeX 2.7\tex\latex\psnfss\omxztmcm.fd")
>
>
>  *
>
> For completeness, i include the output of contrib\callingtex.py.
>
>>>>
> Platform is win32
> Python installation prefix is C:\Python25
> Python executable is C:\Python25\pythonw.exe
> PyX comes from C:\Python25\lib\site-packages\pyx\__init__.pyc
> PyX version 0.10
> PyX pykpathsea python module used
>
> "        echo $0 \"$*\"" -->  $0 \"$*\"
> "           echo $SHELL" -->  $SHELL
> "   echo $BASH_SUBSHELL" -->  $BASH_SUBSHELL
> "               echo $-" -->  $-
> "             echo $ENV" -->  $ENV
> "        echo $BASH_ENV" -->  $BASH_ENV
> "        echo $TEXMFCNF" -->  $TEXMFCNF
> "               echo $_" -->  $_
> "            echo $PATH" -->  $PATH
> "       which kpsewhich" -->  C:\Program Files\MiKTeX 2.7\miktex\bin 
> \kpsewhich.EXE
> "             which tex" -->  C:\Program Files\MiKTeX 2.7\miktex\bin 
> \tex.EXE
> "           which latex" -->  C:\Program Files\MiKTeX 2.7\miktex\bin 
> \latex.EXE
> "file `which kpsewhich`" --> "      file `which tex`" --> "    file  
> `which latex`" -->
> "psfonts.map" found at "D:/Documents and Settings/All Users/ 
> Application Data/MiKTeX/2.7/dvips/config/psfonts.map" as format "map"
> "psfonts.map" found at "D:/Documents and Settings/All Users/ 
> Application Data/MiKTeX/2.7/dvips/config/psfonts.map" as format  
> "PostScript header"
> "psfonts.map" found at "D:/Documents and Settings/All Users/ 
> Application Data/MiKTeX/2.7/dvips/config/psfonts.map" as format  
> "dvips config"
> "psfonts.cmz" found at "C:/Program Files/MiKTeX 2.7/fonts/map/dvips/ 
> cm/psfonts.cmz" as format "map"
>
>>>>
>
> Maybe someone is able to get an idea what is running wrong...
>
> With best regards,
> Guenter
> -- 
> "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
>
> -- 
> Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
>
> -------------------------------------------------------------------------
> 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