golang-image/font/sfnt
Nigel Tao cd38e8056d font/sfnt: make PostTable.ItalicAngle a float64
Previously, it was a float32, which obviously has 32 bits of state. Not
all of that 32 bit state space is meaningful, since NaN has multiple bit
representations. The underlying file format field (of type "Fixed" or
16.16 fixed point) is also 32 bits of state
(https://docs.microsoft.com/en-us/typography/opentype/spec/post).
Therefore, converting from 32 bit fixed point to 32 bit floating point
can be lossy. Instead, use 64 bit floating point. 53 significand bits
can losslessly represent all possible 16.16 fixed point values.

Using float64 is also arguably more Go-like, as the default type for the
ideal constant 0.5 is float64, not float32.

Change-Id: I5abe7979a020af2ac4784d6c2723ab8e39e38e34
Reviewed-on: https://go-review.googlesource.com/c/149837
Reviewed-by: Denys Smirnov <denis.smirnov.91@gmail.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2018-11-16 02:48:01 +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: rename ExampleRasterizeGlyph to Example_rasterizeGlyph 2018-11-09 00:22:02 +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 font/sfnt: parse and expose PostScript information 2018-11-15 06:11:51 +00:00
sfnt.go font/sfnt: make PostTable.ItalicAngle a float64 2018-11-16 02:48:01 +00:00
truetype.go font/sfnt: implement Font.GlyphAdvance. 2017-04-05 22:26:46 +00:00