0.99.1.2: error in afm.py

After a long hiatus I'm again working on an application and just upgraded
matplotlib from 0.98.5.2 to 0.99.1.2. However, there's an error on start up
that I need your help in resolving.

   There are many dozens of lines containing:

Found an unknown keyword in AFM header (was Underline)

The traceback (in its entirety) shows:

Traceback (most recent call last):
   File "./eikos.py", line 6, in <module>
     from modelPage import modModel
   File "/home/rshepard/development/trunk/modelPage.py", line 8, in <module>
     from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as
FigureCanvas
   File
"/usr/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py",
line 20, in <module>
     from matplotlib.figure import Figure
   File "/usr/lib/python2.6/site-packages/matplotlib/figure.py", line 18, in
<module>
     from axes import Axes, SubplotBase, subplot_class_factory
   File "/usr/lib/python2.6/site-packages/matplotlib/axes.py", line 12, in
<module>
     import matplotlib.axis as maxis
   File "/usr/lib/python2.6/site-packages/matplotlib/axis.py", line 10, in
<module>
     import matplotlib.font_manager as font_manager
   File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
1301, in <module>
     _rebuild()
   File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
1292, in _rebuild
     fontManager = FontManager()
   File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line 1010, in __init__
     self.afmlist = createFontList(self.afmfiles, fontext='afm')
   File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
578, in createFontList
     font = afm.AFM(fh)
   File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 295, in
__init__
     parse_afm(fh)
   File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 283, in
parse_afm
     dcmetrics_ascii, dcmetrics_name = _parse_char_metrics(fh)
   File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 167, in
_parse_char_metrics
     name = vals[2].split()[1]
IndexError: list index out of range

   Please tell me what I need to do to resolve this error.

Rich

Rich,

In the afm.py file, a before line 167, can you print the value of the “line” variable and tell us what it is?

Ben Root

···

On Mon, Oct 17, 2011 at 12:57 PM, Rich Shepard <rshepard@…695…> wrote:

After a long hiatus I’m again working on an application and just upgraded

matplotlib from 0.98.5.2 to 0.99.1.2. However, there’s an error on start up

that I need your help in resolving.

There are many dozens of lines containing:

Found an unknown keyword in AFM header (was Underline)

The traceback (in its entirety) shows:

Traceback (most recent call last):

File “./eikos.py”, line 6, in

 from modelPage import modModel

File “/home/rshepard/development/trunk/modelPage.py”, line 8, in

 from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as

FigureCanvas

File

“/usr/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py”,

line 20, in

 from matplotlib.figure import Figure

File “/usr/lib/python2.6/site-packages/matplotlib/figure.py”, line 18, in

 from axes import Axes, SubplotBase, subplot_class_factory

File “/usr/lib/python2.6/site-packages/matplotlib/axes.py”, line 12, in

 import matplotlib.axis as maxis

File “/usr/lib/python2.6/site-packages/matplotlib/axis.py”, line 10, in

 import matplotlib.font_manager as font_manager

File “/usr/lib/python2.6/site-packages/matplotlib/font_manager.py”, line

1301, in

 _rebuild()

File “/usr/lib/python2.6/site-packages/matplotlib/font_manager.py”, line

1292, in _rebuild

 fontManager = FontManager()

File “/usr/lib/python2.6/site-packages/matplotlib/font_manager.py”, line

1010, in init

 self.afmlist = createFontList(self.afmfiles, fontext='afm')

File “/usr/lib/python2.6/site-packages/matplotlib/font_manager.py”, line

578, in createFontList

 font = afm.AFM(fh)

File “/usr/lib/python2.6/site-packages/matplotlib/afm.py”, line 295, in

init

 parse_afm(fh)

File “/usr/lib/python2.6/site-packages/matplotlib/afm.py”, line 283, in

parse_afm

 dcmetrics_ascii, dcmetrics_name = _parse_char_metrics(fh)

File “/usr/lib/python2.6/site-packages/matplotlib/afm.py”, line 167, in

_parse_char_metrics

 name = vals[2].split()[1]

IndexError: list index out of range

Please tell me what I need to do to resolve this error.

Rich

