Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround wrong font height returned by freetype
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
- Loading branch information