freetype
freetype copied to clipboard
Expose ascent and descent in truetype.Font.
These are needed to figure out line height and the height for the background of
highlighted text. Font.Bounds().YMin and YMax don't work; they are too large.
Instead we need ascent and descent from the hhea table.
Original issue reported on code.google.com by [email protected] on 16 Feb 2015 at 8:13
I second this notion.
Mind if I tackle this one in the near future, @nigeltao?
Sure, have at it, although there might be implications for what we want to do for the x/image/font package wrt exposing ascent / descent / height in a uniform way across all font formats, not just the truetype font format. That's the "TODO: per-font Metrics" in https://go.googlesource.com/image/+/master/font/font.go
Has there been any/much discussion on how to expose them that I can look at before starting?
No, no discussion yet.
Maybe deprecate this code in favor of https://godoc.org/golang.org/x/image/font#Metrics ? I was able to successfully render text with just x/image/font, so this library seems to no longer be needed.