-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: arc.go curve/curve_test.go draw2dgl/gc.go draw2dimg/rgba_interpolation.go draw2dpdf/gc.go draw2dpdf/path_converter.go path_adder.go path_storage.go raster/raster_test.go vertex2d.go
- Loading branch information
Showing
47 changed files
with
1,608 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,4 @@ _test* | |
**/*.dll | ||
**/core*[0-9] | ||
.private | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Laurent Le Goff | ||
Laurent Le Goff | ||
Stani Michiels, gmail:stani.be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
draw2d pdf | ||
========== | ||
|
||
Package draw2dpdf provides a graphic context that can draw vector graphics and text on pdf file with the [gofpdf](https://github.com/jung-kurt/gofpdf) package. | ||
|
||
Quick Start | ||
----------- | ||
|
||
The following Go code generates a simple drawing and saves it to a pdf document: | ||
```go | ||
// Initialize the graphic context on an RGBA image | ||
dest := draw2dpdf.NewPdf("L", "mm", "A4") | ||
gc := draw2d.NewGraphicContext(dest) | ||
|
||
// Set some properties | ||
gc.SetFillColor(color.RGBA{0x44, 0xff, 0x44, 0xff}) | ||
gc.SetStrokeColor(color.RGBA{0x44, 0x44, 0x44, 0xff}) | ||
gc.SetLineWidth(5) | ||
|
||
// Draw a closed shape | ||
gc.MoveTo(10, 10) // should always be called first for a new path | ||
gc.LineTo(100, 50) | ||
gc.QuadCurveTo(100, 10, 10, 10) | ||
gc.Close() | ||
gc.FillStroke() | ||
|
||
// Save to file | ||
draw2dpdf.SaveToPdfFile("hello.pdf", dest) | ||
``` | ||
|
||
There are more examples here: https://github.com/llgcode/draw2d/tree/master/samples | ||
|
||
Alternative backends | ||
-------------------- | ||
|
||
- Drawing on images is provided by the draw2d package. | ||
- Drawing on opengl is provided by the draw2dgl package. | ||
|
||
Acknowledgments | ||
--------------- | ||
|
||
The pdf backend uses https://github.com/jung-kurt/gofpdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.