freetype/truetype: apply the pp1x adjustment to the unhinted points

*before* hinting.

R=bsiegert
CC=golang-dev, remyoudompheng
https://codereview.appspot.com/35070044
This commit is contained in:
Nigel Tao 2013-11-29 22:12:55 +11:00
parent 114d43ecfe
commit 1f97ea5d8e
2 changed files with 2 additions and 2 deletions

View file

@ -394,7 +394,6 @@ func (g *GlyphBuf) addPhantomsAndScale(b Bounds, uhm HMetric, i Index, np0 int,
p.Y = g.font.scale(g.scale * p.Y)
}
if simple && g.hinter != nil {
g.Unhinted = append(g.Unhinted, g.Point[np0:]...)
// Round the 1st phantom point to the grid, shifting all other points equally.
pp1x := g.Point[len(g.Point)-4].X
if dx := ((pp1x + 32) &^ 63) - pp1x; dx != 0 {
@ -402,6 +401,7 @@ func (g *GlyphBuf) addPhantomsAndScale(b Bounds, uhm HMetric, i Index, np0 int,
g.Point[i].X += dx
}
}
g.Unhinted = append(g.Unhinted, g.Point[np0:]...)
}
// Round the 2nd and 4th phantom point to the grid.
p := &g.Point[len(g.Point)-3]

View file

@ -255,7 +255,7 @@ var scalingTestCases = []struct {
hintingBrokenAt int
}{
{"luxisr", 12, -1},
{"x-arial-bold", 11, 130},
{"x-arial-bold", 11, 238},
{"x-deja-vu-sans-oblique", 17, -1},
{"x-droid-sans-japanese", 9, 0},
{"x-times-new-roman", 13, 0},