freetype/truetype: handle control value cut-in in MIRP.

The difference is quite large on glyph 509 (period character)
of Adobe Source Sans Pro Bold Italic.

R=golang-dev, nigeltao, bsiegert
CC=golang-dev
https://codereview.appspot.com/16820043

Committer: Nigel Tao <nigeltao@golang.org>
This commit is contained in:
R?my Oudompheng 2013-10-25 11:01:57 +11:00
parent 5ac614f802
commit 486e1683dd

View file

@ -1023,7 +1023,11 @@ func (h *Hinter) run(program []byte, pCurrent, pUnhinted, pInFontUnits []Point,
// TODO: metrics compensation.
distance := cvtDist
if opcode&0x04 != 0 {
distance = h.round(cvtDist)
// The CVT value is only used if close enough to oldDist.
if (cvtDist - oldDist).abs() > h.gs.controlValueCutIn {
distance = oldDist
}
distance = h.round(distance)
}
// Minimum distance bit.