iand / draw2d Goto Github PK
View Code? Open in Web Editor NEWA Fork of code.google.com/p/draw2d
License: BSD 2-Clause "Simplified" License
A Fork of code.google.com/p/draw2d
License: BSD 2-Clause "Simplified" License
How to use on Google App Engine?
I tried, and it won't compile.
Original issue reported on code.google.com by [email protected]
on 4 Mar 2012 at 2:45
remove Copyright for godoc
Original issue reported on code.google.com by [email protected]
on 6 Oct 2011 at 5:42
Attachments:
Postscript GraphicContext with minimal support for text.
Original issue reported on code.google.com by [email protected]
on 16 Apr 2012 at 7:42
Purpose of code changes on this branch:
Changes for Rectangle structure definition
When reviewing my code changes, please focus on:
I modified image package. It is a big change.
I raise review request for that. This changes are sync to the new image package
After the review, I'll merge this branch into:
/trunk
Original issue reported on code.google.com by [email protected]
on 27 Sep 2011 at 11:25
Attachments:
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 [email protected]
on 13 Feb 2014 at 3:51
What steps will reproduce the problem?
1. go get code.google.com/p/draw2d
2. go build go build code.google.com/p/draw2d/draw2d/curve
What is the expected output? What do you see instead?
should cleanly exit.
instead:
can't load package: package code.google.com/p/draw2d/draw2d/curve: found
packages arc.go (draw2d) and cubic_float64.go (curve) in
/home/cryptix/go/src/code.google.com/p/draw2d/draw2d/curve
Draw2d Package version , Go version ?
latest master, go 1.4
Please provide any additional information below.
I changed the package to curve and changed the return in the for-loop to a
break. Please see the attached patch-file.
My main incentive for this fix is that godoc -analysis fails if it can't load
all packages in $GOPATH.
Original issue reported on code.google.com by [email protected]
on 7 Jan 2015 at 12:02
Attachments:
I would like to have a function to create a GraphicContext using an exotic
image type I implemented. It could be basically a modified version of
NewGraphicContext taking a painter as parameter like the one at the end of this
message.
Regards,
Michael
////////////////////////
func NewGraphicContext2(img draw.Image, painter Painter) *ImageGraphicContext {
width, height := img.Bounds().Dx(), img.Bounds().Dy()
dpi := 92
ftContext := freetype.NewContext()
ftContext.SetDPI(dpi)
ftContext.SetClip(img.Bounds())
ftContext.SetDst(img)
gc := &ImageGraphicContext{
NewStackGraphicContext(),
img,
painter,
raster.NewRasterizer(width, height),
raster.NewRasterizer(width, height),
ftContext,
dpi,
}
return gc
}
Original issue reported on code.google.com by [email protected]
on 11 May 2012 at 10:18
What steps will reproduce the problem?
goinstall draw2d.googlecode.com/hg/draw2d
What is the expected output? What do you see instead?
/bin/bash: === cd
/Users/abaumann/goinstall_base/src/freetype-go.googlecode.com/hg/freetype; bash
gomake -f- install
6g -I "/Users/abaumann/go/pkg/darwin_amd64" -I
"/Users/abaumann/goinstall_base/pkg/darwin_amd64" -o _go_.6 freetype.go
freetype.go:180: cannot use image.Rect(0, 0, xmax - xmin, ymax - ymin) (type
image.Rectangle) as type int in function argument
freetype.go:180: not enough arguments in call to image.NewAlpha
make: *** [_go_.6] Error 1
--- exit status 2
goinstall: freetype-go.googlecode.com/hg/freetype: install: running bash: exit
status 2
What version of the product are you using? On what operating system?
OSX Lion
Please provide any additional information below.
I use the current release of go (16.09.2011 weekly)
Original issue reported on code.google.com by [email protected]
on 16 Sep 2011 at 7:23
Fix error when try to build telling that Hinting can't be nil. Instead of nil
set NoHinting.
Original issue reported on code.google.com by [email protected]
on 9 Feb 2014 at 3:39
Attachments:
Hi,
weekly.2011-10-06 renamed a bunch of exported funcs, types, etc. I patched my
local sources, but thought it might be useful to everyone.
Yegor
Original issue reported on code.google.com by [email protected]
on 20 Oct 2011 at 12:36
Attachments:
What steps will reproduce the problem?
Set up a rotation
Draw text
What is the expected output? What do you see instead?
The text should be rotated. Instead, the text is drawn smaller
without rotation.
Original issue reported on code.google.com by [email protected]
on 19 Apr 2012 at 6:58
Freetype-go uses float64 for DPI, so there are some small type errors. The
attached patch seems to fix it.
Original issue reported on code.google.com by [email protected]
on 28 Jul 2012 at 1:31
Attachments:
What steps will reproduce the problem?
1.Copy the Fill String demo code
2. Use "go run" to run the code
What is the expected output? What do you see instead?
The code try to get the font data from a specific folder, of cource the folder
does not exit:
2012/04/19 22:41:21 open ../resource/font/luximbi.ttf: no such file or directory
2012/04/19 22:41:21 open ../resource/font/luxisr.ttf: no such file or directory
width: 0.000000
2012/04/19 22:41:21 open ../resource/font/luximbi.ttf: no such file or directory
2012/04/19 22:41:21 open ../resource/font/luxisr.ttf: no such file or directory
Wrote TestFillString.png OK.
____________________________
How can I edit the location of the font?
I have attach my source file if you need more infomation.
Original issue reported on code.google.com by [email protected]
on 19 Apr 2012 at 3:46
Attachments:
Here is my code:
//load background image
file, err := os.Open("android.png")
if err != nil {
log.Fatal(err)
}
defer file.Close()
a, _, err := image.Decode(file)
//load go icon image
file2, err := os.Open("go.png")
if err != nil {
log.Fatal(err)
}
defer file2.Close()
g, _, err := image.Decode(file2)
if err != nil {
log.Fatal(err)
}
ar := a.Bounds()
w, h, x := ar.Dx(), ar.Dy(), 30.0
i := image.NewRGBA(image.Rect(0, 0, w, h))
draw.Draw(i, ar, a, ar.Min, draw.Src)
tr := draw2d.NewRotationMatrix(x*(math.Pi / 180.0))
draw2d.DrawImage(g, i, tr, draw.Src, draw2d.LinearFilter)
saveToPngFile("Test2", i)
I'm trying to rotate + paste an small image to the background image.
But you can see like the attachment image, why it leave the ugly black hole??
This is a bug or my misstake?
Thanks for your help!
Original issue reported on code.google.com by [email protected]
on 23 Apr 2012 at 3:40
Attachments:
What steps will reproduce the problem?
1. Fresh Go installation
2. goinstall draw2d.googlecode.com/hg/draw2d
What is the expected output? What do you see instead?
The package should get installed.
goinstall: image/color: go/build: package could not be found locally ($GOPATH
not set)
What version of the product are you using? On what operating system?
Go release.r60.1, Mac OS X Lion
Please provide any additional information below.
I tried to figure out where to set GOPATH to, which made the ($GOPATH not set)
part disappear, but I haven't been able to figure out how to fix it.
Original issue reported on code.google.com by [email protected]
on 9 Oct 2011 at 5:27
What steps will reproduce the problem?
1. cd go/src/pkg/draw2d.googlecode.com/hg/draw2d
2. hg pull && hg update
3. goinstall .
What is the expected output? What do you see instead?
Expected: no output
Instead: image.go:80: not enough arguments in call to draw.Draw
What version of the product are you using? On what operating system?
Using go tip and draw2d tip
Please provide any additional information below.
Fix:
diff -r dfc88bbb5ba2 draw2d/image.go
--- a/draw2d/image.go Wed Jun 08 00:31:06 2011 +0200
+++ b/draw2d/image.go Sun Jul 03 02:14:46 2011 +0200
@@ -77,7 +77,7 @@
func (gc *ImageGraphicContext) ClearRect(x1, y1, x2, y2 int) {
imageColor := image.NewColorImage(gc.Current.FillColor)
- draw.Draw(gc.img, image.Rect(x1, y1, x2, y2), imageColor, image.ZP)
+ draw.Draw(gc.img, image.Rect(x1, y1, x2, y2), imageColor, image.ZP,
draw.Over)
}
func (gc *ImageGraphicContext) DrawImage(img image.Image) {
Original issue reported on code.google.com by [email protected]
on 3 Jul 2011 at 12:27
Patch to build against weekly.2011.12.22
Gofix (image.Color/color.Color, math, namespace/imports)
Update instances of int in postscript to rune type
Original issue reported on code.google.com by [email protected]
on 23 Dec 2011 at 9:57
Attachments:
There should be a space between the copyright notice comments and the package
declaration statements. If you look at the godoc output for this package
(http://gopkgdoc.appspot.com/pkg/code.google.com/p/draw2d/draw2d) you will
notice that godoc thinks the copyright notices are part of the package
description.
Original issue reported on code.google.com by [email protected]
on 16 Apr 2012 at 5:53
$ goinstall draw2d.goog
$ sudo goinstall draw2d.googlecode.com/hg/draw2d
/bin/bash: === cd /usr/lib/go/src/pkg/draw2d.googlecode.com/hg/draw2d; bash
gomake -f- install
6g -I "/usr/lib/go/pkg/linux_amd64" -o _go_.6 dasher.go advanced_path.go
transform.go stroker.go paint.go path_converter.go math.go curves.go
stack_gc.go rgba_interpolation.go path_storage.go demux_converter.go gc.go
path_adder.go path.go image.go font.go arc.go vertex2d.go
image.go:80: not enough arguments in call to draw.Draw
make: *** [_go_.6] Error 1
--- exit status 2
Original issue reported on code.google.com by mictadlo
on 30 Aug 2011 at 12:25
can you please include the wingui example?
Original issue reported on code.google.com by [email protected]
on 3 Aug 2011 at 4:07
What steps will reproduce the problem?
1. Try to build the library
2. Get the error: interpreter.go:62: too many arguments in call to os.Open
What version of the product are you using? On what operating system?
krasin@krasin7:~/go/go$ hg identify
95d2ce135523 (release-branch.r57) release/release.r57.1
Please provide any additional information below.
Running gofix solves the problem:
krasin@krasin7:~/go/go/src/pkg/draw2d.googlecode.com/hg$ gofix *
AUTHORS:1:1: expected 'package', found 'IDENT' Laurent
cmd/gettingStarted.go:19:30: rewrote os.Open with O_CREATE but not O_TRUNC to
os.Create
cmd/gettingStarted.go:19:12: rewrote os.Open to os.Create with permission not
0666
cmd/gettingStarted.go: fixed osopen
cmd/testandroid.go:43:30: rewrote os.Open with O_CREATE but not O_TRUNC to
os.Create
cmd/testandroid.go:43:12: rewrote os.Open to os.Create with permission not 0666
cmd/testandroid.go: fixed osopen
cmd/testdraw2d.go:45:30: rewrote os.Open with O_CREATE but not O_TRUNC to
os.Create
cmd/testdraw2d.go:45:12: rewrote os.Open to os.Create with permission not 0666
cmd/testdraw2d.go: fixed osopen
cmd/testgopher.go:43:30: rewrote os.Open with O_CREATE but not O_TRUNC to
os.Create
cmd/testgopher.go:43:12: rewrote os.Open to os.Create with permission not 0666
cmd/testgopher.go: fixed osopen
cmd/testimage.go:17:30: rewrote os.Open with O_CREATE but not O_TRUNC to
os.Create
cmd/testimage.go:17:12: rewrote os.Open to os.Create with permission not 0666
cmd/testimage.go: fixed osopen
cmd/testpostscript.go:20:30: rewrote os.Open with O_CREATE but not O_TRUNC to
os.Create
cmd/testpostscript.go:20:12: rewrote os.Open to os.Create with permission not
0666
cmd/testpostscript.go: fixed osopen
LICENSE:1:1: expected 'package', found 'IDENT' Copyright
Makefile:2:1: expected 'package', found 'IDENT' include
postscript/interpreter.go: fixed osopen
README:3:1: expected 'package', found 'IDENT' This
krasin@krasin7:~/go/go/src/pkg/draw2d.googlecode.com/hg$ make install
cd draw2d && make install
make[1]: Entering directory
`/home/krasin/go/go/src/pkg/draw2d.googlecode.com/hg/draw2d'
make[1]: Nothing to be done for `install'.
make[1]: Leaving directory
`/home/krasin/go/go/src/pkg/draw2d.googlecode.com/hg/draw2d'
cd postscript && make install
make[1]: Entering directory
`/home/krasin/go/go/src/pkg/draw2d.googlecode.com/hg/postscript'
6g -o _go_.6 operators_array.go operators_dictionary.go operators_misc.go
procedure.go interpreter.go operators_conflict.go operators_graphics.go
operators_relational.go scanner.go operators.go operators_control.go
operators_math.go operators_stack.go
rm -f _obj/draw2d.googlecode.com/hg/postscript.a
gopack grc _obj/draw2d.googlecode.com/hg/postscript.a _go_.6
cp _obj/draw2d.googlecode.com/hg/postscript.a
"/home/krasin/go/go/pkg/linux_amd64/draw2d.googlecode.com/hg/postscript.a"
make[1]: Leaving directory
`/home/krasin/go/go/src/pkg/draw2d.googlecode.com/hg/postscript'
Original issue reported on code.google.com by [email protected]
on 15 May 2011 at 5:05
It appears that MiterJoin doesn't do anything at all. From reading the source
code, if the Join style is not RoundJoin or BevelJoin, then the Joiner returned
is the RoundJoiner. Although in my case, RoundJoin doesn't seem to work either
(I always get a bevel).
Original issue reported on code.google.com by [email protected]
on 27 Oct 2013 at 10:22
What steps will reproduce the problem?
$ go get -u code.google.com/p/draw2d/draw2d/
# code.google.com/p/draw2d/draw2d
/home/mischief/code/go/src/code.google.com/p/draw2d/draw2d/image.go:166: cannot
use nil as type truetype.Hinting in function argument
/home/mischief/code/go/src/code.google.com/p/draw2d/draw2d/image.go:225: cannot
use nil as type truetype.Hinting in function argument
What is the expected output? What do you see instead?
no output - successful compilation.
Draw2d Package version , Go version ?
draw2d ec77dc18b964
go version devel +ae14bde9ce3c Wed Feb 05 07:32:16 2014 -0800 linux/amd64
you just need to replace 'nil' on these lines with either 0, or the correct
constant from the truetype package.
Original issue reported on code.google.com by [email protected]
on 12 Feb 2014 at 4:11
image.go:166: cannot use nil as type truetype.Hinting in function argument
image.go:225: cannot use nil as type truetype.Hinting in function argument
Original issue reported on code.google.com by [email protected]
on 12 Feb 2014 at 4:20
What steps will reproduce the problem?
1. Run the following code:
a := uint8(150)
palette := [...]image.Color {
image.RGBAColor{95, 119, 0, a},
image.RGBAColor{157, 196, 0, a},
image.RGBAColor{120, 64, 0, a},
image.RGBAColor{196, 105, 0, a},
image.RGBAColor{135, 135, 0, a},
};
img := image.NewRGBA(500, 200)
gc := draw2d.NewGraphicContext(img)
for row := 0; row < 2; row++ {
sa := uint8(255)
if row == 1 {
sa = 0
}
gc.SetStrokeColor(image.RGBAColor{0, 0, 0, sa})
for i := 0; i < 5; i++ {
gc.SetFillColor(palette[i])
draw2d.Circle(gc, float64(45 * i + 50), float64(50 + 100 * row), 40)
gc.FillStroke()
}
}
png.Encode(w, img)
2. View the resulting PNG file
What is the expected output?
Two rows of intersecting circles, top row with borders, bottom row without
borders, nicely anti-aliased at the edges.
What do you see instead?
AA is broken between certain colors.
What version of the product are you using? On what operating system?
Rev db69b22ef193, with freetype-go at rev fc42a8016807. Go release 60.2 (as
part of app-engine SDK 1.5.5)
Attaching the resulting PNG file.
Original issue reported on code.google.com by [email protected]
on 21 Oct 2011 at 5:27
Attachments:
PDF GraphicContext using this project https://bitbucket.org/zombiezen/gopdf/
Original issue reported on code.google.com by [email protected]
on 16 Apr 2012 at 7:44
What steps will reproduce the problem?
make install
What is the expected output? What do you see instead?
paint.go:49: nrgba.RGBA undefined (type uint8 has no field or method RGBA)
paint.go:59: cannot use struct literal (type image.NRGBAColor) as type uint8 in
assignment
paint.go:63: nrgba.RGBA undefined (type uint8 has no field or method RGBA)
paint.go:73: cannot use struct literal (type image.NRGBAColor) as type uint8 in
assignment
make[1]: *** [_go_.6] Error 1
make[1]: Leaving directory `/home/zzzzrrr/workspace/draw2d/draw2d'
make: *** [install] Error 2
What version of the product are you using? On what operating system?
Ubuntu x64
6g version weekly.2011-07-29 9332
Original issue reported on code.google.com by [email protected]
on 4 Aug 2011 at 10:15
What steps will reproduce the problem?
-- not applicable --
Please provide any additional information below.
This document shouldn't be in the repository.
http://code.google.com/p/draw2d/source/browse/doc/PLRM.pdf
Please check out the copyrights page included in it.
Original issue reported on code.google.com by [email protected]
on 24 Oct 2011 at 3:02
PathStorage.{RQuadCurveTo, RCubicCurveTo, and RArcTo} call themselves rather
than their absolute counterparts.
Original issue reported on code.google.com by [email protected]
on 12 Mar 2011 at 9:20
These pages have out of date installation/package location information:
* http://code.google.com/p/draw2d/
* http://code.google.com/p/draw2d/wiki/GettingStarted
Original issue reported on code.google.com by [email protected]
on 24 Apr 2012 at 5:24
Is there a way to do clipping?
Original issue reported on code.google.com by [email protected]
on 16 Apr 2012 at 6:07
philip@philip-VirtualBox:~$ sudo goinstall -v draw2d.googlecode.com/hg/draw2d
goinstall: image/draw: skipping standard library
goinstall: code.google.com/p/freetype-go/freetype/truetype: download
goinstall: code.google.com/p/freetype-go/freetype/truetype: cannot download:
code.google.com/p/freetype-go/freetype/truetype ($GOPATH not set)
goinstall: image: skipping standard library
goinstall: code.google.com/p/freetype-go/freetype: download
goinstall: code.google.com/p/freetype-go/freetype: cannot download:
code.google.com/p/freetype-go/freetype ($GOPATH not set)
goinstall: code.google.com/p/freetype-go/freetype/raster: download
goinstall: code.google.com/p/freetype-go/freetype/raster: cannot download:
code.google.com/p/freetype-go/freetype/raster ($GOPATH not set)
goinstall: image/color: go/build: package could not be found locally ($GOPATH
not set)
goinstall: log: skipping standard library
goinstall: math: skipping standard library
goinstall: path: skipping standard library
goinstall: fmt: skipping standard library
goinstall: io/ioutil: skipping standard library
philip@philip-VirtualBox:~$
Original issue reported on code.google.com by [email protected]
on 4 Mar 2012 at 11:02
What steps will reproduce the problem?
In environments like AppEngine or Heroku, we can't rely on file system access
being available to the web app always. Trying to use fonts gives go runtime
error of unable to access file resource
What is the expected output? What do you see instead?
If we can have generic versions of the Font functions that can be passed font
file data as a byte slice OR a Reader, we can use the font functions in
environments where file access is not available.
Original issue reported on code.google.com by [email protected]
on 17 Nov 2013 at 4:21
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.