Bug 1132

Summary: OTF fonts can't be loaded in Graph API renderer
Product: [JogAmp] Jogl Reporter: Alan Sambol <alan.zgb>
Component: graphAssignee: Sven Gothel <sgothel>
Status: RESOLVED WONTFIX    
Severity: major CC: gouessej, kdropucic, rami.santina, sgothel
Priority: ---    
Version: tbd   
Hardware: All   
OS: all   
Type: FEATURE SCM Refs:
Workaround: ---
Bug Depends on:    
Bug Blocks: 1064    

Description Alan Sambol 2015-02-23 15:59:01 CET
When trying to load any font in OTF format the following exception is thrown:

java.lang.NegativeArraySizeException 
        at jogamp.graph.font.typecast.ot.table.CffTable$Index.<init>(CffTable.java:202) 
        at jogamp.graph.font.typecast.ot.table.CffTable.<init>(CffTable.java:525) 
        at jogamp.graph.font.typecast.ot.table.TableFactory.create(TableFactory.java:87) 
        at jogamp.graph.font.typecast.ot.OTFont.read(OTFont.java:268) 
        at jogamp.graph.font.typecast.ot.OTFontCollection.read(OTFontCollection.java:166) 
        at jogamp.graph.font.typecast.ot.OTFontCollection.create(OTFontCollection.java:63) 
        at jogamp.graph.font.typecast.TypecastFontConstructor$1.run(TypecastFontConstructor.java:53) 
        at java.security.AccessController.doPrivileged(Native Method) 
        at jogamp.graph.font.typecast.TypecastFontConstructor.create(TypecastFontConstructor.java:48) 
        at com.jogamp.graph.font.FontFactory.get(FontFactory.java:91)
Comment 1 Julien Gouesse 2015-03-23 14:21:40 CET
(In reply to comment #0)
> When trying to load any font in OTF format the following exception is thrown:
> 
> java.lang.NegativeArraySizeException 
>         at
> jogamp.graph.font.typecast.ot.table.CffTable$Index.<init>(CffTable.java:202) 
>         at
> jogamp.graph.font.typecast.ot.table.CffTable.<init>(CffTable.java:525) 
>         at
> jogamp.graph.font.typecast.ot.table.TableFactory.create(TableFactory.java:
> 87) 
>         at jogamp.graph.font.typecast.ot.OTFont.read(OTFont.java:268) 
>         at
> jogamp.graph.font.typecast.ot.OTFontCollection.read(OTFontCollection.java:
> 166) 
>         at
> jogamp.graph.font.typecast.ot.OTFontCollection.create(OTFontCollection.java:
> 63) 
>         at
> jogamp.graph.font.typecast.TypecastFontConstructor$1.
> run(TypecastFontConstructor.java:53) 
>         at java.security.AccessController.doPrivileged(Native Method) 
>         at
> jogamp.graph.font.typecast.TypecastFontConstructor.
> create(TypecastFontConstructor.java:48) 
>         at com.jogamp.graph.font.FontFactory.get(FontFactory.java:91)

Look at the very last offset read here: https://github.com/sgothel/jogl/blob/master/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java#L200
Comment 2 Sven Gothel 2023-09-24 01:27:30 CEST
Yes, even though I have updated our Typecast branch - it is not supported.

There exist an experimental branch https://github.com/haumacher/typecast/commits/documentation
addressing some of these issues, but not yet fully functional.

Hence I put this as WONTFIX for now as TTF is OK for now.
We may revisit this if interest (and contracts) come up.