Commit Graph

2 Commits

Author SHA1 Message Date
Elias Naur
cc896f830c font/sfnt,font/opentype: correct font height computation
According to https://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html
the line spacing of a font is computed as

line space = ascent - descent + linegap

Use that formula to compute the Height field of a Font's Metrics.

Change-Id: I1c44eca9f662e0aae68716cd8859670fe0b394d7
Reviewed-on: https://go-review.googlesource.com/120815
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-06-28 06:20:38 +00:00
Sebastien Binet
e5db4c4663 font/opentype: implement font.Face interface
This CL adds the type Face that implements the font.Face interface.
This CL also adds tests using gofont/goregular as an input font, using
github.com/golang/freetype/truetype as reference values.

Updates golang/go#22451.

Change-Id: I2a6945309331b251ec2ddec95b6e809ad10aa116
Reviewed-on: https://go-review.googlesource.com/73870
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2017-12-08 23:31:33 +00:00