OpenPDF
OpenPDF copied to clipboard
CFF getAscent(Point) always returns 0
Describe the bug Using an .otf CFF Font via FontFactory.register + FontFactory.getFont, then later call font.getBaseFont().getAscentPoint("A", font.getSize()) always returns 0.
I've debugged the issue so far that this.bboxes never gets initialized. This is to be expected though, as readBBox in class TrueTypeFont looks for "loca" table, which doesn't exist in a CFF Font.
Expected behavior getAscentPoint works with otf files
System Used Font: Aileron (open source and freely available) - checked with FontForge that everything works and is there
Additional context Also see the comments here: https://stackoverflow.com/questions/24556000/how-to-get-the-ascending-or-descending-height-of-a-font-that-uses-text-figures
Topic is nearly 9 years old, but same issue there. And there's actually a few of those around the net, but never any real answer.
Any update?
Pull requests are welcome for this.