iand / draw2d

A Fork of code.google.com/p/draw2d

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile error on go 1.2

GoogleCodeExporter opened this issue · comments

What steps will reproduce the problem?
1. go get -v code.google.com/p/draw2d/draw2d

What is the expected output? What do you see instead?
# code.google.com/p/draw2d/draw2d
draw2d/draw2d/image.go:166: cannot use nil as type truetype.Hinting in function 
argument
draw2d/draw2d/image.go:225: cannot use nil as type truetype.Hinting in function 
argument


Draw2d Package version: latest, Go version 1.2


Please provide any additional information below.

I fixed this as follows:
cmccabe@keter:~/gopath/src/code.google.com/p/draw2d> hg diff
diff -r ec77dc18b964 draw2d/image.go
--- a/draw2d/image.go   Tue May 28 22:48:35 2013 -0400
+++ b/draw2d/image.go   Wed Feb 12 19:50:47 2014 -0800
@@ -163,7 +163,7 @@
 }

 func (gc *ImageGraphicContext) drawGlyph(glyph truetype.Index, dx, dy float64) error {
-       if err := gc.glyphBuf.Load(gc.Current.font, gc.Current.scale, glyph, 
nil); err != nil {
+       if err := gc.glyphBuf.Load(gc.Current.font, gc.Current.scale, glyph, 
truetype.NoHinting); err != nil {
                return err
        }
        e0 := 0
@@ -222,7 +222,7 @@
                if hasPrev {
                        cursor += fUnitsToFloat64(font.Kerning(gc.Current.scale, prev, index))
                }
-               if err := gc.glyphBuf.Load(gc.Current.font, gc.Current.scale, 
index, nil); err != nil {
+               if err := gc.glyphBuf.Load(gc.Current.font, gc.Current.scale, 
index, truetype.NoHinting); err != nil {
                        log.Println(err)
                        return 0, 0, 0, 0
                }

Original issue reported on code.google.com by cmccabe@cloudera.com on 13 Feb 2014 at 3:51

Follow freetype-go changes?.

Original comment by legoff.l...@gmail.com on 13 Feb 2014 at 8:18

  • Changed state: Fixed