Bug 881859 - Crash while generating font metrics files
Summary: Crash while generating font metrics files
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: fop
Version: 23
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Ruediger Landmann
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 885471
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-29 17:24 UTC by info@kobaltwit.be
Modified: 2016-12-20 12:31 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-12-20 12:31:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description info@kobaltwit.be 2012-11-29 17:24:18 UTC
Description of problem:
We use fop to generate pdf files for the GnuCash documentation. For the Japanese translation we require some Japanese fonts (obviously). It was chosen to use the IPAex fonts for this which can be downloaded from http://ossipedia.ipa.go.jp/ipafont/index.html
In order to use this, a metrics file has to be generated.

The original build script was written by someone on Ubuntu, which ships a small tool called fop-ttfreader. This is a wrapper around fop that calls the TTFReader method to generate the proper metrics files.

fop-ttfreader is not available on Fedora, but since it's only a wrapper, I decided to call the TTFReader method directly to test.

Unfortunately this results in a crash.

Version-Release number of selected component (if applicable):
fop-1.0-20.fc16

How reproducible:
Always

Steps to Reproduce:
1. Install fop-1.0-20.fc16
2. Download the ipa fonts from the link above. I'm using the separate ttf file versions, not the ttc collection.
3. From within the directory with the ttf files run:
java -cp /usr/share/java/fop.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/commons-logging.jar:/usr/share/java/commons-io.jar:/usr/share/java/xmlgraphics-commons.jar \
   org.apache.fop.fonts.apps.TTFReader \
   /home/janssege/Downloads/IPAexfont00201/ipaexm.ttf ipaexm.xml
  
Actual results:
This invocation crashes with the following error:

TTF Reader for Apache FOP SVN tags/fop-1_0

Parsing font...
Reading /home/janssege/Downloads/IPAexfont00201/ipaexm.ttf...
Error while building XML font metrics file.
java.lang.ArrayIndexOutOfBoundsException: 12244

Expected results:
Properly generate the metrics xml file

Additional info:
When run with the debug option (-d), like so:
java -cp /usr/share/java/fop.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/commons-logging.jar:/usr/share/java/commons-io.jar:/usr/share/java/xmlgraphics-commons.jar \
   org.apache.fop.fonts.apps.TTFReader -d \
   ipaexm.ttf ipaexm.xml

Some more output is generated. I don't know if this can be useful:

TTF Reader for Apache FOP SVN tags/fop-1_0

Parsing font...
Reading ipaexm.ttf...
sfnt version: OpenType 1.0
Reading 20 dir tables
dir tables: [loca, post, glyf, fpgm, hmtx, GPOS, vhea, hhea, prep, GSUB, BASE, GDEF, cvt , gasp, name, OS/2, cmap, vmtx, head, maxp]
flags: 15 - 1111
unit per em: 2048
font bbox: xMin=-539 yMin=-571 xMax=2048 yMax=1876
Number of glyphs in font: 12238
hhea.Ascender: 1802 -> 879 internal units
hhea.Descender: -246 -> -120 internal units
Number of horizontal metrics: 12218
PostScript format: 0x20000
PostScript format 2
Reading 12237 glyphnames, that are not in the standard Macintosh set. Total number of glyphs=12238
Error while building XML font metrics file.
java.lang.ArrayIndexOutOfBoundsException: 12244
        at org.apache.fop.fonts.truetype.TTFFile.readPostScript(TTFFile.java:1028)
        at org.apache.fop.fonts.truetype.TTFFile.readFont(TTFFile.java:542)
        at org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:209)
        at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:164)

Comment 1 eric 2012-12-09 17:07:09 UTC
I don't believe TTF fonts are supported in fop 1.0.  Version 1.1 says "Adds support for TTF fonts in PostScript." so I'm going to try to ship 1.1 and see if this fixes your problem.

Comment 2 Fedora End Of Life 2013-01-16 17:04:52 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 3 Fedora End Of Life 2013-02-13 21:26:38 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 info@kobaltwit.be 2013-02-16 13:42:49 UTC
Meanwhile I have updated to Fedora 18, fop-1.0-20.fc18.noarch

The crash is still happening unfortunately, so I reopen this bug.

Comment 5 info@kobaltwit.be 2013-05-31 12:18:35 UTC
It appears Fop 1.1 has been added to F19. Any chance of a backport to F18 ?

Thanks

Comment 6 info@kobaltwit.be 2013-08-29 14:17:55 UTC
My main system is Fedora 19 (x86_64) now and I tried this again with fop 1.1: it fails with the same error.

Too bad, because this is causing me headaches for the GnuCash project...

Comment 7 Derek Atkins 2014-01-13 18:13:11 UTC
FYI, I just tried this on Fedora 20, which includes the fonts as RPM packages but I still get an error:

bash-4.2$ java -cp /usr/share/java/fop.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/commons-logging.jar:/usr/share/java/commons-io.jar:/usr/share/java/xmlgraphics-commons.jar \
>    org.apache.fop.fonts.apps.TTFReader \
>    /usr/share/fonts/ipa-ex-mincho/ipaexm.ttf /tmp/ipaexm.xml
TTF Reader for Apache FOP SVN tags/fop-1_1

Parsing font...
Reading /usr/share/fonts/ipa-ex-mincho/ipaexm.ttf...
Error while building XML font metrics file.
java.lang.ArrayIndexOutOfBoundsException: 12244

