diff --git a/freetype/truetype/hint.go b/freetype/truetype/hint.go index 60a74ff..d4ea9b8 100644 --- a/freetype/truetype/hint.go +++ b/freetype/truetype/hint.go @@ -307,7 +307,7 @@ func (h *Hinter) run(program []byte, pCurrent, pUnhinted, pInFontUnits []Point, case opSSW: top-- - h.gs.singleWidth = f26dot6(h.stack[top]) + h.gs.singleWidth = f26dot6(h.font.scale(h.scale * h.stack[top])) case opDUP: if top >= len(h.stack) { @@ -821,9 +821,9 @@ func (h *Hinter) run(program []byte, pCurrent, pUnhinted, pInFontUnits []Point, // Single-width cut-in test. if x := (oldDist - h.gs.singleWidth).abs(); x < h.gs.singleWidthCutIn { if oldDist >= 0 { - oldDist = h.gs.singleWidthCutIn + oldDist = +h.gs.singleWidth } else { - oldDist = -h.gs.singleWidthCutIn + oldDist = -h.gs.singleWidth } } diff --git a/freetype/truetype/truetype_test.go b/freetype/truetype/truetype_test.go index 11d5571..f784fce 100644 --- a/freetype/truetype/truetype_test.go +++ b/freetype/truetype/truetype_test.go @@ -116,7 +116,7 @@ func testScaling(t *testing.T, filename string, hinter *Hinter) { for i, want := range wants { // TODO: completely implement hinting. For now, only the first N glyphs // of luxisr.ttf are correctly hinted. - const N = 106 + const N = 136 if hinter != nil && i == N { break }