From: Gert I. <ger...@ph...> - 2009-03-23 08:37:34
|
Hi, this is mainly a question for those who know the inner workings of the font handling (André, Jörg,...). Using the fourier package, I get wrong character spacing in scriptstyle. The difference can be seen by comparing the following PyX and LaTeX code: ######################################################### from pyx import * text.set(mode="latex", fontmaps="fourier.map") text.preamble(r"\usepackage{fourier}") text.preamble(r"\usepackage{amsmath}") c = canvas.canvas() c.text(0,0.5,r"Test ideal $F_\text{ideal}$") c.text(0,0,r"Test ideal $F_\text{\scriptsize ideal}$") c.writePDFfile("test") ######################################################### %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \documentclass{article} \usepackage{fourier} \usepackage{amsmath} \begin{document} Test ideal $F_\text{ideal}$ \end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% In the PyX result, the upper line shows the problem while the lower line corresponds to a possible workaround. Even there the character spacing is too large compared to the output of the LaTeX code (see e.g. spacing between a and l). There is also a difference in the heights of the scriptsize characters between the PyX and the LaTeX output. A potential reason for the wrong spacing could be the defaultscriptratio which for fourier is unusually large (0.76). dvidebug (on PyX) and dvitype (on the LaTeX output) indicate that the character spacing is the same so that the problem actually seems to be the character height. If one creates an lfs file (which is of course not of any use in latex mode), the character scalings are read correctly from fourier.sty. Another style which requires a large defaultscriptratio is mathpazo. When trying this out, I found extreme slants in the italics, but this is a different (though may be related?) story. While the workaround by explicitly requiring scriptsize works more or less, it would be nice to have correct character spacing. The output without workaround is just ugly. Best regards, Gert -- Gert-Ludwig Ingold email: Gert.Ingold@Physik.Uni-Augsburg.DE Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
From: Joerg L. <jo...@us...> - 2009-03-23 09:44:46
|
Dear Gert, On 23.03.09, Gert Ingold wrote: > this is mainly a question for those who know the inner workings of the > font handling (André, Jörg,...). > > Using the fourier package, I get wrong character spacing in scriptstyle. > The difference can be seen by comparing the following PyX and LaTeX code: I notice that your code is based on PyX 0.10. In the current SVN version quite a lot has changed regarding the text handling. Note that when trying that you have to specify the fontmap in the .pyxrc file. It became, as it should be, a property of the writer and thus automatically dependent on whether you generate PS or PDF. But unfortunately, setting writer properties directly is not readily possible yet - and for the fontmap even unsupported right now. Instead, a "pdffontmaps=fourier.map" in the [text] section of the .pyxrc file should work. Best, Jörg |
From: Gert I. <ger...@ph...> - 2009-03-23 10:30:55
|
Dear Jörg, thanks for the fast reply. > I notice that your code is based on PyX 0.10. In the current SVN > version quite a lot has changed regarding the text handling. Actually, the problem also arises with PyX 0.9. In which respect is my code 0.10 specific? > Note that when trying that you have to specify the fontmap in the .pyxrc > file. It became, as it should be, a property of the writer and thus > automatically dependent on whether you generate PS or PDF. But > unfortunately, setting writer properties directly is not readily > possible yet - and for the fontmap even unsupported right now. Instead, > a "pdffontmaps=fourier.map" in the [text] section of the .pyxrc file > should work. The .pyxrc in my HOME now reads [text] pdffontmaps = fourier.map but that does not change anything. BTW, I verified that fourier.map is found by kpsewhich. Best regards, Gert -- Gert-Ludwig Ingold email: Gert.Ingold@Physik.Uni-Augsburg.DE Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
From: Joerg L. <jo...@us...> - 2009-03-23 10:45:38
|
Dear Gerd, On 23.03.09, Gert Ingold wrote: > > I notice that your code is based on PyX 0.10. In the current SVN > > version quite a lot has changed regarding the text handling. > > Actually, the problem also arises with PyX 0.9. In which respect is my > code 0.10 specific? Sorry, I was a bit imprecise. I meant that the code has changed in the (not yet released) version found in the Subversion repository. Only there, the configuration option I referred to is evaluated at all. Best, Jörg |
From: Gert I. <ger...@ph...> - 2009-03-23 11:17:07
|
Dear Jörg, > Sorry, I was a bit imprecise. I meant that the code has changed in > the (not yet released) version found in the Subversion repository. > Only there, the configuration option I referred to is evaluated at all. ok, I switched to r3004. Then, I am getting an exception from the configuration parser. The end of the error messages reads: File "/home/gert/pyx-svn/pyx/pdfwriter.py", line 327, in getfontmap fontmapfiles = config.getlist("text", "pdffontmaps", ["pdftex.map"]) File "/home/gert/pyx-svn/pyx/config.py", line 60, in getlist return [config.get(section, option) for option in options] File "/usr/lib/python2.5/ConfigParser.py", line 520, in get raise NoOptionError(option, section) ConfigParser.NoOptionError: No option 'fourier.map' in section: 'text' for a local .pyxrc containing [text] pdffontmaps=fourier.map Best regards, Gert -- Gert-Ludwig Ingold email: Gert.Ingold@Physik.Uni-Augsburg.DE Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |
From: Joerg L. <jo...@us...> - 2009-03-23 18:32:45
|
On 23.03.09, Gert Ingold wrote: > Dear Jörg, > > > Sorry, I was a bit imprecise. I meant that the code has changed in > > the (not yet released) version found in the Subversion repository. > > Only there, the configuration option I referred to is evaluated at all. > > ok, I switched to r3004. Then, I am getting an exception from the > configuration parser. The end of the error messages reads: > > File "/home/gert/pyx-svn/pyx/pdfwriter.py", line 327, in getfontmap > fontmapfiles = config.getlist("text", "pdffontmaps", ["pdftex.map"]) > File "/home/gert/pyx-svn/pyx/config.py", line 60, in getlist > return [config.get(section, option) for option in options] > File "/usr/lib/python2.5/ConfigParser.py", line 520, in get > raise NoOptionError(option, section) > ConfigParser.NoOptionError: No option 'fourier.map' in > section: 'text' > > for a local .pyxrc containing > > [text] > pdffontmaps=fourier.map Sorry, there was a bug in the config file parser which I justed fixed in revision 3005. Btw, you also have to specify the standard pdftex mapping file, i.e., the lines should read: [text] pdffontmaps: pdftex.map fourier.map I finally got around trying it (I didn't have fourier installed) and it looks like the problem has not been fixed. But I also get strange font warnings when compiling the LaTeX file you sent for comparison... Anyway, there's probably a problem in somewhere in PyX's dvi handling. Unfortunately that part is not yet really optimal, and it's not something to be fixed in a couple of minutes. So, I'll add a TODO item... Best, Jörg |
From: Gert I. <ger...@ph...> - 2009-03-23 20:19:31
|
Dear Jörg, > Sorry, there was a bug in the config file parser which I justed fixed in > revision 3005. Btw, you also have to specify the standard pdftex ok, I can confirm that this part is working now. > I finally got around trying it (I didn't have fourier installed) and > it looks like the problem has not been fixed. But I also get I can also confirm this one :-( > strange font warnings when compiling the LaTeX file you sent for > comparison... This sounds like warnings which I looked into at the request of one of our local LaTeX users (SK). After spending some time on the issue, I concluded that these warnings are not easy to get rid off but that they can safely be ignored... Somehow the appearance of these warnings depends on the installation (I do not recall the details now) and they do not appear on my machine. > Anyway, there's probably a problem in somewhere in PyX's dvi handling. > Unfortunately that part is not yet really optimal, and it's not > something to be fixed in a couple of minutes. So, I'll add a TODO > item... I can easily believe that it is nontrivial to fix the problem without affecting code which works fine... Thanks anyway for your help. Best regards, Gert -- Gert-Ludwig Ingold email: Gert.Ingold@Physik.Uni-Augsburg.DE Institut für Physik Phone: +49-821-598-3234 Universität Augsburg Fax : +49-821-598-3222 D-86135 Augsburg WWW : www.physik.uni-augsburg.de/theo1/ingold Germany PGP : 86FF5A93, key available from homepage |