golang-image/font/sfnt
Denys Smirnov 63626fb251 font/sfnt: fix hmtx table size validation
The library assumes the hmtx size to be equal to 2*nGlyph + 2*nHm,
which is a simplification of 4*nHm + 2*(nGlyph-nHm) as described
in the spec. However, fonts seen in the wild sometimes omit the
second term (left side bearings), making validation to fail.

CL fixes the validation code by allowing to omit the second term.

Fixes golang/go#28379

Change-Id: I2293e498e72f95e5fe08c2b375ea7b020d06cde3
Reviewed-on: https://go-review.googlesource.com/c/144080
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-11-02 02:16:09 +00:00
..
cmap.go font/sfnt: use charmap EncodeRune API. 2017-04-05 22:33:02 +00:00
data.go font/sfnt: implement Font.GlyphName. 2017-02-17 10:37:04 +00:00
example_test.go font/sfnt: explicitly close glyph contours. 2017-04-10 07:42:48 +00:00
gen.go font/sfnt: implement Font.GlyphName. 2017-02-17 10:37:04 +00:00
postscript.go font/sfnt: implement hflex and hflex1. 2017-05-23 02:19:15 +00:00
proprietary_test.go font/sfnt: implement hflex and hflex1. 2017-05-23 02:19:15 +00:00
sfnt_test.go image/font: expose caret slope 2018-09-26 01:56:37 +00:00
sfnt.go font/sfnt: fix hmtx table size validation 2018-11-02 02:16:09 +00:00
truetype.go font/sfnt: implement Font.GlyphAdvance. 2017-04-05 22:26:46 +00:00