Ben,

   Here are lines 158-167:

     while 1:
         line = fh.readline()
         if not line: break
         line = line.rstrip()
         if line.startswith('EndCharMetrics'): return ascii_d, name_d
         vals = line.split(';')[:4]
         if len(vals) !=4 : raise RuntimeError('Bad char metrics line: %s'
         num = _to_int(vals[0].split()[1])
         wx = _to_float(vals[1].split()[1])
         name = vals[2].split()[1]

Thanks,

Rich

···

On Mon, 17 Oct 2011, Benjamin Root wrote:

In the afm.py file, a before line 167, can you print the value of the
"line" variable and tell us what it is?

Rich,

On line 166, I want you to put “print ‘Line:’, line”. Then, rerun your program and report back what the output of that print statement.

Ben Root

···

On Monday, October 17, 2011, Rich Shepard <rshepard@…695…> wrote:

On Mon, 17 Oct 2011, Benjamin Root wrote:

In the afm.py file, a before line 167, can you print the value of the

“line” variable and tell us what it is?

Ben,

Here are lines 158-167:

while 1:
    line = fh.readline()
    if not line: break
    line = line.rstrip()
    if line.startswith('EndCharMetrics'): return ascii_d, name_d
    vals = line.split(';')[:4]
    if len(vals) !=4 : raise RuntimeError('Bad char metrics line: %s'
    num = _to_int(vals[0].split()[1])
    wx = _to_float(vals[1].split()[1])
    name = vals[2].split()[1]

Thanks,

Rich

Ben,

   Sorry I mis-understood your request.

   I redirected the output to a file 'error.log' and it contains 104,777
lines from the 'print line' command. I can gzip it and send it to you off
the list but it's 5.5M in size.

   When I grep for Underline in error.log it's not found. That seems to be
the unknown keyword.

   How would you like me to proceed?

Thanks,

Rich

···

On Mon, 17 Oct 2011, Benjamin Root wrote:

On line 166, I want you to put "print 'Line:', line". Then, rerun your
program and report back what the output of that print statement.

I only need the last line printed by that print statement. I want to see how the parsing failed.

Ben

···

On Monday, October 17, 2011, Rich Shepard <rshepard@…695…> wrote:

On Mon, 17 Oct 2011, Benjamin Root wrote:

On line 166, I want you to put “print ‘Line:’, line”. Then, rerun your

program and report back what the output of that print statement.

Ben,

Sorry I mis-understood your request.

I redirected the output to a file ‘error.log’ and it contains 104,777

lines from the ‘print line’ command. I can gzip it and send it to you off
the list but it’s 5.5M in size.

When I grep for Underline in error.log it’s not found. That seems to be

the unknown keyword.

How would you like me to proceed?

Thanks,

Rich

Ben,

   Here are the last 3:

Line: C 125 ; WX 273 ; N braceright ; B 55 -68 244 707 ;
Line: C 126 ; WX 586 ; N asciitilde ; B 39 219 531 408 ;
Line: C 127 ; WX 262 ; N ; B 64 506 246 730 ;

   I see there's no character in the last line. Isn't that interesting!

Rich

···

On Mon, 17 Oct 2011, Benjamin Root wrote:

I only need the last line printed by that print statement. I want to see
how the parsing failed.

Hi Rich,

After a long hiatus I'm again working on an application and just upgraded
matplotlib from 0.98.5.2 to 0.99.1.2.

Is there a particular reason you just upgraded to a version of
matplotlib that is almost 2 years old now? Matplotlib 1.1.0 was
released a few weeks ago, so it's strange that you did not upgrade to
it, or at least to 1.0.1, which came out in January. I'm not certain
that the issue you're running into has been fixed, but there have
certainly been lots of changes. I also want to make sure that there
isn't some stale pointer to an old version of matplotlib out there -
so can you let us know what procedure you used to do the upgrade?

best,

···

On Mon, Oct 17, 2011 at 10:57 AM, Rich Shepard <rshepard@...695...> wrote:
--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

Paul,

Apparently, a bunch of the back-n-forth between myself and the OR went off-list. The problem is with the AFM font files packaged with mpl. afm.py is doing the correct thing by failing to parse an invalid line. However, I don’t know much about AFM files and where they come from package-wise to know where to file a bug report.

Cheers,
Ben Root

···

On Friday, October 21, 2011, Paul Ivanov <pivanov314@…287…> wrote:

Hi Rich,

On Mon, Oct 17, 2011 at 10:57 AM, Rich Shepard <rshepard@…695…> wrote:

After a long hiatus I’m again working on an application and just upgraded
matplotlib from 0.98.5.2 to 0.99.1.2.

Is there a particular reason you just upgraded to a version of

matplotlib that is almost 2 years old now? Matplotlib 1.1.0 was
released a few weeks ago, so it’s strange that you did not upgrade to
it, or at least to 1.0.1, which came out in January. I’m not certain

that the issue you’re running into has been fixed, but there have
certainly been lots of changes. I also want to make sure that there
isn’t some stale pointer to an old version of matplotlib out there -

so can you let us know what procedure you used to do the upgrade?

best,

Oops, sorry, I meant to say AFM files not packaged with mpl.

Ben Root

···

On Friday, October 21, 2011, Benjamin Root <ben.root@…1304…> wrote:

On Friday, October 21, 2011, Paul Ivanov <pivanov314@…287…> wrote:

Hi Rich,

On Mon, Oct 17, 2011 at 10:57 AM, Rich Shepard <rshepard@…695…> wrote:

After a long hiatus I’m again working on an application and just upgraded

matplotlib from 0.98.5.2 to 0.99.1.2.

Is there a particular reason you just upgraded to a version of
matplotlib that is almost 2 years old now? Matplotlib 1.1.0 was
released a few weeks ago, so it’s strange that you did not upgrade to

it, or at least to 1.0.1, which came out in January. I’m not certain
that the issue you’re running into has been fixed, but there have
certainly been lots of changes. I also want to make sure that there

isn’t some stale pointer to an old version of matplotlib out there -
so can you let us know what procedure you used to do the upgrade?

best,

Paul,

Apparently, a bunch of the back-n-forth between myself and the OR went off-list. The problem is with the AFM font files packaged with mpl. afm.py is doing the correct thing by failing to parse an invalid line. However, I don’t know much about AFM files and where they come from package-wise to know where to file a bug report.

Cheers,
Ben Root

What's weirder, is that 127 is a control character (Delete), and not
meant to be a printable character.

Maybe you already figured this out in following up with Ben, but if
not, can you 'print fh.name' before the while 1: in
_parse_char_metrics so we find out which .afm file is the culrpit

···

On Mon, Oct 17, 2011 at 3:59 PM, Rich Shepard <rshepard@...695...> wrote:

On Mon, 17 Oct 2011, Benjamin Root wrote:

I only need the last line printed by that print statement. I want to see
how the parsing failed.

Ben,

Here are the last 3:

Line: C 125 ; WX 273 ; N braceright ; B 55 -68 244 707 ;
Line: C 126 ; WX 586 ; N asciitilde ; B 39 219 531 408 ;
Line: C 127 ; WX 262 ; N ; B 64 506 246 730 ;

I see there's no character in the last line. Isn't that interesting!

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

Is there a particular reason you just upgraded to a version of matplotlib
that is almost 2 years old now? Matplotlib 1.1.0 was released a few weeks
ago,

Paul,

   Yes, the reason was 0.99.1.2 was on the SlackBuilds.org site, so I didn't
check to see if it was the current version.

... so it's strange that you did not upgrade to it, or at least to 1.0.1,
which came out in January.

   I just did: 1.1.0 is now installed, but I still have the same problem
trying to run my model.

I'm not certain that the issue you're running into has been fixed, but
there have certainly been lots of changes. I also want to make sure that
there isn't some stale pointer to an old version of matplotlib out there -
so can you let us know what procedure you used to do the upgrade?

   I modified the matplotlib.SlackBuild script to remove the old patch and
the non-existant file names INTERACTIVE and KNOWN_BUGS. It built and
upgraded just fine.

   Ben's been helping by asking for information that might assist in
isolating the source of the problem. Since I am now using version 1.1.0 I'll
resend the error report.

   There are multiple lines reading:

Found an unknown keyword in AFM header (was Underline)

followed by the traceback:

Traceback (most recent call last):
   File "./eikos.py", line 6, in <module>
     from modelPage import modModel
   File "/home/rshepard/development/trunk/modelPage.py", line 9, in <module>
     from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as
FigureCanvas
   File
"/usr/lib/python2.6/site-packages/matplotlib/backends/backend_wxagg.py",
line 20, in <module>
     from matplotlib.figure import Figure
   File "/usr/lib/python2.6/site-packages/matplotlib/figure.py", line 18, in
<module>
     from axes import Axes, SubplotBase, subplot_class_factory
   File "/usr/lib/python2.6/site-packages/matplotlib/axes.py", line 14, in
<module>
     import matplotlib.axis as maxis
   File "/usr/lib/python2.6/site-packages/matplotlib/axis.py", line 10, in
<module>
     import matplotlib.font_manager as font_manager
   File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
1323, in <module>
     _rebuild()
   File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
1273, in _rebuild
     fontManager = FontManager()
   File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
997, in __init__
     self.afmlist = createFontList(self.afmfiles, fontext='afm')
   File "/usr/lib/python2.6/site-packages/matplotlib/font_manager.py", line
559, in createFontList
     font = afm.AFM(fh)
   File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 304, in
__init__
     parse_afm(fh)
   File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 292, in
parse_afm
     dcmetrics_ascii, dcmetrics_name = _parse_char_metrics(fh)
   File "/usr/lib/python2.6/site-packages/matplotlib/afm.py", line 176, in
_parse_char_metrics
     name = vals[2].split()[1]
IndexError: list index out of range

   I will certainly add diagnostic code requested by you, Ben, and anyone
else and report the results when trying to run the model. I do need to fix
this and have no idea what's behind the problem.

Thanks,

Rich

···

On Fri, 21 Oct 2011, Paul Ivanov wrote:

I will certainly add diagnostic code requested by you, Ben, and anyone
else and report the results when trying to run the model. I do need to fix
this and have no idea what's behind the problem.

The traceback is due to a nonprinting character being included in one
of the fonts on your system - we just need to figure out which one.
Change my request to add 'sys.stderr.write(fh.name)' before the 'while
1:' in
_parse_char_metrics - just so we don't have any buffering issues. The
last file you see printed there will be the one that's causing the
issue. You can then try removing it, or sending it back to the list
(or both) so we can see what happened.

The other issue you're seeing ("unknown keyword in AFM header") is
also likely caused by bad font files.

From your error log that Ben forwarded to the list - I'm a bit

suspicious that two of the errors came from an afm file that ships
with matplotlib, in particular matplotlib-error-trace.txt starts off
with:

  FILENAME:
  /usr/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/afm/pagko8a.afm
  Found an unknown keyword in AFM header (was Underline)
  Found an unknown keyword in AFM header (was Underline)

This shouldn't be the case, as I can verify that the keywords aren't
just Underline - they are as follows:

  $ grep Under matplotlib/mpl-data/fonts/afm/pagko8a.afm
  UnderlinePosition -100
  UnderlineThickness 50

and that particular file has not been change in matplotlib since
February of 2007

So my wild guess is that something changed your afm files. Can you
check that your pagko8a.afm matches the one in
https://raw.github.com/matplotlib/matplotlib/master/lib/matplotlib/mpl-data/fonts/afm/pagko8a.afm
- and if they don't match, check that using the original pagko8a.afm
makes at least that error go away?

As another possible solution (maybe this is already done, but worth a
potshot), you could try switching USE_FONTCONFIG to True in
font_manager.py as per the docstring there:

Experimental support is included for using `fontconfig` on Unix
variant platforms (Linux, OS X, Solaris). To enable it, set the
constant ``USE_FONTCONFIG`` in this file to ``True``. Fontconfig has
the advantage that it is the standard way to look up fonts on X11
platforms, so if a font is installed, it is much more likely to be
found.)

best,

···

On Sat, Oct 22, 2011 at 7:54 AM, Rich Shepard <rshepard@...695...> wrote:

On Fri, 21 Oct 2011, Paul Ivanov wrote:

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

Paul,

   The last file printed before the traceback is
/usr/share/fonts/atmfonts/kidsm.afm. When I mv that to Xkidsn.afm it still
shows up. I'm also seeing the same error in a number of other atmfonts. Some
in /usr/X11/lib/X11/fonts/atmfonts, which is a soft link to
/usr/share/fonts/atmfonts, and other errors in the soft links in
~/.fonts/atmfonts.

   Would you like a copy of kidsn.afm?

Thanks,

Rich

···

On Sun, 23 Oct 2011, Paul Ivanov wrote:

Change my request to add 'sys.stderr.write(fh.name)' before the 'while 1:'
in _parse_char_metrics - just so we don't have any buffering issues. The
last file you see printed there will be the one that's causing the issue.
You can then try removing it, or sending it back to the list (or both) so
we can see what happened.

sure. let's take a look.

What about the .afm that ships with matplotlib which also caused
problems - did you verify that the one you have is the same as the one
under version control in matplotlib?

···

On Mon, Oct 24, 2011 at 6:35 AM, Rich Shepard <rshepard@...695...> wrote:

Would you like a copy of kidsn.afm?

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

Would you like a copy of kidsn.afm?

sure. let's take a look.

StartFontMetrics 2.0
Comment Kids-Normal
Comment Copyright (c) 1992 Corel Corporation. All Rights Reserved.
Comment Creation Date: Mon Jun 15 12:00:00 1992
Comment UniqueID 5029202
Comment VMUsage 20000 20000
FontName Kids-Normal
FullName Kids Normal
FamilyName Kids
Weight Normal
ItalicAngle 0
IsFixedPitch false
FontBBox -188 -268 1227 980
Underline Position -100
Underline Thickness 50
Version 001.00
Notice Copyright (c) 1992 Corel Corporation. All Rights Reserved.
EncodingScheme StandardEncoding
CapHeight 811
XHeight 590
Ascender 742
Descender -193
StartCharMetrics 210
C 32 ; WX 225 ; N space ; B 0 0 0 0 ;
C 33 ; WX 225 ; N exclam ; B 53 0 207 752 ;
C 34 ; WX 262 ; N quotedbl ; B 64 506 246 730 ;
C 35 ; WX 773 ; N numbersign ; B 6 14 715 752 ;
C 36 ; WX 631 ; N dollar ; B -21 -94 537 824 ;
C 37 ; WX 807 ; N percent ; B 31 -27 746 756 ;
C 38 ; WX 770 ; N ampersand ; B 10 -68 709 777 ;
C 39 ; WX 270 ; N quoteright ; B 57 436 240 760 ;
C 40 ; WX 383 ; N parenleft ; B 55 -123 328 746 ;
C 41 ; WX 391 ; N parenright ; B 0 -145 287 725 ;
C 42 ; WX 348 ; N asterisk ; B 68 469 326 740 ;
C 43 ; WX 615 ; N plus ; B 41 43 559 547 ;
C 44 ; WX 270 ; N comma ; B 72 -166 225 111 ;
C 45 ; WX 305 ; N hyphen ; B 25 264 277 344 ;
C 46 ; WX 199 ; N period ; B 88 -47 213 107 ;
C 47 ; WX 363 ; N slash ; B 47 -115 324 727 ;
C 48 ; WX 588 ; N zero ; B -8 8 535 721 ;
C 49 ; WX 297 ; N one ; B 137 16 270 764 ;
C 50 ; WX 633 ; N two ; B 18 -20 561 742 ;
C 51 ; WX 492 ; N three ; B 43 -21 439 695 ;
C 52 ; WX 537 ; N four ; B 6 10 496 721 ;
C 53 ; WX 625 ; N five ; B 0 8 557 814 ;
C 54 ; WX 604 ; N six ; B 16 -6 529 742 ;
C 55 ; WX 494 ; N seven ; B 64 -8 459 746 ;
C 56 ; WX 605 ; N eight ; B 61 -14 533 758 ;
C 57 ; WX 549 ; N nine ; B 29 -90 508 760 ;
C 58 ; WX 186 ; N colon ; B 88 -47 232 525 ;
C 59 ; WX 229 ; N semicolon ; B 72 -166 232 525 ;
C 60 ; WX 605 ; N less ; B 37 6 551 555 ;
C 61 ; WX 574 ; N equal ; B 59 164 533 441 ;
C 62 ; WX 582 ; N greater ; B 33 23 547 568 ;
C 63 ; WX 582 ; N question ; B 66 -47 555 744 ;
C 64 ; WX 1033 ; N at ; B 20 -6 887 787 ;
C 65 ; WX 799 ; N A ; B 27 10 730 742 ;
C 66 ; WX 664 ; N B ; B 27 -47 551 744 ;
C 67 ; WX 795 ; N C ; B 27 -25 717 773 ;
C 68 ; WX 816 ; N D ; B -2 -49 703 764 ;
C 69 ; WX 549 ; N E ; B 45 -86 508 715 ;
C 70 ; WX 563 ; N F ; B 51 -21 516 773 ;
C 71 ; WX 916 ; N G ; B 20 0 807 795 ;
C 72 ; WX 768 ; N H ; B -16 -33 672 811 ;
C 73 ; WX 496 ; N I ; B -88 -6 342 738 ;
C 74 ; WX 453 ; N J ; B -4 4 408 766 ;
C 75 ; WX 607 ; N K ; B 51 -84 541 717 ;
C 76 ; WX 535 ; N L ; B 25 -8 494 717 ;
C 77 ; WX 869 ; N M ; B 66 -105 813 787 ;
C 78 ; WX 766 ; N N ; B 59 8 729 799 ;
C 79 ; WX 844 ; N O ; B 33 23 783 830 ;
C 80 ; WX 580 ; N P ; B -21 -12 504 777 ;
C 81 ; WX 895 ; N Q ; B 20 -68 803 740 ;
C 82 ; WX 586 ; N R ; B 35 -37 549 764 ;
C 83 ; WX 635 ; N S ; B -41 -12 533 770 ;
C 84 ; WX 605 ; N T ; B -45 27 482 836 ;
C 85 ; WX 631 ; N U ; B 23 -20 596 797 ;
C 86 ; WX 732 ; N V ; B 25 -18 678 734 ;
C 87 ; WX 947 ; N W ; B 12 -37 877 725 ;
C 88 ; WX 656 ; N X ; B 0 -72 588 740 ;
C 89 ; WX 596 ; N Y ; B 43 0 545 762 ;
C 90 ; WX 713 ; N Z ; B -49 6 594 750 ;
C 91 ; WX 430 ; N bracketleft ; B 47 -107 395 760 ;
C 92 ; WX 527 ; N backslash ; B 98 -18 484 768 ;
C 93 ; WX 342 ; N bracketright ; B -23 -123 271 756 ;
C 94 ; WX 574 ; N asciicircum ; B 16 293 535 775 ;
C 95 ; WX 590 ; N underscore ; B -27 -127 514 -25 ;
C 96 ; WX 262 ; N quoteleft ; B 45 434 229 760 ;
C 97 ; WX 684 ; N a ; B 31 -43 633 539 ;
C 98 ; WX 711 ; N b ; B 0 0 629 879 ;
C 99 ; WX 771 ; N c ; B 21 -23 676 576 ;
C 100 ; WX 672 ; N d ; B 59 29 631 826 ;
C 101 ; WX 688 ; N e ; B 25 -63 629 559 ;
C 102 ; WX 416 ; N f ; B 6 -35 363 779 ;
C 103 ; WX 658 ; N g ; B 25 -213 607 650 ;
C 104 ; WX 604 ; N h ; B 23 6 549 799 ;
C 105 ; WX 193 ; N i ; B 10 43 174 773 ;
C 106 ; WX 424 ; N j ; B -104 -201 238 758 ;
C 107 ; WX 521 ; N k ; B 47 -4 473 775 ;
C 108 ; WX 230 ; N l ; B 49 4 211 764 ;
C 109 ; WX 949 ; N m ; B 10 23 875 600 ;
C 110 ; WX 627 ; N n ; B 10 0 553 557 ;
C 111 ; WX 688 ; N o ; B 39 -4 615 555 ;
C 112 ; WX 660 ; N p ; B 27 -203 617 561 ;
C 113 ; WX 742 ; N q ; B 92 -229 693 549 ;
C 114 ; WX 400 ; N r ; B 33 2 367 586 ;
C 115 ; WX 500 ; N s ; B -47 -14 406 580 ;
C 116 ; WX 406 ; N t ; B -14 37 352 809 ;
C 117 ; WX 570 ; N u ; B 72 -51 541 566 ;
C 118 ; WX 605 ; N v ; B -4 -14 543 574 ;
C 119 ; WX 896 ; N w ; B 16 -18 832 582 ;
C 120 ; WX 525 ; N x ; B 27 49 480 590 ;
C 121 ; WX 578 ; N y ; B 12 -193 520 547 ;
C 122 ; WX 561 ; N z ; B -63 -47 443 553 ;
C 123 ; WX 303 ; N braceleft ; B 20 -63 264 760 ;
C 124 ; WX 393 ; N bar ; B 277 -45 375 693 ;
C 125 ; WX 273 ; N braceright ; B 55 -68 244 707 ;
C 126 ; WX 586 ; N asciitilde ; B 39 219 531 408 ;
C 127 ; WX 262 ; N ; B 64 506 246 730 ;
C 128 ; WX 324 ; N grave ; B 63 615 301 785 ;
C 129 ; WX 475 ; N circumflex ; B 92 607 438 750 ;
C 130 ; WX 393 ; N tilde ; B 68 617 361 723 ;
C 131 ; WX 193 ; N dotlessi ; B 10 43 172 572 ;
C 132 ; WX 592 ; N florin ; B 111 -186 547 779 ;
C 133 ; WX 418 ; N quotedblleft ; B -14 463 326 773 ;
C 134 ; WX 424 ; N quotedblright ; B 63 479 404 789 ;
C 135 ; WX 223 ; N guilsinglleft ; B 8 129 195 480 ;
C 136 ; WX 238 ; N guilsinglright ; B 29 137 221 490 ;
C 137 ; WX 518 ; N fi ; B 4 10 467 758 ;
C 138 ; WX 541 ; N fl ; B 4 4 490 764 ;
C 139 ; WX 518 ; N dagger ; B 29 -121 477 748 ;
C 140 ; WX 518 ; N daggerdbl ; B 29 -121 477 748 ;
C 141 ; WX 594 ; N endash ; B -12 227 516 361 ;
C 142 ; WX 232 ; N bullet ; B 111 145 457 498 ;
C 143 ; WX 455 ; N breve ; B 66 637 408 801 ;
C 144 ; WX 441 ; N quotedblbase ; B 72 -168 418 143 ;
C 145 ; WX 914 ; N ellipsis ; B 94 -2 857 143 ;
C 146 ; WX 1326 ; N perthousand ; B 45 -14 1227 768 ;
C 147 ; WX 953 ; N trademark ; B 84 305 900 791 ;
C 161 ; WX 240 ; N exclamdown ; B 59 -150 221 625 ;
C 162 ; WX 535 ; N cent ; B 25 18 488 693 ;
C 163 ; WX 656 ; N sterling ; B -16 8 557 750 ;
C 164 ; WX 650 ; N currency ; B 18 78 586 688 ;
C 165 ; WX 580 ; N yen ; B 39 0 545 773 ;
C 166 ; WX 406 ; N brokenbar ; B 275 -8 389 736 ;
C 167 ; WX 635 ; N section ; B 12 -137 576 801 ;
C 168 ; WX 457 ; N dieresis ; B 68 600 422 760 ;
C 169 ; WX 949 ; N copyright ; B 0 41 766 822 ;
C 170 ; WX 365 ; N ordfeminine ; B 14 311 338 771 ;
C 171 ; WX 445 ; N guillemotleft ; B 4 137 406 488 ;
C 172 ; WX 666 ; N logicalnot ; B 23 152 625 475 ;
C 173 ; WX 1010 ; N emdash ; B 47 232 943 402 ;
C 174 ; WX 949 ; N registered ; B 0 -20 766 762 ;
C 176 ; WX 311 ; N ring ; B 68 615 275 832 ;
C 177 ; WX 586 ; N plusminus ; B 12 -21 539 646 ;
C 178 ; WX 342 ; N twosuperior ; B 8 420 309 813 ;
C 179 ; WX 316 ; N threesuperior ; B 21 477 281 875 ;
C 180 ; WX 330 ; N acute ; B 78 619 297 775 ;
C 181 ; WX 568 ; N mu ; B 47 -225 537 535 ;
C 182 ; WX 662 ; N paragraph ; B 20 -117 621 781 ;
C 183 ; WX 523 ; N periodcentered ; B 64 234 207 389 ;
C 184 ; WX 266 ; N cedilla ; B 55 -268 252 6 ;
C 185 ; WX 223 ; N onesuperior ; B 109 498 201 875 ;
C 186 ; WX 396 ; N ordmasculine ; B 25 318 346 770 ;
C 187 ; WX 484 ; N guillemotright ; B 21 164 449 500 ;
C 188 ; WX 822 ; N onequarter ; B 105 -43 771 730 ;
C 189 ; WX 836 ; N onehalf ; B 117 -12 783 760 ;
C 190 ; WX 799 ; N threequarters ; B 21 -25 752 754 ;
C 191 ; WX 568 ; N questiondown ; B 45 -227 533 564 ;
C 192 ; WX 799 ; N Agrave ; B -156 5 374 380 ;
C 193 ; WX 799 ; N Aacute ; B -151 5 374 380 ;
C 194 ; WX 799 ; N Acircumflex ; B -101 5 374 380 ;
C 195 ; WX 799 ; N Atilde ; B -111 5 374 380 ;
C 196 ; WX 799 ; N Adieresis ; B -82 5 374 380 ;
C 197 ; WX 799 ; N Aring ; B -153 5 374 380 ;
C 198 ; WX 967 ; N AE ; B 90 -29 902 777 ;
C 199 ; WX 824 ; N Ccedilla ; B 27 -219 742 773 ;
C 200 ; WX 549 ; N Egrave ; B -101 -44 260 366 ;
C 201 ; WX 549 ; N Eacute ; B -52 -44 260 366 ;
C 202 ; WX 549 ; N Ecircumflex ; B 2 -44 260 366 ;
C 203 ; WX 549 ; N Edieresis ; B -10 -44 260 366 ;
C 204 ; WX 496 ; N Igrave ; B -45 -3 218 378 ;
C 205 ; WX 496 ; N Iacute ; B -45 -3 216 378 ;
C 206 ; WX 496 ; N Icircumflex ; B -45 -3 351 378 ;
C 207 ; WX 496 ; N Idieresis ; B -45 -3 329 378 ;
C 208 ; WX 816 ; N Eth ; B -2 -49 703 764 ;
C 209 ; WX 766 ; N Ntilde ; B -35 -21 693 914 ;
C 210 ; WX 844 ; N Ograve ; B 16 -53 799 977 ;
C 211 ; WX 844 ; N Oacute ; B 16 -53 799 967 ;
C 212 ; WX 844 ; N Ocircumflex ; B 16 -53 799 951 ;
C 213 ; WX 844 ; N Otilde ; B 16 -53 799 924 ;
C 214 ; WX 844 ; N Odieresis ; B 16 -53 799 941 ;
C 215 ; WX 1178 ; N OE ; B 6 -14 1100 807 ;
C 216 ; WX 826 ; N Oslash ; B 47 -33 783 848 ;
C 217 ; WX 631 ; N Ugrave ; B 16 -72 611 969 ;
C 218 ; WX 631 ; N Uacute ; B 16 -72 611 957 ;
C 219 ; WX 660 ; N Ucircumflex ; B 16 -72 611 932 ;
C 220 ; WX 631 ; N Udieresis ; B 12 -10 305 408 ;
C 221 ; WX 596 ; N Yacute ; B -181 0 279 390 ;
C 222 ; WX 584 ; N Thorn ; B -33 4 504 941 ;
C 223 ; WX 678 ; N germandbls ; B 70 -68 615 775 ;
C 224 ; WX 684 ; N agrave ; B 0 -10 633 775 ;
C 225 ; WX 699 ; N aacute ; B 0 -4 633 771 ;
C 226 ; WX 682 ; N acircumflex ; B 10 -27 643 748 ;
C 227 ; WX 682 ; N atilde ; B 10 -27 643 721 ;
C 228 ; WX 682 ; N adieresis ; B 10 -27 643 758 ;
C 229 ; WX 682 ; N aring ; B 10 -33 643 799 ;
C 230 ; WX 1121 ; N ae ; B 33 -25 1055 574 ;
C 231 ; WX 754 ; N ccedilla ; B 25 -223 658 582 ;
C 232 ; WX 684 ; N egrave ; B 10 -47 639 775 ;
C 233 ; WX 684 ; N eacute ; B 10 -47 639 766 ;
C 234 ; WX 684 ; N ecircumflex ; B 10 -47 639 730 ;
C 235 ; WX 684 ; N edieresis ; B 10 -47 639 740 ;
C 236 ; WX 412 ; N igrave ; B -86 -25 215 760 ;
C 237 ; WX 395 ; N iacute ; B -104 -21 193 785 ;
C 238 ; WX 557 ; N icircumflex ; B -188 -21 250 744 ;
C 239 ; WX 551 ; N idieresis ; B -156 -21 266 766 ;
C 240 ; WX 824 ; N eth ; B 39 12 768 826 ;
C 241 ; WX 619 ; N ntilde ; B 16 -21 568 709 ;
C 242 ; WX 703 ; N ograve ; B 16 -35 631 750 ;
C 243 ; WX 703 ; N oacute ; B 16 -25 631 766 ;
C 244 ; WX 725 ; N ocircumflex ; B 16 -25 631 734 ;
C 245 ; WX 703 ; N otilde ; B 16 -39 631 684 ;
C 246 ; WX 703 ; N odieresis ; B 16 -39 631 721 ;
C 247 ; WX 1119 ; N oe ; B 43 -29 1047 549 ;
C 248 ; WX 639 ; N oslash ; B 33 -21 605 615 ;
C 249 ; WX 600 ; N ugrave ; B 16 -72 557 771 ;
C 250 ; WX 600 ; N uacute ; B 16 -72 557 770 ;
C 251 ; WX 600 ; N ucircumflex ; B 16 -72 557 744 ;
C 252 ; WX 600 ; N udieresis ; B 16 -72 557 729 ;
C 253 ; WX 602 ; N yacute ; B 16 -215 535 641 ;
C 254 ; WX 691 ; N thorn ; B 49 -205 648 703 ;
C 255 ; WX 578 ; N ydieresis ; B 6 -99 266 416 ;
EndCharMetrics
StartKernData
StartKernPairs 0
EndKernPairs
EndKernData
StartComposites 0
EndComposites
EndFontMetrics

What about the .afm that ships with matplotlib which also caused problems
- did you verify that the one you have is the same as the one under
version control in matplotlib?

   Well, the source file came from the matplotlib Web site, so I assume that
it/they are OK. The SlackBuild script essentially re-packages the download
as a Slackware package so it can be managed more easily and consistently
with other packages.

Rich

···

On Mon, 24 Oct 2011, Paul Ivanov wrote:

Underline Position -100
Underline Thickness 50

those two properties should not have spaces in them - according the
the AFM file spec that I could find - they should be one word - which
is what matplotlib expects - and this is the source of all of the
"'Found an unknown keyword in AFM header (was Underline)" warning that
you saw.

C 127 ; WX 262 ; N ; B 64 506 246 730 ;

I still find it strange that this character is even in the font file
- maybe it had a value other than just space, but copy pasting made it
appear as such? Please resend the file as an attachement so we can
verify.

In the meantime - this patch should get around trying to parse any
such files without causing tracebacks

in lib/matplotlib/afm.py, after the line that says 'if
line.startswith('Comment'): continue' add another line that says 'if
line.startswith('C 127'): continue'

What about the .afm that ships with matplotlib which also caused problems
- did you verify that the one you have is the same as the one under
version control in matplotlib?

Well, the source file came from the matplotlib Web site, so I assume that
it/they are OK. The SlackBuild script essentially re-packages the download
as a Slackware package so it can be managed more easily and consistently
with other packages.

If this was really the case, we should not have been seeing "Found an
unknown keyword in AFM header (was Underline)" for the afm files that
ship with matplotlib (but we were on your machine - so something
changed them).

Please diff your pagko8a.afm against
https://raw.github.com/matplotlib/matplotlib/master/lib/matplotlib/mpl-data/fonts/afm/pagko8a.afm

best,

···

On Mon, Oct 24, 2011 at 2:47 PM, Rich Shepard <rshepard@...695...> wrote:
--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

those two properties should not have spaces in them - according the the
AFM file spec that I could find - they should be one word - which is what
matplotlib expects - and this is the source of all of the "'Found an
unknown keyword in AFM header (was Underline)" warning that you saw.

Paul,

   That specific font is apparently kid oriented (not surprising as it comes
from Corel a long time ago). I can delete it and never miss it.

C 127 ; WX 262 ; N ; B 64 506 246 730 ;

I still find it strange that this character is even in the font file
- maybe it had a value other than just space, but copy pasting made it
appear as such? Please resend the file as an attachement so we can
verify.

In the meantime - this patch should get around trying to parse any
such files without causing tracebacks

in lib/matplotlib/afm.py, after the line that says 'if
line.startswith('Comment'): continue' add another line that says 'if
line.startswith('C 127'): continue'

   OK. Done.

If this was really the case, we should not have been seeing "Found an
unknown keyword in AFM header (was Underline)" for the afm files that
ship with matplotlib (but we were on your machine - so something
changed them).

Please diff your pagko8a.afm against
https://raw.github.com/matplotlib/matplotlib/master/lib/matplotlib/mpl-data/fonts/afm/pagko8a.afm

   There's no difference between
/usr/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/afm/pagko8a.afm
and the pagko8a.afm I downloaded from github.

Thanks,

Rich

···

On Mon, 24 Oct 2011, Paul Ivanov wrote:

those two properties should not have spaces in them - according the the
AFM file spec that I could find - they should be one word - which is what
matplotlib expects - and this is the source of all of the "'Found an
unknown keyword in AFM header (was Underline)" warning that you saw.

Paul,

That specific font is apparently kid oriented (not surprising as it comes
from Corel a long time ago). I can delete it and never miss it.

Ok - strange that we saw a lot of errors caused by probably the same
deviation from the AFM standard in several other files as indnicated
by the error file Ben posted earlier in this thread.

C 127 ; WX 262 ; N ; B 64 506 246 730 ;

I still find it strange that this character is even in the font file
- maybe it had a value other than just space, but copy pasting made it
appear as such? Please resend the file as an attachement so we can
verify.

In the meantime - this patch should get around trying to parse any
such files without causing tracebacks

in lib/matplotlib/afm.py, after the line that says 'if
line.startswith('Comment'): continue' add another line that says 'if
line.startswith('C 127'): continue'

OK. Done.

so no more tracebacks?

If this was really the case, we should not have been seeing "Found an
unknown keyword in AFM header (was Underline)" for the afm files that
ship with matplotlib (but we were on your machine - so something
changed them).

Please diff your pagko8a.afm against
https://raw.github.com/matplotlib/matplotlib/master/lib/matplotlib/mpl-data/fonts/afm/pagko8a.afm

There's no difference between
/usr/lib/python2.6/site-packages/matplotlib/mpl-data/fonts/afm/pagko8a.afm
and the pagko8a.afm I downloaded from github.

Well, that's a mystery... why did you previously see a "Found an
unknown keyword in AFM header (was Underline)" message for it...

···

On Mon, Oct 24, 2011 at 3:26 PM, Rich Shepard <rshepard@...695...> wrote:

On Mon, 24 Oct 2011, Paul Ivanov wrote:

--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

so no more tracebacks?

   Don't know. I'm processing accounts payable, beating up a client who's
late paying an invoice, trying to figure out which R package/function I
need, and more. It's been a rather crappy day, if you must know the truth.
:slight_smile:

   I'll try again tomorrow morning before I head to the dentist.

Well, that's a mystery... why did you previously see a "Found an unknown
keyword in AFM header (was Underline)" message for it...

   You ask moi? I've no idea at all! That's why I count on you experts to
tell me why. :slight_smile:

Thanks much, Paul,

Rich

···

On Mon, 24 Oct 2011, Paul Ivanov wrote: