Error in OS/2 table of mona.ttf

Bug #223884 reported by Pander
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fonttools (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: ttf-mona

Dumpint OS/2 table of mona.ttf results in the following error:

$ ttx -d . -t OS/2 /usr/share/fonts/truetype/mona/mona.ttf
Dumping "/usr/share/fonts/truetype/mona/mona.ttf" to "./mona#5.ttx"...
Traceback (most recent call last):
  File "/usr/bin/ttx", line 11, in <module>
    ttx.main(sys.argv[1:])
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 292, in main
    process(jobs, options)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 277, in process
    action(input, output, options)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 170, in ttDump
    disassembleInstructions=options.disassembleInstructions)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/__init__.py", line 262, in saveXML
    self._tableToXML(tableWriter, tag, progress)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/__init__.py", line 277, in _tableToXML
    table = self[tag]
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/__init__.py", line 367, in __getitem__
    table.decompile(data, self)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/tables/O_S_2f_2.py", line 103, in decompile
    sstruct.unpack2(OS2_format_2_addition, data, self)
  File "/usr/lib/python2.5/site-packages/FontTools/sstruct.py", line 97, in unpack2
    return unpack(format, data[:length], object), data[length:]
  File "/usr/lib/python2.5/site-packages/FontTools/sstruct.py", line 85, in unpack
    elements = struct.unpack(formatstring, data)
  File "/usr/lib/python2.5/struct.py", line 87, in unpack
    return o.unpack(s)
struct.error: unpack requires a string argument of length 18
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 78, in apport_excepthook
    report_file = open(pr_filename, 'wt')
IOError: [Errno 13] Permission denied: '/var/crash/_usr_bin_ttx.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/ttx", line 11, in <module>
    ttx.main(sys.argv[1:])
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 292, in main
    process(jobs, options)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 277, in process
    action(input, output, options)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 170, in ttDump
    disassembleInstructions=options.disassembleInstructions)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/__init__.py", line 262, in saveXML
    self._tableToXML(tableWriter, tag, progress)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/__init__.py", line 277, in _tableToXML
    table = self[tag]
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/__init__.py", line 367, in __getitem__
    table.decompile(data, self)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/tables/O_S_2f_2.py", line 103, in decompile
    sstruct.unpack2(OS2_format_2_addition, data, self)
  File "/usr/lib/python2.5/site-packages/FontTools/sstruct.py", line 97, in unpack2
    return unpack(format, data[:length], object), data[length:]
  File "/usr/lib/python2.5/site-packages/FontTools/sstruct.py", line 85, in unpack
    elements = struct.unpack(formatstring, data)
  File "/usr/lib/python2.5/struct.py", line 87, in unpack
    return o.unpack(s)
struct.error: unpack requires a string argument of length 18

Please fix the OS/2 table of mona.ttf so that ttx is able to dump it and also other applications can access this data without errors.

Revision history for this message
Pander (pander) wrote :

also these errors occur:
$ ttx -d /tmp /usr/share/fonts/truetype/mona/mona.ttf
Dumping "/usr/share/fonts/truetype/mona/mona.ttf" to "/tmp/mona#4.ttx"...
Dumping 'GlyphOrder' table...
Dumping 'head' table...
Dumping 'hhea' table...
Dumping 'maxp' table...
An exception occurred during the decompilation of the 'OS/2' table
Dumping 'OS/2' table...
An exception occurred during the decompilation of the 'hmtx' table
Dumping 'hmtx' table...
Dumping 'cmap' table...
Dumping 'fpgm' table...
Dumping 'cvt ' table...
An exception occurred during the decompilation of the 'loca' table
Dumping 'loca' table...
An exception occurred during the decompilation of the 'glyf' table
Dumping 'glyf' table...
Traceback (most recent call last):
  File "/usr/bin/ttx", line 11, in <module>
    ttx.main(sys.argv[1:])
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 289, in main
    process(jobs, options)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 274, in process
    action(input, output, options)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttx.py", line 171, in ttDump
    disassembleInstructions=options.disassembleInstructions)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/__init__.py", line 267, in saveXML
    self._tableToXML(tableWriter, tag, progress)
  File "/usr/lib/python2.5/site-packages/FontTools/fontTools/ttLib/__init__.py", line 301, in _tableToXML
    table.toXML(writer, self, progress)
TypeError: toXML() takes exactly 3 arguments (4 given)

Paul Sladen (sladen)
affects: xfonts-mona (Ubuntu) → fonttools (Ubuntu)
Revision history for this message
Paul Wise (Debian) (pabs) wrote :

mona.ttf is a very buggy font. I've worked around the issues it has in the OS/2 and loca/glyf tables, moving on to the hmtx crash.

tags: added: fix-in-progress-upstream
tags: added: fixed-upstream
removed: fix-in-progress-upstream
Changed in fonttools (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fonttools - 2.4-1

---------------
fonttools (2.4-1) unstable; urgency=low

  * New upstream release
    - Fixes error in OS/2 table of mona.ttf (LP: #223884)
  * Switch to dh_python2
  * Switch to debhelper 9
  * Bump Standards-Version, no changes needed
  * Drop unneeded postinst
  * Improve the watch file
  * Adjust download location
  * Add a file with upstream info

 -- Paul Wise <email address hidden> Sat, 22 Jun 2013 23:48:19 +0800

Changed in fonttools (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.