Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Nov 3, 2024
1 parent 41d913b commit bc39995
Show file tree
Hide file tree
Showing 8 changed files with 461 additions and 683 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.22
- name: Build
run: go build -v ./...
- name: Tests with coverage
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,25 @@ Whether this library is ready for production environments is up to your own judg

Execution performance is actually really good, especially the rasterizer is highly optimized with ASM. See for example a comparison of an extreme case in https://github.com/tdewolff/canvas/issues/280#issuecomment-1995990038, where this library is at least twice as fast as existing solutions, and can handle bigger images than the likes of Inkscape and Cairo.

Please issue bug reports or feature requests to help this library mature! All help is appreciated. Also see [Wiki - Planning](https://github.com/tdewolff/canvas/wiki/Planning) for an inexhaustive list of ideas and TODOs.

## Recent changes
The path intersection code and path boolean operation code is quite complete and fast, and more importantly has a time complexity of O(n log n). It may suffer from numerical precision which can be avoided using `Path.Gridsnap` beforehand.

- <del>`Context` view and coordinate view have been altered. `View` now doesn't affect the coordinate view/system. To achieve the same as before, replace `ctx.SetView(m)` by `ctx.SetView(m); ctx.SetCoordView(m)`. The change makes coordinate systems more intuitive when using in combination with views, the given coordinate reflects the coordinate where it is drawn irrespective of the view.</del> This has been reverted, the coordinate view is first performed to the coordinate, and then the view applies as a affine transformation matrix for all objects (including their coordinates). This less error prone (as evidenced by recents bugs in ParseSVG). If you previously used `ctx.SetCoordView(m); ctx.SetView(m)`, now only the latter is needed. Otherwise, you may need to update your coordinates when using `ctx.SetView(m)`.
Please issue bug reports or feature requests to help this library mature! All help is appreciated. Also see [Wiki - Planning](https://github.com/tdewolff/canvas/wiki/Planning) for an inexhaustive list of ideas and TODOs.

## Features

- Path segment types: MoveTo, LineTo, QuadTo, CubeTo, ArcTo, Close
- Path segment types: MoveTo, LineTo, QuadTo, CubeTo, ArcTo, Close (https://github.com/tdewolff/canvas/wiki/Paths)
- Precise path flattening, stroking, and dashing for all segment type uing papers (see below)
- Smooth spline generation through points for open and closed paths
- Path boolean operations: AND, OR, XOR, NOT, Divide
- Path boolean operations: AND, OR, XOR, NOT, Divide (https://github.com/tdewolff/canvas/wiki/Boolean-operations)
- LaTeX to path conversion (native Go and CGO implementations available)
- Font formats support
- Font formats support (https://github.com/tdewolff/canvas/wiki/Fonts-&-Text)
- - SFNT (such as TTF, OTF, WOFF, WOFF2, EOT) supporting TrueType, CFF, and CFF2 tables
- HarfBuzz for text shaping (native Go and CGO implementations available)
- FriBidi for text bidirectionality (native Go and CGO implementations available)
- Donald Knuth's line breaking algorithm for text layout
- sRGB compliance (use `SRGBColorSpace`, only available for rasterizer)
- Font rendering with gamma correction of 1.43
- Rendering targets
- Rendering targets (https://github.com/tdewolff/canvas/wiki/Renderers)
- - Raster images (PNG, GIF, JPEG, TIFF, BMP, WEBP)
- - PDF
- - SVG and SVGZ
Expand Down Expand Up @@ -130,6 +128,7 @@ This is a non-exhaustive list of library users I've come across. PRs are welcome
- [S.H. Kim and Y.J. Ahn, An approximation of circular arcs by quartic Bezier curves, Computer-Aided Design 39 (2007, p. 490--493)](https://doi.org/10.1016/j.cad.2007.01.004)
- D.E. Knuth and M.F. Plass, Breaking Paragraphs into Lines, Software: Practive and Experience 11 (1981), p. 1119--1184
- L. Subramaniam, Partition of a non-simple polygon into simple pologons, 2003
- [A simple algorithm for Boolean operations on polygons](https://doi.org/10.1016/j.advengsoft.2013.04.004)

## License

Expand Down
47 changes: 0 additions & 47 deletions examples/gio/main.go

This file was deleted.

72 changes: 34 additions & 38 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,74 +5,70 @@ go 1.22.0
toolchain go1.23.2

require (
fyne.io/fyne/v2 v2.4.1
gioui.org v0.7.1
fyne.io/fyne/v2 v2.5.2
github.com/ByteArena/poly2tri-go v0.0.0-20170716161910-d102ad91854f
github.com/Kagami/go-avif v0.1.0
github.com/benoitkugler/textprocessing v0.0.3
github.com/go-fonts/latin-modern v0.3.1
github.com/go-fonts/latin-modern v0.3.3
github.com/go-gl/gl v0.0.0-20231021071112-07e5d0ea2e71
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20231223183121-56fa3ac82ce7
github.com/go-text/typesetting v0.1.2
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20240506104042-037f3cc74f2a
github.com/go-text/typesetting v0.2.0
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/kolesa-team/go-webp v1.0.4
github.com/paulmach/orb v0.10.0
github.com/paulmach/osm v0.7.1
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/tdewolff/argp v0.0.0-20240622014751-a1d21f2fce51
github.com/paulmach/orb v0.11.1
github.com/paulmach/osm v0.8.0
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/tdewolff/argp v0.0.0-20240625173203-87b04d5d3e52
github.com/tdewolff/font v0.0.0-20240728193914-9dc6e3441d03
github.com/tdewolff/minify/v2 v2.20.5
github.com/tdewolff/parse/v2 v2.7.15
github.com/tdewolff/minify/v2 v2.21.1
github.com/tdewolff/parse/v2 v2.7.19
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739
github.com/wcharczuk/go-chart/v2 v2.1.1
golang.org/x/image v0.18.0
golang.org/x/text v0.16.0
gonum.org/v1/plot v0.14.0
github.com/wcharczuk/go-chart/v2 v2.1.2
golang.org/x/image v0.21.0
golang.org/x/text v0.19.0
gonum.org/v1/plot v0.15.0
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
fyne.io/systray v1.10.1-0.20230722100817-88df1e0ffa9a // indirect
gioui.org/shader v1.0.8 // indirect
git.sr.ht/~sbinet/gg v0.5.0 // indirect
fyne.io/systray v1.11.0 // indirect
git.sr.ht/~sbinet/gg v0.6.0 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/benoitkugler/textlayout v0.3.0 // indirect
github.com/blend/go-sdk v1.20220411.3 // indirect
github.com/campoy/embedmd v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fredbi/uri v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/fyne-io/glfw-js v0.0.0-20220517201726-bebc2019cd33 // indirect
github.com/fyne-io/image v0.0.0-20230811065323-ed435dc8bca6 // indirect
github.com/go-fonts/liberation v0.3.1 // indirect
github.com/go-latex/latex v0.0.0-20230307184459-12ec69307ad9 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/fyne-io/glfw-js v0.0.0-20240101223322-6e1efdc71b7a // indirect
github.com/fyne-io/image v0.0.0-20240417123036-dc0ee9e7c964 // indirect
github.com/go-fonts/liberation v0.3.3 // indirect
github.com/go-latex/latex v0.0.0-20240709081214-31cef3c7570e // indirect
github.com/go-pdf/fpdf v0.9.0 // indirect
github.com/go-sql-driver/mysql v1.8.1 // indirect
github.com/go-text/render v0.0.0-20230619120952-35bccb6164b8 // indirect
github.com/go-text/render v0.2.0 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/jeandeaual/go-locale v0.0.0-20240223122105-ce5225dcaa49 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/jsummers/gobmp v0.0.0-20230614200233-a9de23ed2e25 // indirect
github.com/nicksnyder/go-i18n/v2 v2.4.1 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/tevino/abool v1.2.0 // indirect
go.mongodb.org/mongo-driver v1.12.1 // indirect
github.com/rymdport/portal v0.2.6 // indirect
go.mongodb.org/mongo-driver v1.17.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/js/dom v0.0.0-20231030024858-cb489e859d05 // indirect
)

require (
gioui.org/cpu v0.0.0-20220412190645-f1e9e8c3b1f7 // indirect
github.com/fyne-io/gl-js v0.0.0-20230506162202-1fdaa286a934 // indirect
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect
github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/yuin/goldmark v1.6.0 // indirect
golang.org/x/exp v0.0.0-20240707233637-46b078467d37 // indirect
golang.org/x/exp/shiny v0.0.0-20240707233637-46b078467d37 // indirect
golang.org/x/mobile v0.0.0-20231127183840-76ac6878050a // indirect
golang.org/x/net v0.24.0
golang.org/x/sys v0.22.0 // indirect
star-tex.org/x/tex v0.4.0
github.com/stretchr/testify v1.9.0 // indirect
github.com/yuin/goldmark v1.7.8 // indirect
golang.org/x/mobile v0.0.0-20241016134751-7ff83004ec2c // indirect
golang.org/x/net v0.30.0
golang.org/x/sys v0.26.0 // indirect
star-tex.org/x/tex v0.5.0
)
Loading

0 comments on commit bc39995

Please sign in to comment.