Dear Guenter,

1) After a discussion of this issue at the munich TeX regulars' table I know know why 'kpsewhich "PostScript Header" 8r.enc' returns the proper path. It searches for a file like "PostScript Header" and a file like "8r.enc". The first is not found, the second returns the proper path of 8r.enc. The reason this works is because there is some automatic format detection mechanism in kpsewhich (which of course does not always work) and the fact, that recent kpsewhich configurations have a special format type "enc files" and do not properly resolve enc files for the "PostScript Header" format. Unfortunately all this seems very distribution specific. However, as I'm currently working on a new path search framework for PyX, it is very important to me to did learn about it now. (Actually I currently do not work on it, but I have some preliminary code I want to complete before the next release. A few goals I'm interested in are making PyX runnable from an egg and allowing to use ls-R files without libkpathsea and the slow kpsewhich system calls.)

2) Let me try to attach the example file to this mail as I guess its just a line break issue with the patch. It would be great to check the validity of the patch before including it in the distribution.

3) The pdftex.map issue is handled automatically in the SVN head already.

Thanks a lot for helping PyX!

Best,


André



Am 02.12.2008 um 22:33 schrieb Guenter Jaritz:

Dear André,

took some time, but let's look what I've found out:

1) The kpsewhich-issue (searching for 8r.enc). Enjoy the variety of what can
get wrong.

Tried the following on the command-line (command followed by the output):

kpsewhich --format="PostScript Header" 8r.enc
<- just a blank line!
kpsewhich "--format=PostScript Header" 8r.enc
<- just a blank line!
kpsewhich "--format="PostScript Header"" 8r.enc
findtexmf: Unknown file type: PostScript.

kpsewhich "PostScript Header" 8r.enc
C:/Programme/MiKTeX 2.7/fonts/enc/dvips/fontname/8r.enc

kpsewhich "PostScript foobar" 8r.enc
C:/Programme/MiKTeX 2.7/fonts/enc/dvips/fontname/8r.enc


kpsewhich 8r.enc
C:/Programme/MiKTeX 2.7/fonts/enc/dvips/fontname/8r.enc

kpsewhich --format="PostScript foobar" 8r.enc
findtexmf: Unknown file type: PostScript foobar.

If you can get a pattern into this... On the third example it omits the "Header" in "PostScript Header", but not the "foobar" in the "PostScript
foobar" of the last example. Strange, strange...

Should I post this to the MikTeX-group?

Does this work without the ugly case differentiation?
Nope. Obviously the case differentiation is needed when asking for a
kpse_file_format containing a space. In this case a --format=... must not be requested and it works without even specifying one. In other cases it works with the normal --format=... specifier. The same is true for format "type1
fonts".

2) Monkey patch:

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?

No, it gives a runtime error:
The line in the source file (ignore the linebreak, it is *one* line in the
.py-File):

text._texmessageloaddef.pattern = re.compile(r"\([\"]?(?
P<filename>(?:(?<!\")[^()\s\n]+(?!\"))|[^()\"\n]+)(\.fd|\.def)[\"]?(?
P<additional>[^()]*)\)")

The output of the Interpreter:

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


(The
texmessage.ignore is not a proposed solution as it hides all errors
from being reportet.)
I also to stuck with this for the time being.

(LaTeX vs. pdfLaTeX)
(Embedding fonts properly in PDF's on MikTeX/PyX 0.10):
Using the line

text.set(mode="latex", fontmaps="pdftex.map")

did it for me! Your example worked (for packages mathpazo, mathptmx, fourier
and fouriernc)!

With the ignoring of the messages left over from the LaTeX-run the font
stuff works for me now. But of course it would be interesting to get
everything solved...

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

# your PyX script, example:
text.set(mode="latex", fontmaps="pdftex.map")
text.preamble(r"\usepackage{marvosym}")

c = canvas.canvas()
c.text(0, 0, r"\EUR")
c.writePDFfile("monkey")
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to