OpenPDF icon indicating copy to clipboard operation
OpenPDF copied to clipboard

CFF getAscent(Point) always returns 0

Open JohannesBeranek opened this issue 1 year ago • 2 comments

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.

JohannesBeranek avatar Mar 14 '23 17:03 JohannesBeranek

Any update?

mercurydaihui avatar Nov 01 '23 08:11 mercurydaihui

Pull requests are welcome for this.

asturio avatar Feb 23 '24 15:02 asturio