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
This commit is contained in:
Nigel Tao 2014-11-07 09:37:26 +11:00
parent e009753234
commit c3ec330230

View File

@ -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-- {