bohoomil / fontconfig-ultimate

freetype2-infinality run-time settings => infinality compatible fontconfig => infinality-bundle
453 stars 38 forks source link

Floating point numbers in AFM files have commas as decimal separators #69

Closed elpres closed 9 years ago

elpres commented 9 years ago

I'm using DejaVu fonts from the infinality-bundle-fonts repo on Arch, and they cause Matplotlib (a Python plotting library) to show this error for each file:

Value error parsing header in AFM: UnderlinePosition -41,5039
Value error parsing header in AFM: UnderlineThickness 43,9453

This problem has been reported to the Matplotlib issue tracker (https://github.com/matplotlib/matplotlib/pull/2497), but seems to be caused by the way floats are stored in AFM files. Apparently, the AFM spec calls for dots as decimal separators, and the DejaVu fonts have commas instead:

A number can be either a real number or an integer, and signed or unsigned, that is, it may or may not contain a decimal point or a leading minus sign

bohoomil commented 9 years ago

If this is a problem with fonts, you should report it to the upstream: www.ctan.org.

elpres commented 9 years ago

True, the files in CTAN have the same "feature". Thanks for the pointer, I'll contact the maintainer there.