[Isaac] Matplotlib font encoding problem

I'm forwarding this problem from the scipy list

John Hunter wrote:

I'm forwarding this problem from the scipy list


Matplotlib font encoding problem
Alan G Isaac <aisaac@...310...>
Tue, 17 Aug 2004 23:17:34 -0400 (Eastern Daylight Time)
scipy-user <scipy-user@...29...>

scipy-user <scipy-user@...29...>

Matplotlib is doing something with its fonts that
is unfriendly. E.g., Ghostscript and Distiller choke on

Ghostscript says it is an invalid front.

If I get rid of the verdana font encoding, the file displays fine.

I have the same problem when I try to use the TeX fonts.

Hi Alan,

I'm not sure what is going on here, but I can tell you that the Verdana font is somehow being corrupted, specifically the sfnts data. This font works fine for me with the simple_plot example.

Comparing the embedded fonts in the two .eps files, shows that the font in your file is corrupted. There are two possibilities here: either your TrueType Font (TTF) file is corrupted, or your binascii.b2a_hex function in the Python library is producing corrupted output. This function converts the TTF file to ASCII hex and is likely to be the culprit, since the length of some of the lines in sfnts array are incorrect. They should be 72 characters in length unless they begin or end with a '<' or '>', resp..

  -- Paul


Paul Barrett, PhD Space Telescope Science Institute
Phone: 410-338-4475 ESS/Science Software Branch
FAX: 410-338-4767 Baltimore, MD 21218