Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blFontGetTextMetrics() & blFontGetGlyphBounds() fails with OTF/CFF fonts #40

Open
KMojek opened this issue Jun 11, 2019 · 4 comments
Open
Labels

Comments

@KMojek
Copy link

KMojek commented Jun 11, 2019

I happened to have a handful of OTF fonts installed. I seem to get the same behavior with all of them: in the Glyph Buffer sample, the call to font.getTextMetrics() results in an empty bounding box and returns an error originating from within the BL_PROPAGATE( blFontGetGlyphBounds() ) in blFontGetTextMetrics(). It does seem to render the font though. Attaching one of the fonts.
font.zip

@kobalicek kobalicek changed the title blFontGetTextMetrics() fails with some OTF fonts on Windows 10 blFontGetTextMetrics() & blFontGetGlyphBounds() fails with OTF/CFF fonts Jun 11, 2019
@kobalicek
Copy link
Member

Unfortunately I can confirm this. The reason this fails is that OTF fonts have no bounds stored in the font, the outlines have to be inspected in order to get bounds. I will definitely try to finish this.

@kobalicek kobalicek added the bug label Jun 11, 2019
@kobalicek
Copy link
Member

I have added an initial implementation for OTF/CFF fonts, however, it's uncached for now and thus slow. Let me know whether this works for you:

Commit: 44a1872

@KMojek
Copy link
Author

KMojek commented Jun 12, 2019

Thanks, this should work! I'm having trouble building from git for some reason (probably I'm doing something stupid; beta7 and beta 8 zips worked just fine). I just wanted to verify that more complete OTF font support is on the roadmap. It sounds like it is, and that's great! For my purposes, I don't think I need much beyond what's in the sample code other than right-to-left text working; guessing that's probably part of 'Advanced Text Layout' on the roadmap.

@kobalicek kobalicek added todo and removed bug labels Apr 19, 2020
@kobalicek
Copy link
Member

kobalicek commented Apr 19, 2020

TODO Items related to this issue:

  • Implement caching of metrics in CFF case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants