Menu

#10 Cannot change fonts away from default CM

open-accepted
nobody
None
5
2012-08-06
2011-06-09
m4cph1sto
No

I need to use a sans serif font, such as Helvetica, in my plots. In Pyxplot 0.7 I was able to use a latex preamble such as:

set preamble \renewcommand{\familydefault}{\sfdefault} \ \usepackage{sfmath} \ \usepackage{helvet}

But in Pyxplot 0.8.4 I get an error, no matter what font package I try to load. The error says:
"Error: dviGetTfm: Cannot find pfa or pfb file for font phvb7t"

This is when I try to use the package helvet. If I use the package mathpazo, for example, it says:
" ... Cannot find pfa or pfb file for font pplr7t"

Perhaps Pyxplot 0.8.4 is using incorrect names for the built-in fonts?

My system is running Ubuntu 10.10 with all the LaTeX and font packages installed. I also get this problem on a separate computer running Fedora 14. I REALLY need to use a sans font like Helvetica on my plots, so I hope this can be resolved soon!!!

Discussion

  • m4cph1sto

    m4cph1sto - 2011-06-10

    Of course after posting, I solved my own problem. I don't know why, but for that preamble to work, the packages need to be loaded in a different order. This works:

    set preamble \usepackage{helvet} \ \renewcommand{\familydefault}{\sfdefault} \ \usepackage{sfmath}

     
  • m4cph1sto

    m4cph1sto - 2011-06-10
    • status: open --> open-invalid
     
  • m4cph1sto

    m4cph1sto - 2011-06-12

    I spoke too soon. The above solution worked for my Ubuntu system, but not on Fedora. It is strange to me that the error indicates Pyxplot is looking for a pfa or pfb file for built-in fonts such as Helvetica, when actually the fonts are installed as TFM type. For example, kpsewhich returns the proper location for phvb7t.tfm. My guess is this is a bug in PyXPlot's font finding, that it is simply searching for pfm or pfb fonts when it should be searching for tfm fonts for the built-in fonts like Times, Helvetica, etc.

     
  • m4cph1sto

    m4cph1sto - 2011-06-12
    • status: open-invalid --> open
     
  • m4cph1sto

    m4cph1sto - 2011-06-17

    Here's some terminal commands/output to recreate the bug. This is on a computer running Fedora 14.

    user@nano-eee ~/Downloads/pyxplot-0.8.4 $ cat test.ppl
    reset
    set preamble \usepackage{times} \ \renewcommand{\familydefault}{\sfdefault} \ \usepackage{sfmath}
    set terminal eps
    set output 'test.eps'
    plot sin(x)
    user@nano-eee ~/Downloads/pyxplot-0.8.4 $ pyxplot test.ppl
    file 'test.ppl':10: Error: dviGetTfm: Cannot find pfa or pfb file for font phvb7t
    user@nano-eee ~/Downloads/pyxplot-0.8.4 $ kpsewhich phvb7t.tfm
    /usr/share/texmf/fonts/tfm/adobe/helvetic/phvb7t.tfm

     
  • Dominic Ford

    Dominic Ford - 2012-08-06

    Thanks for your bug report.

    There's certainly a bug with the threatment of the Helvetica font definition (still current in 0.9.0). However, issuing the command

    set preamble \renewcommand{\familydefault}{\sfdefault}

    on its own (without specifying Helvetica) does give you a sans-serif font. The problem is latex has lots of different ways of defining fonts...

     
  • Dominic Ford

    Dominic Ford - 2012-08-06
    • status: open --> open-accepted
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.