Documentation
¶
Overview ¶
Package draw2d is a pure go 2D vector graphics library with support for multiple output devices such as images (draw2d), pdf documents (draw2dpdf) and opengl (draw2dgl), which can also be used on the google app engine. It can be used as a pure go Cairo alternative. draw2d is released under the BSD license.
Features ¶
Operations in draw2d include stroking and filling polygons, arcs, Bézier curves, drawing images and text rendering with truetype fonts. All drawing operations can be transformed by affine transformations (scale, rotation, translation).
Package draw2d follows the conventions of http://www.w3.org/TR/2dcontext for coordinate system, angles, etc...
Installation ¶
To install or update the package draw2d on your system, run:
go get -u github.com/novvoo/draw2d
Quick Start ¶
Package draw2d itself provides a graphic context that can draw vector graphics and text on an image canvas. The following Go code generates a simple drawing and saves it to an image file:
package main
import (
"github.com/novvoo/draw2d/draw2dimg"
"image"
"image/color"
)
func main() {
// Initialize the graphic context on an RGBA image
dest := image.NewRGBA(image.Rect(0, 0, 297, 210.0))
gc := draw2dimg.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
draw2dimg.SaveToPngFile("hello.png", dest)
}
There are more examples here: https://github.com/novvoo/draw2d/tree/master/samples
Drawing on pdf documents is provided by the draw2dpdf package. Drawing on opengl is provided by the draw2dgl package. See subdirectories at the bottom of this page.
Testing ¶
The samples are run as tests from the root package folder `draw2d` by:
go test ./...
Or if you want to run with test coverage:
go test -cover ./... | grep -v "no test"
This will generate output by the different backends in the output folder.
Acknowledgments ¶
Laurent Le Goff wrote this library, inspired by Postscript and HTML5 canvas. He implemented the image and opengl backend with the freetype-go package. Also he created a pure go Postscript interpreter, which can read postscript images and draw to a draw2d graphic context (https://github.com/llgcode/ps). Stani Michiels implemented the pdf backend with the gofpdf package.
Packages using draw2d ¶
- https://github.com/llgcode/ps: Postscript interpreter written in Go
- https://github.com/gonum/plot: drawing plots in Go
- https://github.com/muesli/smartcrop: content aware image cropping
- https://github.com/peterhellberg/karta: drawing Voronoi diagrams
- https://github.com/vdobler/chart: basic charts in Go
Index ¶
- Constants
- func FontFileName(fontData FontData) string
- func GetAlignmentOffset(alignment TextAlignment, fontMetrics FontMetrics) float64
- func GetFont(fontData FontData) (font *truetype.Font)
- func GetFontFolder() string
- func RegisterFont(fontData FontData, font *truetype.Font)
- func SetFontCache(cache FontCache)
- func SetFontFolder(folder string)
- func SetFontNamer(fn FontFileNamer)
- type FillRule
- type FolderFontCache
- type FontCache
- type FontData
- type FontFamily
- type FontFileNamer
- type FontMetrics
- type FontStyle
- type GlyphExtractor
- type GlyphMetrics
- type GlyphTransform
- type GraphicContext
- type Halign
- type HintingMode
- type ImageScaling
- type LineCap
- type LineJoin
- type Matrix
- func (tr *Matrix) Compose(trToCompose Matrix)
- func (tr Matrix) Copy() Matrix
- func (tr Matrix) Determinant() float64
- func (tr1 Matrix) Equals(tr2 Matrix) bool
- func (tr Matrix) GetScale() float64
- func (tr Matrix) GetScaling() (x, y float64)
- func (tr Matrix) GetTranslation() (x, y float64)
- func (tr *Matrix) Inverse()
- func (tr Matrix) InverseTransform(points []float64)
- func (tr Matrix) InverseTransformPoint(x, y float64) (xres, yres float64)
- func (tr Matrix) IsIdentity() bool
- func (tr Matrix) IsTranslation() bool
- func (tr *Matrix) Rotate(angle float64)
- func (tr *Matrix) Scale(sx, sy float64)
- func (tr Matrix) Transform(points []float64)
- func (tr Matrix) TransformPoint(x, y float64) (xres, yres float64)
- func (tr Matrix) TransformRectangle(x0, y0, x2, y2 float64) (nx0, ny0, nx2, ny2 float64)
- func (tr *Matrix) Translate(tx, ty float64)
- func (tr Matrix) VectorTransform(points []float64)
- type Path
- func (p *Path) ArcTo(cx, cy, rx, ry, startAngle, angle float64)
- func (p *Path) Clear()
- func (p *Path) Close()
- func (p *Path) Copy() (dest *Path)
- func (p *Path) CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64)
- func (p *Path) IsEmpty() bool
- func (p *Path) LastPoint() (x, y float64)
- func (p *Path) LineTo(x, y float64)
- func (p *Path) MoveTo(x, y float64)
- func (p *Path) QuadCurveTo(cx, cy, x, y float64)
- func (p *Path) String() string
- func (path *Path) VerticalFlip() *Path
- type PathBuilder
- type PathCmp
- type ScalingPolicy
- type SolidFillStyle
- type StrokeStyle
- type SyncFolderFontCache
- type TextAlignment
- type TextMetrics
- type TextStyle
- type Valign
Constants ¶
const ( // HalignLeft Horizontally align to left HalignLeft = iota // HalignCenter Horizontally align to center HalignCenter // HalignRight Horizontally align to right HalignRight )
Variables ¶
This section is empty.
Functions ¶
func FontFileName ¶
func GetAlignmentOffset ¶
func GetAlignmentOffset(alignment TextAlignment, fontMetrics FontMetrics) float64
GetAlignmentOffset calculates the Y offset for a given text alignment
func GetFontFolder ¶
func GetFontFolder() string
func RegisterFont ¶
func SetFontCache ¶
func SetFontCache(cache FontCache)
Changes the font cache backend used by the package. After calling this functionSetFontFolder and SetFontNamer will not affect anymore how fonts are loaded. To restore the default font cache, call this function passing nil as argument.
func SetFontFolder ¶
func SetFontFolder(folder string)
func SetFontNamer ¶
func SetFontNamer(fn FontFileNamer)
Types ¶
type FillRule ¶
type FillRule int
FillRule defines the type for fill rules
const ( // FillRuleEvenOdd determines the "insideness" of a point in the shape // by drawing a ray from that point to infinity in any direction // and counting the number of path segments from the given shape that the ray crosses. // If this number is odd, the point is inside; if even, the point is outside. FillRuleEvenOdd FillRule = iota // FillRuleWinding determines the "insideness" of a point in the shape // by drawing a ray from that point to infinity in any direction // and then examining the places where a segment of the shape crosses the ray. // Starting with a count of zero, add one each time a path segment crosses // the ray from left to right and subtract one each time // a path segment crosses the ray from right to left. After counting the crossings, // if the result is zero then the point is outside the path. Otherwise, it is inside. FillRuleWinding )
type FolderFontCache ¶
type FolderFontCache struct {
// contains filtered or unexported fields
}
FolderFontCache can Load font from folder
func NewFolderFontCache ¶
func NewFolderFontCache(folder string) *FolderFontCache
NewFolderFontCache creates FolderFontCache
type FontCache ¶
type FontCache interface {
// Loads a truetype font represented by the FontData object passed as
// argument.
// The method returns an error if the font could not be loaded, either
// because it didn't exist or the resource it was loaded from was corrupted.
Load(FontData) (*truetype.Font, error)
// Sets the truetype font that will be returned by Load when given the font
// data passed as first argument.
Store(FontData, *truetype.Font)
}
Types implementing this interface can be passed to SetFontCache to change the way fonts are being stored and retrieved.
func GetGlobalFontCache ¶
func GetGlobalFontCache() FontCache
type FontData ¶
type FontData struct {
Name string
Family FontFamily
Style FontStyle
}
type FontFamily ¶
type FontFamily byte
const ( FontFamilySans FontFamily = iota FontFamilySerif FontFamilyMono )
type FontFileNamer ¶
type FontMetrics ¶
type FontMetrics struct {
// Ascent is the distance from the baseline to the highest point
// typically used by glyphs in the font
Ascent float64
// Descent is the distance from the baseline to the lowest point
// typically used by glyphs (negative value)
Descent float64
// Height is the recommended line spacing (ascent - descent + linegap)
Height float64
// MaxAdvance is the maximum advance width for all glyphs
MaxAdvance float64
// UnderlinePosition is the position of the underline
UnderlinePosition float64
// UnderlineThickness is the thickness of the underline
UnderlineThickness float64
// CapHeight is the height of capital letters
CapHeight float64
// XHeight is the height of lowercase 'x'
XHeight float64
// LineGap is the recommended additional spacing between lines
LineGap float64
}
FontMetrics contains global font metrics
type FontStyle ¶
type FontStyle byte
FontStyle defines bold and italic styles for the font It is possible to combine values for mixed styles, eg.
FontData.Style = FontStyleBold | FontStyleItalic
type GlyphExtractor ¶
type GlyphExtractor struct {
// contains filtered or unexported fields
}
GlyphExtractor extracts detailed glyph metrics from TrueType fonts
func NewGlyphExtractor ¶
func NewGlyphExtractor(ttFont *truetype.Font, size float64, dpi int, hintMode HintingMode) *GlyphExtractor
NewGlyphExtractor creates a new glyph extractor
func (*GlyphExtractor) GetFontMetrics ¶
func (ge *GlyphExtractor) GetFontMetrics() FontMetrics
GetFontMetrics returns global font metrics
func (*GlyphExtractor) GetGlyphMetrics ¶
func (ge *GlyphExtractor) GetGlyphMetrics(r rune) (*GlyphMetrics, error)
GetGlyphMetrics returns detailed metrics for a specific glyph
func (*GlyphExtractor) GetKerning ¶
func (ge *GlyphExtractor) GetKerning(r1, r2 rune) float64
GetKerning returns the kerning adjustment between two runes
func (*GlyphExtractor) GetTextMetrics ¶
func (ge *GlyphExtractor) GetTextMetrics(text string) (*TextMetrics, error)
GetTextMetrics calculates metrics for a text string with kerning
type GlyphMetrics ¶
type GlyphMetrics struct {
// Width is the horizontal distance from the origin to the point where
// the next glyph should be drawn (advance width)
Width float64
// Height is the vertical distance from the origin to the point where
// the next glyph should be drawn for vertical text (advance height)
Height float64
// XBearing is the horizontal distance from the origin to the leftmost
// part of the glyph
XBearing float64
// YBearing is the vertical distance from the origin (baseline) to the
// topmost part of the glyph
YBearing float64
// XAdvance is the horizontal distance to advance for the next glyph
XAdvance float64
// YAdvance is the vertical distance to advance for the next glyph
YAdvance float64
// BoundingBox contains the tight bounding box of the glyph outline
BoundingBox struct {
XMin, YMin float64
XMax, YMax float64
}
// LSB is the left side bearing
LSB float64
// RSB is the right side bearing
RSB float64
}
GlyphMetrics contains detailed metrics for a single glyph Following Cairo's text rendering model
type GlyphTransform ¶
type GlyphTransform struct {
// Matrix is the transformation matrix [xx, xy, yx, yy, x0, y0]
Matrix Matrix
// OffsetX is additional X offset
OffsetX float64
// OffsetY is additional Y offset
OffsetY float64
}
GlyphTransform represents transformation matrix for individual glyphs
func NewGlyphTransform ¶
func NewGlyphTransform() GlyphTransform
NewGlyphTransform creates a new identity glyph transform
func (*GlyphTransform) Rotate ¶
func (gt *GlyphTransform) Rotate(angle float64)
Rotate applies rotation to the glyph transform (angle in radians)
func (*GlyphTransform) Scale ¶
func (gt *GlyphTransform) Scale(sx, sy float64)
Scale applies scaling to the glyph transform
func (*GlyphTransform) Translate ¶
func (gt *GlyphTransform) Translate(tx, ty float64)
Translate applies translation to the glyph transform
type GraphicContext ¶
type GraphicContext interface {
// PathBuilder describes the interface for path drawing
PathBuilder
// BeginPath creates a new path
BeginPath()
// GetPath copies the current path, then returns it
GetPath() Path
// GetMatrixTransform returns the current transformation matrix
GetMatrixTransform() Matrix
// SetMatrixTransform sets the current transformation matrix
SetMatrixTransform(tr Matrix)
// ComposeMatrixTransform composes the current transformation matrix with tr
ComposeMatrixTransform(tr Matrix)
// Rotate applies a rotation to the current transformation matrix. angle is in radian.
Rotate(angle float64)
// Translate applies a translation to the current transformation matrix.
Translate(tx, ty float64)
// Scale applies a scale to the current transformation matrix.
Scale(sx, sy float64)
// SetStrokeColor sets the current stroke color
SetStrokeColor(c color.Color)
// SetFillColor sets the current fill color
SetFillColor(c color.Color)
// SetFillRule sets the current fill rule
SetFillRule(f FillRule)
// SetLineWidth sets the current line width
SetLineWidth(lineWidth float64)
// SetLineCap sets the current line cap
SetLineCap(cap LineCap)
// SetLineJoin sets the current line join
SetLineJoin(join LineJoin)
// SetLineDash sets the current dash
SetLineDash(dash []float64, dashOffset float64)
// SetFontSize sets the current font size
SetFontSize(fontSize float64)
// GetFontSize gets the current font size
GetFontSize() float64
// SetFontData sets the current FontData
SetFontData(fontData FontData)
// GetFontData gets the current FontData
GetFontData() FontData
// GetFontName gets the current FontData as a string
GetFontName() string
// DrawImage draws the raster image in the current canvas
DrawImage(image image.Image)
// Save the context and push it to the context stack
Save()
// Restore remove the current context and restore the last one
Restore()
// Clear fills the current canvas with a default transparent color
Clear()
// ClearRect fills the specified rectangle with a default transparent color
ClearRect(x1, y1, x2, y2 int)
// SetDPI sets the current DPI
SetDPI(dpi int)
// GetDPI gets the current DPI
GetDPI() int
// GetStringBounds gets pixel bounds(dimensions) of given string
GetStringBounds(s string) (left, top, right, bottom float64)
// CreateStringPath creates a path from the string s at x, y
CreateStringPath(text string, x, y float64) (cursor float64)
// FillString draws the text at point (0, 0)
FillString(text string) (cursor float64)
// FillStringAt draws the text at the specified point (x, y)
FillStringAt(text string, x, y float64) (cursor float64)
// StrokeString draws the contour of the text at point (0, 0)
StrokeString(text string) (cursor float64)
// StrokeStringAt draws the contour of the text at point (x, y)
StrokeStringAt(text string, x, y float64) (cursor float64)
// SetTextAlignment sets the vertical text alignment mode
SetTextAlignment(alignment TextAlignment)
// GetTextAlignment gets the current text alignment mode
GetTextAlignment() TextAlignment
// SetHintingMode sets the font hinting mode
SetHintingMode(mode HintingMode)
// GetHintingMode gets the current font hinting mode
GetHintingMode() HintingMode
// GetFontMetrics returns the current font metrics
GetFontMetrics() FontMetrics
// GetTextMetrics returns metrics for the given text string
GetTextMetrics(text string) (*TextMetrics, error)
// GetGlyphMetrics returns metrics for a specific rune
GetGlyphMetrics(r rune) (*GlyphMetrics, error)
// SetGlyphTransform sets the transformation matrix for individual glyphs
SetGlyphTransform(transform GlyphTransform)
// GetGlyphTransform gets the current glyph transformation
GetGlyphTransform() GlyphTransform
// ResetGlyphTransform resets the glyph transformation to identity
ResetGlyphTransform()
// Stroke strokes the paths with the color specified by SetStrokeColor
Stroke(paths ...*Path)
// Fill fills the paths with the color specified by SetFillColor
Fill(paths ...*Path)
// FillStroke first fills the paths and than strokes them
FillStroke(paths ...*Path)
}
GraphicContext describes the interface for the various backends (images, pdf, opengl, ...)
type HintingMode ¶
type HintingMode int
HintingMode specifies the type of font hinting to use
const ( // HintingNone disables hinting HintingNone HintingMode = iota // HintingVertical enables vertical hinting only HintingVertical // HintingFull enables full hinting HintingFull )
type ImageScaling ¶
type ImageScaling struct {
// Horizontal Alignment of the image
Halign Halign
// Vertical Alignment of the image
Valign Valign
// Width Height used by scaling policy
Width, Height float64
// ScalingPolicy defines the scaling policy to applied to the image
ScalingPolicy ScalingPolicy
}
ImageScaling style attributes used to display the image
type Matrix ¶
type Matrix [6]float64
Matrix represents an affine transformation
func NewIdentityMatrix ¶
func NewIdentityMatrix() Matrix
NewIdentityMatrix creates an identity transformation matrix.
func NewMatrixFromRects ¶
NewMatrixFromRects creates a transformation matrix, combining a scale and a translation, that transform rectangle1 into rectangle2.
func NewRotationMatrix ¶
NewRotationMatrix creates a rotation transformation matrix. angle is in radian
func NewScaleMatrix ¶
NewScaleMatrix creates a transformation matrix with a sx, sy scale factor
func NewTranslationMatrix ¶
NewTranslationMatrix creates a transformation matrix with a translation tx and ty translation parameter
func (Matrix) Determinant ¶
Determinant compute the determinant of the matrix
func (Matrix) Equals ¶
Equals tests if a two transformation are equal. A tolerance is applied when comparing matrix elements.
func (Matrix) InverseTransform ¶
InverseTransform applies the transformation inverse matrix to the rectangle represented by the min and the max point of the rectangle
func (Matrix) InverseTransformPoint ¶
InverseTransformPoint applies the transformation inverse matrix to point. It returns the point the transformed point.
func (Matrix) IsIdentity ¶
IsIdentity tests if a transformation is the identity transformation. A tolerance is applied when comparing matrix elements.
func (Matrix) IsTranslation ¶
IsTranslation tests if a transformation is is a pure translation. A tolerance is applied when comparing matrix elements.
func (Matrix) Transform ¶
Transform applies the transformation matrix to points. It modify the points passed in parameter.
func (Matrix) TransformPoint ¶
TransformPoint applies the transformation matrix to point. It returns the point the transformed point.
func (Matrix) TransformRectangle ¶
Transform applies the transformation matrix to the rectangle represented by the min and the max point of the rectangle
func (Matrix) VectorTransform ¶
VectorTransform applies the transformation matrix to points without using the translation parameter of the affine matrix. It modify the points passed in parameter.
type Path ¶
type Path struct {
// Components is a slice of PathCmp in a Path and mark the role of each points in the Path
Components []PathCmp
// Points are combined with Components to have a specific role in the path
Points []float64
// contains filtered or unexported fields
}
Path stores points
func (*Path) CubicCurveTo ¶
CubicCurveTo adds a cubic bezier curve to the current path
func (*Path) QuadCurveTo ¶
QuadCurveTo adds a quadratic bezier curve to the current path
func (*Path) VerticalFlip ¶
Returns new Path with flipped y axes
type PathBuilder ¶
type PathBuilder interface {
// LastPoint returns the current point of the current sub path
LastPoint() (x, y float64)
// MoveTo creates a new subpath that start at the specified point
MoveTo(x, y float64)
// LineTo adds a line to the current subpath
LineTo(x, y float64)
// QuadCurveTo adds a quadratic Bézier curve to the current subpath
QuadCurveTo(cx, cy, x, y float64)
// CubicCurveTo adds a cubic Bézier curve to the current subpath
CubicCurveTo(cx1, cy1, cx2, cy2, x, y float64)
// ArcTo adds an arc to the current subpath
ArcTo(cx, cy, rx, ry, startAngle, angle float64)
// Close creates a line from the current point to the last MoveTo
// point (if not the same) and mark the path as closed so the
// first and last lines join nicely.
Close()
}
PathBuilder describes the interface for path drawing.
type PathCmp ¶
type PathCmp int
PathCmp represents component of a path
const ( // MoveToCmp is a MoveTo component in a Path MoveToCmp PathCmp = iota // LineToCmp is a LineTo component in a Path LineToCmp // QuadCurveToCmp is a QuadCurveTo component in a Path QuadCurveToCmp // CubicCurveToCmp is a CubicCurveTo component in a Path CubicCurveToCmp // ArcToCmp is a ArcTo component in a Path ArcToCmp // CloseCmp is a ArcTo component in a Path CloseCmp )
type ScalingPolicy ¶
type ScalingPolicy int
ScalingPolicy is a constant to define how to scale an image
const ( // ScalingNone no scaling applied ScalingNone ScalingPolicy = iota // ScalingStretch the image is stretched so that its width and height are exactly the given width and height ScalingStretch // ScalingWidth the image is scaled so that its width is exactly the given width ScalingWidth // ScalingHeight the image is scaled so that its height is exactly the given height ScalingHeight // ScalingFit the image is scaled to the largest scale that allow the image to fit within a rectangle width x height ScalingFit // ScalingSameArea the image is scaled so that its area is exactly the area of the given rectangle width x height ScalingSameArea // ScalingFill the image is scaled to the smallest scale that allow the image to fully cover a rectangle width x height ScalingFill )
type SolidFillStyle ¶
type SolidFillStyle struct {
// Color defines the line color
Color color.Color
// FillRule defines the file rule to used
FillRule FillRule
}
SolidFillStyle define style attributes for a solid fill style
type StrokeStyle ¶
type StrokeStyle struct {
// Color defines the color of stroke
Color color.Color
// Line width
Width float64
// Line cap style rounded, butt or square
LineCap LineCap
// Line join style bevel, round or miter
LineJoin LineJoin
// offset of the first dash
DashOffset float64
// array represented dash length pair values are plain dash and impair are space between dash
// if empty display plain line
Dash []float64
}
StrokeStyle keeps stroke style attributes that is used by the Stroke method of a Drawer
type SyncFolderFontCache ¶
SyncFolderFontCache can Load font from folder
func NewSyncFolderFontCache ¶
func NewSyncFolderFontCache(folder string) *SyncFolderFontCache
NewSyncFolderFontCache creates SyncFolderFontCache
type TextAlignment ¶
type TextAlignment int
TextAlignment specifies vertical text alignment
const ( // AlignBaseline aligns text on the baseline (default) AlignBaseline TextAlignment = iota // AlignTop aligns text to the top of the em square AlignTop // AlignBottom aligns text to the bottom of the em square AlignBottom // AlignMiddle aligns text to the vertical middle AlignMiddle // AlignCapHeight aligns text to the cap height AlignCapHeight // AlignXHeight aligns text to the x-height AlignXHeight )
type TextMetrics ¶
type TextMetrics struct {
// XBearing is the horizontal distance from the origin to the leftmost
// part of the text
XBearing float64
// YBearing is the vertical distance from the origin to the topmost
// part of the text
YBearing float64
// Width is the width of the text bounding box
Width float64
// Height is the height of the text bounding box
Height float64
// XAdvance is the horizontal distance to advance after drawing the text
XAdvance float64
// YAdvance is the vertical distance to advance after drawing the text
YAdvance float64
}
TextMetrics contains metrics for a text string
Directories
¶
| Path | Synopsis |
|---|---|
|
Package draw2dgl provides a graphic context that can draw vector graphics and text on OpenGL.
|
Package draw2dgl provides a graphic context that can draw vector graphics and text on OpenGL. |
|
Package draw2dkit provides helpers to draw common figures using a Path
|
Package draw2dkit provides helpers to draw common figures using a Path |
|
Package draw2dpdf provides a graphic context that can draw vector graphics and text on pdf file with the gofpdf package.
|
Package draw2dpdf provides a graphic context that can draw vector graphics and text on pdf file with the gofpdf package. |
|
Package draw2svg provides a graphic context that can draw vector graphics and text on svg file.
|
Package draw2svg provides a graphic context that can draw vector graphics and text on svg file. |
|
Package samples provides examples which can be used with different backends.
|
Package samples provides examples which can be used with different backends. |
|
android
Package android draws an android avatar.
|
Package android draws an android avatar. |
|
frameimage
Package frameimage centers a png image and rotates it.
|
Package frameimage centers a png image and rotates it. |
|
geometry
Package geometry draws some geometric tests.
|
Package geometry draws some geometric tests. |
|
glyph_metrics
command
Cairo-style glyph metrics example
|
Cairo-style glyph metrics example |
|
gopher
Package gopher draws a gopher avatar based on a svg of: https://github.com/golang-samples/gopher-vector/
|
Package gopher draws a gopher avatar based on a svg of: https://github.com/golang-samples/gopher-vector/ |
|
gopher2
Package gopher2 draws a gopher avatar based on a svg of: https://github.com/golang-samples/gopher-vector/
|
Package gopher2 draws a gopher avatar based on a svg of: https://github.com/golang-samples/gopher-vector/ |
|
helloworld
Package helloworld displays multiple "Hello World" (one rotated) in a rounded rectangle.
|
Package helloworld displays multiple "Hello World" (one rotated) in a rounded rectangle. |
|
helloworldgl
command
Open an OpenGl window and display a rectangle using a OpenGl GraphicContext
|
Open an OpenGl window and display a rectangle using a OpenGl GraphicContext |
|
line
Package line draws vertically spaced lines.
|
Package line draws vertically spaced lines. |
|
linecapjoin
Package linecapjoin demonstrates the different line caps and joins.
|
Package linecapjoin demonstrates the different line caps and joins. |
|
postscript
Package postscript reads the tiger.ps file and draws it to a backend.
|
Package postscript reads the tiger.ps file and draws it to a backend. |
|
postscriptgl
command
Open a OpenGL window and display a tiger interpreting a postscript file
|
Open a OpenGL window and display a tiger interpreting a postscript file |

