diff --git a/font/sfnt/sfnt.go b/font/sfnt/sfnt.go index 0eb5cd5..e7125bf 100644 --- a/font/sfnt/sfnt.go +++ b/font/sfnt/sfnt.go @@ -1165,7 +1165,7 @@ type PostTable struct { Version uint32 // ItalicAngle in counter-clockwise degrees from the vertical. Zero for // upright text, negative for text that leans to the right (forward). - ItalicAngle float32 + ItalicAngle float64 // UnderlinePosition is the suggested distance of the top of the // underline from the baseline (negative values indicate below baseline). UnderlinePosition int16 @@ -1227,7 +1227,7 @@ func (f *Font) parsePost(buf []byte, numGlyphs int32) (buf1 []byte, post *PostTa } post = &PostTable{ Version: u, - ItalicAngle: float32(int16(ang>>16)) + float32(ang&0xffff)/0x10000, + ItalicAngle: float64(int32(ang)) / 0x10000, UnderlinePosition: int16(up), UnderlineThickness: int16(ut), IsFixedPitch: fp != 0,