提交 c3ec3302 编写于 作者: N Nigel Tao

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
上级 e0097532
......@@ -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-- {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册