Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/tdewolff/canvas
/ functions
Functions
1,447 in github.com/tdewolff/canvas
⨍
Functions
1,447
◇
Types & classes
214
↓ 3 callers
Function
LoadFont
LoadFont loads a font from memory.
font.go:274
↓ 3 callers
Function
LoadFontFile
LoadFontFile loads a font from a file.
font.go:254
↓ 3 callers
Method
Markers
Markers returns an array of start, mid and end marker paths along the path at the coordinates between commands. Align will align the markers with the
path.go:1548
↓ 3 callers
Method
Neg
Neg negates x and y.
util.go:255
↓ 3 callers
Function
New
New returns an PostScript renderer.
renderers/ps/ps.go:49
↓ 3 callers
Function
NewCrossHatch
NewCrossHatch returns a new cross hatch pattern of two regular line hatches at different angles and with different distance intervals. Thickness is th
patterns.go:149
↓ 3 callers
Function
NewHatchPattern
NewHatchPattern returns a new hatch pattern.
patterns.go:58
↓ 3 callers
Function
NewShapeHatch
NewShapeHatch returns a new shape hatch that repeats the given shape over a rhombus primitive cell with sides of length distance. Thickness is the str
patterns.go:169
↓ 3 callers
Function
ParseLaTeX
ParseLaTeX parse a LaTeX formula (that what is between $...$) and returns a path.
latex.go:75
↓ 3 callers
Method
Pop
Pop restores the last pushed draw state and uses that as the current draw state. If there are no states on the stack, this will do nothing.
canvas.go:281
↓ 3 callers
Method
Pop
Pop restores the context saved by the corresponding call to Push().
renderers/gonumplot.go:107
↓ 3 callers
Method
Pos
()
cmd/pdftext/util.go:95
↓ 3 callers
Method
Push
Push saves the current line width, the current dash pattern, the current transforms, and the current color onto a stack so that the state can later be
renderers/gonumplot.go:101
↓ 3 callers
Method
RayIntersections
RayIntersections returns the intersections of a path with a ray starting at (x,y) to (∞,y). An intersection is tangent only when it is at (x,y), i.e.
path_intersection.go:24
↓ 3 callers
Method
Reverse
()
path_intersection.go:333
↓ 3 callers
Method
Save
Save writes the image to the given writer.
renderers/gochart.go:221
↓ 3 callers
Method
Scale
Scale scales the view.
canvas.go:378
↓ 3 callers
Function
ScriptItemizer
ScriptItemizer divides the string in parts for each different script. Also separates on different embedding levels and unicode.ReplacementChar (replac
text/text.go:21
↓ 3 callers
Method
SetCoordView
SetCoordView sets the current affine transformation matrix for coordinates. Coordinate transformation are applied before View transformations. See `Ma
canvas.go:313
↓ 3 callers
Method
SetDashes
SetDashes sets the dash pattern to be used for stroking operations. The dash offset denotes the offset into the dash array in millimeters from where t
canvas.go:473
↓ 3 callers
Method
SetFill
SetFill sets the color, gradient, or pattern to be used for filling operations. The default fill color is black.
canvas.go:398
↓ 3 callers
Method
StartPos
StartPos returns the start point of the current subpath, i.e. it returns the position of the last MoveTo command.
path.go:374
↓ 3 callers
Method
String
String returns a string that represents the path similar to the SVG path data format (but not necessarily valid SVG).
path.go:2257
↓ 3 callers
Method
String
()
renderers/ps/ps.go:285
↓ 3 callers
Method
String
()
renderers/svg/util.go:16
↓ 3 callers
Method
ToPDF
ToPDF returns a string that represents the path in the PDF data format.
path.go:2427
↓ 3 callers
Method
ToPS
ToPS returns a string that represents the path in the PostScript data format.
path.go:2374
↓ 3 callers
Method
Transform
Transform transforms the rectangle by affine transformation matrix m and returns the new bounds of that rectangle.
util.go:438
↓ 3 callers
Method
Values
Values returns the current path segment values.
path_scanner.go:36
↓ 3 callers
Method
WalkSpans
WalkSpans calls the callback for each text span per line.
text.go:1219
↓ 3 callers
Method
Width
Width returns the width of the canvas in millimeters.
canvas.go:259
↓ 3 callers
Method
WritePath
WritePath writes an inline path.
text.go:551
↓ 3 callers
Function
_filePath
(dir, name string)
examples/html-canvas/files.go:327
↓ 3 callers
Method
_resume
()
examples/html-canvas/wasm_exec.js:541
↓ 3 callers
Method
balance
func (a *SweepNode) swap(b *SweepNode) { a.SweepPoint, b.SweepPoint = b.SweepPoint, a.SweepPoint a.SweepPoint.node, b.SweepPoint.node = a, b } func
path_intersection.go:610
↓ 3 callers
Method
breakupSegment
func (event *SweepPoint) insertIntoSortedH(events *[]*SweepPoint) { // O(log n) lo, hi := 0, len(*events) for lo < hi { mid := (lo + hi) / 2 if
path_intersection.go:1459
↓ 3 callers
Function
cohenSutherlandLineClip
return whether line is inside the rectangle, either entirely or partially.
util.go:903
↓ 3 callers
Method
curvature
curvature returns the curvature of the path at the given index into Path.d and t in [0.0,1.0]. Path must not contain subpaths, and will return the pat
path.go:785
↓ 3 callers
Function
dashCanonical
dashCanonical returns an optimized dash array.
path.go:1781
↓ 3 callers
Method
down
(i0, n int)
path_intersection.go:484
↓ 3 callers
Method
down
(i0, n int)
path_simplify.go:276
↓ 3 callers
Function
drawCJK
(ctx *canvas.Context, x, y float64, title string, mode canvas.WritingMode, orient canvas.TextOrientation)
resources/docs/text/main.go:122
↓ 3 callers
Function
drawControl
(c *canvas.Context, x, y float64)
resources/docs/paths/main.go:30
↓ 3 callers
Function
ellipseLength
ellipseLength calculates the length of the elliptical arc it uses Gauss-Legendre (n=5) and has an error of ~1% or less (empirical)
path_util.go:54
↓ 3 callers
Function
findInflectionPointRangeCubicBezier
(p0, p1, p2, p3 Point, t, tolerance float64)
path_util.go:842
↓ 3 callers
Function
flattenCubicBezier
(p0, p1, p2, p3 Point, tolerance float64)
path_util.go:774
↓ 3 callers
Method
heights
(mode WritingMode)
font.go:721
↓ 3 callers
Function
interpolate
(a, b, t float64)
palettes.go:80
↓ 3 callers
Function
interpolateGradient
(y float64, points [][4]float64)
palettes.go:84
↓ 3 callers
Function
intersectionLineLine
(zs Intersections, a0, a1, b0, b1 Point)
path_intersection_util.go:298
↓ 3 callers
Function
lab_finv
(t float64)
palettes.go:37
↓ 3 callers
Method
less
(i, j int)
path_simplify.go:255
↓ 3 callers
Function
loadFont
(name string, style FontStyle)
preview.go:15
↓ 3 callers
Function
newPDFWriter
(writer io.Writer)
renderers/pdf/writer.go:74
↓ 3 callers
Method
optimizeClose
optimizeClose removes a superfluous first line segment in-place of a subpath. If both the first and last segment are line segments and are colinear, m
path.go:598
↓ 3 callers
Method
parsePoints
(v string)
svg.go:279
↓ 3 callers
Method
parseStyle
(b []byte)
svg.go:772
↓ 3 callers
Function
pdfValContinuesName
(val any)
renderers/pdf/writer.go:165
↓ 3 callers
Function
plotPathLengthParametrization
(filename string, N int, speed, length func(float64) float64, tmin, tmax float64)
path_test.go:863
↓ 3 callers
Function
quadraticBezierLength
return the normal at the right-side of the curve (when increasing t) func quadraticBezierNormal(p0, p1, p2 Point, t, d float64) Point { if t == 0.0 {
path_util.go:490
↓ 3 callers
Function
readNumberLE
(b []byte, n int)
cmd/pdftext/util.go:177
↓ 3 callers
Method
readString
(n int)
latex_dvi.go:356
↓ 3 callers
Method
readUint16
()
latex_dvi.go:304
↓ 3 callers
Method
renderLineTo
(r Renderer, m Matrix, resolution Resolution, index int, renderText, renderDeco bool)
text.go:1257
↓ 3 callers
Method
setAttribute
(key, val string)
svg.go:891
↓ 3 callers
Method
swap
(i, j int)
path_simplify.go:259
↓ 3 callers
Method
textWidth
(glyphs []text.Glyph)
font.go:709
↓ 3 callers
Function
toI26_6
(f float64)
util.go:218
↓ 3 callers
Function
toNRGBA
(col color.Color)
renderers/gio/gio.go:166
↓ 3 callers
Method
toPath
(glyphs []text.Glyph, ppem uint16)
font.go:740
↓ 3 callers
Method
toStyle
(paint canvas.Paint)
renderers/htmlcanvas/htmlcanvas.go:69
↓ 3 callers
Function
xmonotoneCubicBezier
(p0, p1, p2, p3 Point)
path_util.go:746
↓ 3 callers
Function
xmonotoneEllipticArc
(start Point, rx, ry, phi float64, large, sweep bool, end Point)
path_util.go:315
↓ 2 callers
Method
Append
(item *itemVW)
path_simplify.go:229
↓ 2 callers
Function
Asset
Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.
examples/html-canvas/files.go:165
↓ 2 callers
Method
Bounds
Bounds returns the bounding rectangle that defines the text box.
text.go:1098
↓ 2 callers
Method
CP2
CP2 returns the second control point for cubic Béziers.
path_scanner.go:59
↓ 2 callers
Method
CP2
CP2 returns the second control point for cubic Béziers.
path_scanner.go:142
↓ 2 callers
Method
Cap
(*Path, float64, Point, Point)
path_stroke.go:18
↓ 2 callers
Method
Close
Close closes the current path.
canvas.go:531
↓ 2 callers
Method
Close
Close finished the document.
renderers/pdf/writer.go:689
↓ 2 callers
Method
Close
Close finished and closes the SVG.
renderers/svg/svg.go:79
↓ 2 callers
Method
ColorModel
()
renderers/rasterizer/util.go:46
↓ 2 callers
Method
CoordDirections
CoordDirections returns the direction of the segment start/end points. It will return the average direction at the intersection of two end points, and
path.go:750
↓ 2 callers
Method
CoveredBy
CoveredBy is the same as Covers but with the shapes swapped.
path_intersection.go:2487
↓ 2 callers
Method
DrawImage
DrawImage embeds and draws an image.
renderers/pdf/writer.go:1339
↓ 2 callers
Function
DrawPreviewWithAssets
DrawPreviewWithAssets draws the canvas's preview to a Context with assets preloaded.
preview.go:51
↓ 2 callers
Method
Empty
Empty returns true if there are no text lines or text spans.
text.go:1066
↓ 2 callers
Method
Empty
()
util.go:399
↓ 2 callers
Method
Empty
Empty return true if the canvas is empty.
canvas.go:770
↓ 2 callers
Method
FindPrevNext
func (s *SweepStatus) First() *SweepNode { if s.root == nil { return nil } n := s.root for n.left != nil { n = n.left } return n } func (s *
path_intersection.go:839
↓ 2 callers
Method
Fix
(i int)
path_simplify.go:249
↓ 2 callers
Method
InResult
(op pathOp, fillRule FillRule)
path_intersection.go:1674
↓ 2 callers
Method
Init
()
path_intersection.go:440
↓ 2 callers
Method
InsertAfter
func (s *SweepStatus) Insert(item *SweepPoint) *SweepNode { if s.root == nil { s.root = s.newNode(item) return s.root } rebalance := false n,
path_intersection.go:892
↓ 2 callers
Function
IsNewline
(s string)
text/linebreak.go:685
↓ 2 callers
Function
IsParagraph
(s string)
text/linebreak.go:699
↓ 2 callers
Function
IsSpacelessScript
(script Script)
text/text.go:129
↓ 2 callers
Function
IsVerticalScript
(script Script)
text/text.go:134
↓ 2 callers
Method
IsZero
IsZero returns true if P is exactly zero.
util.go:245
← previous
next →
401–500 of 1,447, ranked by callers