From d9ec8a059dbf4829613e4c357568a03fe03ae2d8 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 22 Nov 2019 15:14:32 +0100 Subject: image.Point --- hershey.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/hershey.go b/hershey.go index d886f33..1cf2904 100644 --- a/hershey.go +++ b/hershey.go @@ -10,8 +10,7 @@ import ( "strings" ) -type Point image.Point -type Path []Point +type Path []image.Point type Set []Path type Glyph struct { @@ -43,11 +42,8 @@ func parseData(s string) Set { } var ph Path for n := 0; n < len(el); n += 2 { - p := Point{ - X: parsePoint(el[n+1]), - Y: parsePoint(el[n]), - } - ph = append(ph, p) + x, y := parsePoint(el[n+1]), parsePoint(el[n]) + ph = append(ph, image.Pt(x, y)) } st = append(st, ph) } @@ -82,10 +78,6 @@ func loadFont(fname string) Font { return fnt } -func (p Point) String() string { - return fmt.Sprintf("%v,%v,", p.X, p.Y) -} - func (p Path) String() (s string) { //s = fmt.Sprint("Y0,", p[0]) s = fmt.Sprint("M", p[0], "D") -- cgit v1.2.3