-
Notifications
You must be signed in to change notification settings - Fork 185
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
multiple fixes: prevent crash from nil loca, fix Height metric, cache advances, more robust to bad kern issues #62
base: master
Are you sure you want to change the base?
Conversation
…lineGap; fix Height computation to use ascent - descent + lineGap
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it! |
CLAs look good, thanks! |
1 similar comment
CLAs look good, thanks! |
Sorry I forgot to check existing PR's and see that this is partially redundant with #32 -- seems like this package is not being actively maintained. Therefore, I'll plan to keep my fork at https://github.com/goki/freetype up-to-date if anyone wants to contribute PR's there. Without the above fixes (or #32) the font height computation is definitely incorrect, and it is not usable for browsing fonts on Linux because of the crashing. I'll merge #49 and #50 now -- will be handy for SVG! |
The height seems to be only slightly bigger than the Ascent. It's small enough such that characters that take up space below the baseline (e.g. 'g', 'y', 'j', 'p') gets cut off at the bottom. (For reference, see https://developer.apple.com/library/archive/documentation/TextFonts/Conceptual/CocoaTextArchitecture/Art/glyph_metrics_2x.png) This is a freetype bug: golang/freetype#34 There are multiple PRs with a fix that haven't been merged: golang/freetype#32 golang/freetype#62 Plan9port's fontsrv also similarly sums up ascent and descent to compute the height: https://github.com/9fans/plan9port/blob/047fd921744f39a82a86d9370e03f7af511e6e84/src/cmd/fontsrv/x11.c#L80
Support getting the glyph details at a specific Index
…inding = true in rasterizer; return !ok in GlyphAdvance if rune index == 0, consistent with opentype.
This reverts commit 4d2d918.
These are all extensively tested in context of GoGi project: https://github.com/goki/gi and fix a number of important issues to make it work. Let me know if there are any questions on anything! Thanks,