MCPcopy Index your code

hub / github.com/tdewolff/canvas / functions

Functions1,447 in github.com/tdewolff/canvas

↓ 3 callersFunctionLoadFont
LoadFont loads a font from memory.
font.go:274
↓ 3 callersFunctionLoadFontFile
LoadFontFile loads a font from a file.
font.go:254
↓ 3 callersMethodMarkers
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 callersMethodNeg
Neg negates x and y.
util.go:255
↓ 3 callersFunctionNew
New returns an PostScript renderer.
renderers/ps/ps.go:49
↓ 3 callersFunctionNewCrossHatch
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 callersFunctionNewHatchPattern
NewHatchPattern returns a new hatch pattern.
patterns.go:58
↓ 3 callersFunctionNewShapeHatch
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 callersFunctionParseLaTeX
ParseLaTeX parse a LaTeX formula (that what is between $...$) and returns a path.
latex.go:75
↓ 3 callersMethodPop
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 callersMethodPop
Pop restores the context saved by the corresponding call to Push().
renderers/gonumplot.go:107
↓ 3 callersMethodPos
()
cmd/pdftext/util.go:95
↓ 3 callersMethodPush
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 callersMethodRayIntersections
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 callersMethodReverse
()
path_intersection.go:333
↓ 3 callersMethodSave
Save writes the image to the given writer.
renderers/gochart.go:221
↓ 3 callersMethodScale
Scale scales the view.
canvas.go:378
↓ 3 callersFunctionScriptItemizer
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 callersMethodSetCoordView
SetCoordView sets the current affine transformation matrix for coordinates. Coordinate transformation are applied before View transformations. See `Ma
canvas.go:313
↓ 3 callersMethodSetDashes
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 callersMethodSetFill
SetFill sets the color, gradient, or pattern to be used for filling operations. The default fill color is black.
canvas.go:398
↓ 3 callersMethodStartPos
StartPos returns the start point of the current subpath, i.e. it returns the position of the last MoveTo command.
path.go:374
↓ 3 callersMethodString
String returns a string that represents the path similar to the SVG path data format (but not necessarily valid SVG).
path.go:2257
↓ 3 callersMethodString
()
renderers/ps/ps.go:285
↓ 3 callersMethodString
()
renderers/svg/util.go:16
↓ 3 callersMethodToPDF
ToPDF returns a string that represents the path in the PDF data format.
path.go:2427
↓ 3 callersMethodToPS
ToPS returns a string that represents the path in the PostScript data format.
path.go:2374
↓ 3 callersMethodTransform
Transform transforms the rectangle by affine transformation matrix m and returns the new bounds of that rectangle.
util.go:438
↓ 3 callersMethodValues
Values returns the current path segment values.
path_scanner.go:36
↓ 3 callersMethodWalkSpans
WalkSpans calls the callback for each text span per line.
text.go:1219
↓ 3 callersMethodWidth
Width returns the width of the canvas in millimeters.
canvas.go:259
↓ 3 callersMethodWritePath
WritePath writes an inline path.
text.go:551
↓ 3 callersFunction_filePath
(dir, name string)
examples/html-canvas/files.go:327
↓ 3 callersMethod_resume
()
examples/html-canvas/wasm_exec.js:541
↓ 3 callersMethodbalance
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 callersMethodbreakupSegment
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 callersFunctioncohenSutherlandLineClip
return whether line is inside the rectangle, either entirely or partially.
util.go:903
↓ 3 callersMethodcurvature
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 callersFunctiondashCanonical
dashCanonical returns an optimized dash array.
path.go:1781
↓ 3 callersMethoddown
(i0, n int)
path_intersection.go:484
↓ 3 callersMethoddown
(i0, n int)
path_simplify.go:276
↓ 3 callersFunctiondrawCJK
(ctx *canvas.Context, x, y float64, title string, mode canvas.WritingMode, orient canvas.TextOrientation)
resources/docs/text/main.go:122
↓ 3 callersFunctiondrawControl
(c *canvas.Context, x, y float64)
resources/docs/paths/main.go:30
↓ 3 callersFunctionellipseLength
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 callersFunctionfindInflectionPointRangeCubicBezier
(p0, p1, p2, p3 Point, t, tolerance float64)
path_util.go:842
↓ 3 callersFunctionflattenCubicBezier
(p0, p1, p2, p3 Point, tolerance float64)
path_util.go:774
↓ 3 callersMethodheights
(mode WritingMode)
font.go:721
↓ 3 callersFunctioninterpolate
(a, b, t float64)
palettes.go:80
↓ 3 callersFunctioninterpolateGradient
(y float64, points [][4]float64)
palettes.go:84
↓ 3 callersFunctionintersectionLineLine
(zs Intersections, a0, a1, b0, b1 Point)
path_intersection_util.go:298
↓ 3 callersFunctionlab_finv
(t float64)
palettes.go:37
↓ 3 callersMethodless
(i, j int)
path_simplify.go:255
↓ 3 callersFunctionloadFont
(name string, style FontStyle)
preview.go:15
↓ 3 callersFunctionnewPDFWriter
(writer io.Writer)
renderers/pdf/writer.go:74
↓ 3 callersMethodoptimizeClose
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 callersMethodparsePoints
(v string)
svg.go:279
↓ 3 callersMethodparseStyle
(b []byte)
svg.go:772
↓ 3 callersFunctionpdfValContinuesName
(val any)
renderers/pdf/writer.go:165
↓ 3 callersFunctionplotPathLengthParametrization
(filename string, N int, speed, length func(float64) float64, tmin, tmax float64)
path_test.go:863
↓ 3 callersFunctionquadraticBezierLength
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 callersFunctionreadNumberLE
(b []byte, n int)
cmd/pdftext/util.go:177
↓ 3 callersMethodreadString
(n int)
latex_dvi.go:356
↓ 3 callersMethodreadUint16
()
latex_dvi.go:304
↓ 3 callersMethodrenderLineTo
(r Renderer, m Matrix, resolution Resolution, index int, renderText, renderDeco bool)
text.go:1257
↓ 3 callersMethodsetAttribute
(key, val string)
svg.go:891
↓ 3 callersMethodswap
(i, j int)
path_simplify.go:259
↓ 3 callersMethodtextWidth
(glyphs []text.Glyph)
font.go:709
↓ 3 callersFunctiontoI26_6
(f float64)
util.go:218
↓ 3 callersFunctiontoNRGBA
(col color.Color)
renderers/gio/gio.go:166
↓ 3 callersMethodtoPath
(glyphs []text.Glyph, ppem uint16)
font.go:740
↓ 3 callersMethodtoStyle
(paint canvas.Paint)
renderers/htmlcanvas/htmlcanvas.go:69
↓ 3 callersFunctionxmonotoneCubicBezier
(p0, p1, p2, p3 Point)
path_util.go:746
↓ 3 callersFunctionxmonotoneEllipticArc
(start Point, rx, ry, phi float64, large, sweep bool, end Point)
path_util.go:315
↓ 2 callersMethodAppend
(item *itemVW)
path_simplify.go:229
↓ 2 callersFunctionAsset
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 callersMethodBounds
Bounds returns the bounding rectangle that defines the text box.
text.go:1098
↓ 2 callersMethodCP2
CP2 returns the second control point for cubic Béziers.
path_scanner.go:59
↓ 2 callersMethodCP2
CP2 returns the second control point for cubic Béziers.
path_scanner.go:142
↓ 2 callersMethodCap
(*Path, float64, Point, Point)
path_stroke.go:18
↓ 2 callersMethodClose
Close closes the current path.
canvas.go:531
↓ 2 callersMethodClose
Close finished the document.
renderers/pdf/writer.go:689
↓ 2 callersMethodClose
Close finished and closes the SVG.
renderers/svg/svg.go:79
↓ 2 callersMethodColorModel
()
renderers/rasterizer/util.go:46
↓ 2 callersMethodCoordDirections
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 callersMethodCoveredBy
CoveredBy is the same as Covers but with the shapes swapped.
path_intersection.go:2487
↓ 2 callersMethodDrawImage
DrawImage embeds and draws an image.
renderers/pdf/writer.go:1339
↓ 2 callersFunctionDrawPreviewWithAssets
DrawPreviewWithAssets draws the canvas's preview to a Context with assets preloaded.
preview.go:51
↓ 2 callersMethodEmpty
Empty returns true if there are no text lines or text spans.
text.go:1066
↓ 2 callersMethodEmpty
()
util.go:399
↓ 2 callersMethodEmpty
Empty return true if the canvas is empty.
canvas.go:770
↓ 2 callersMethodFindPrevNext
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 callersMethodFix
(i int)
path_simplify.go:249
↓ 2 callersMethodInResult
(op pathOp, fillRule FillRule)
path_intersection.go:1674
↓ 2 callersMethodInit
()
path_intersection.go:440
↓ 2 callersMethodInsertAfter
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 callersFunctionIsNewline
(s string)
text/linebreak.go:685
↓ 2 callersFunctionIsParagraph
(s string)
text/linebreak.go:699
↓ 2 callersFunctionIsSpacelessScript
(script Script)
text/text.go:129
↓ 2 callersFunctionIsVerticalScript
(script Script)
text/text.go:134
↓ 2 callersMethodIsZero
IsZero returns true if P is exactly zero.
util.go:245
← previousnext →401–500 of 1,447, ranked by callers