(using fop-1.1-5.fc20.noarch)

Comment 8 info@kobaltwit.be 2014-01-15 09:40:18 UTC
A detail that escaped me earlier: the fonts that exhibit this issue (ipa fonts) are not TrueType fonts, but OpenType fonts. It looks like fop doesn't support those.

Note that gnucash has switched to other fonts now, but the issue still stands by itself.

Comment 9 Fedora End Of Life 2015-01-09 22:02:06 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 info@kobaltwit.be 2015-01-16 16:06:20 UTC
Changing version number to keep the bug alive.

Comment 11 info@kobaltwit.be 2015-05-09 11:00:10 UTC
Tested this again today: still an issue on Fedora 21 (fop-1.1-8.fc21.noarch).

This time I tried with several different otf font files. The ipaex fonts referred to earlier still result in the same error message as above.

However the lilypond-emmentaler fonts (which are shipped with Fedora) give this message when trying to extract the font metrics:
TTF Reader for Apache FOP SVN tags/fop-1_1

Parsing font...
Reading emmentaler-11.otf...
Font Family: [Emmentaler-11]
Error while building XML font metrics file.
java.lang.UnsupportedOperationException: OpenType fonts with CFF data are not supported, yet

Although it still fails to build the metrics file at least the message is much more userfriendly. A similar message would be much better for the ipaex fonts as well. It seems they have a different internal structure still.

Comment 12 Fedora End Of Life 2015-11-04 15:22:49 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2015-12-02 02:41:58 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 14 Derek Atkins 2015-12-02 17:02:31 UTC
Isn't this still an issue in F23?  Or has it finally been solved?

Comment 15 info@kobaltwit.be 2015-12-02 17:23:15 UTC
Nope, not fixed. I just tested and it's still happening on F23 with
fop-2.0-2.fc23.noarch:

$ java -cp /usr/share/java/fop.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/commons-logging.jar:/usr/share/java/commons-io.jar:/usr/share/java/xmlgraphics-commons.jar org.apache.fop.fonts.apps.TTFReader /home/janssege/Development/IPAexfont00201/ipaexm.otf /tmp/ipaexm.xml
Dec 02, 2015 6:21:58 PM org.apache.fop.fonts.apps.AbstractFontReader main
INFO: TTF Reader for Apache FOP SVN branches/fop-2_0

Dec 02, 2015 6:21:58 PM org.apache.fop.fonts.apps.AbstractFontReader main
INFO: Parsing font...
Dec 02, 2015 6:21:58 PM org.apache.fop.fonts.apps.AbstractFontReader loadTTF
INFO: Reading /home/janssege/Development/IPAexfont00201/ipaexm.otf...
Dec 02, 2015 6:21:58 PM org.apache.fop.fonts.apps.AbstractFontReader main
SEVERE: Error while building XML font metrics file.
java.lang.ArrayIndexOutOfBoundsException: 12244
        at org.apache.fop.fonts.truetype.OpenFont.readPostScript(OpenFont.java:1320)
        at org.apache.fop.fonts.truetype.OpenFont.readFont(OpenFont.java:736)
        at org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:216)
        at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:166)

Comment 16 info@kobaltwit.be 2015-12-02 17:26:07 UTC
And for another otf font:

$ java -cp /usr/share/java/fop.jar:/usr/share/java/avalon-framework.jar:/usr/share/java/commons-logging.jar:/usr/share/java/commons-io.jar:/usr/share/java/xmlgraphics-commons.jar org.apache.fop.fonts.apps.TTFReader /usr/share/fonts/abattis-cantarell/Cantarell-Regular.otf /tmp/Cantarell-Regular.xml
Dec 02, 2015 6:25:02 PM org.apache.fop.fonts.apps.AbstractFontReader main
INFO: TTF Reader for Apache FOP SVN branches/fop-2_0

Dec 02, 2015 6:25:02 PM org.apache.fop.fonts.apps.AbstractFontReader main
INFO: Parsing font...
Dec 02, 2015 6:25:02 PM org.apache.fop.fonts.apps.AbstractFontReader loadTTF
INFO: Reading /usr/share/fonts/abattis-cantarell/Cantarell-Regular.otf...
Dec 02, 2015 6:25:02 PM org.apache.fop.fonts.truetype.TTFFile seekTab
SEVERE: Dirtab loca not found.
Dec 02, 2015 6:25:02 PM org.apache.fop.fonts.apps.AbstractFontReader main
SEVERE: Error while building XML font metrics file.
java.io.IOException: 'loca' table not found, happens when the font file doesn't contain TrueType outlines (trying to read an OpenType CFF font maybe?)
        at org.apache.fop.fonts.truetype.TTFFile.readIndexToLocation(TTFFile.java:180)
        at org.apache.fop.fonts.truetype.TTFFile.updateBBoxAndOffset(TTFFile.java:169)
        at org.apache.fop.fonts.truetype.OpenFont.readFont(OpenFont.java:750)
        at org.apache.fop.fonts.apps.TTFReader.loadTTF(TTFReader.java:216)
        at org.apache.fop.fonts.apps.TTFReader.main(TTFReader.java:166)

Comment 17 Fedora End Of Life 2016-11-24 10:52:09 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 18 Fedora End Of Life 2016-12-20 12:31:25 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.