From c3ec330230c997e8d334f8dc1cf39eccb4f5339b Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Fri, 7 Nov 2014 09:37:26 +1100 Subject: [PATCH] freetype/truetype: fix some typos in hint.go. Fixes issue 12. Fixes issue 13. LGTM=bsiegert R=bsiegert CC=golang-codereviews https://codereview.appspot.com/164650043 --- freetype/truetype/hint.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/freetype/truetype/hint.go b/freetype/truetype/hint.go index 35f1fc5..26c6314 100644 --- a/freetype/truetype/hint.go +++ b/freetype/truetype/hint.go @@ -668,7 +668,7 @@ func (h *hinter) run(program []byte, pCurrent, pUnhinted, pInFontUnits []Point, if ref == nil || p == nil { return errors.New("truetype: hinting: point out of range") } - curDist := dotProduct(f26dot6(p.X-ref.X), f26dot6(p.Y-ref.Y), h.gs.dv) + curDist := dotProduct(f26dot6(p.X-ref.X), f26dot6(p.Y-ref.Y), h.gs.pv) // Set-RP0 bit. if opcode == opMSIRP1 { @@ -1343,8 +1343,8 @@ func (h *hinter) run(program []byte, pCurrent, pUnhinted, pInFontUnits []Point, h.initializeScaledCVT() } top-- - n := f26dot6(h.stack[top]) - if top < 2*int(h.gs.loop) { + n := h.stack[top] + if int32(top) < 2*n { return errors.New("truetype: hinting: stack underflow") } for ; n > 0; n-- {