Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
github.com/eihigh/canvas
This package is a fork of tdewolff/canvas containing changes for game development with Ebitengine. See Diffs from the original section for details.
Canvas is a common vector drawing target. It has a wide range of path manipulation functionality such as flattening, stroking and dashing implemented. Additionally, it has a text formatter and embeds and subsets fonts (TTF, OTF, WOFF, WOFF2, or EOT) or converts them to outlines. It can be considered a Cairo or node-canvas alternative in Go. See the example below in Figure 1 for an overview of the functionality.
Figure 1: top-left you can see text being fitted into a box, justified using Donald Knuth's linea breaking algorithm to stretch the spaces between words to fill the whole width. You can observe a variety of styles and text decorations applied. In the bottom-right the word "stroke" is being stroked and drawn as a path. Top-right we see a LaTeX formula that has been converted to a path. Left of that we see an ellipse showcasing precise dashing, notably the length of e.g. the short dash is equal wherever it is on the curve. Note that the dashes themselves are elliptical arcs as well (thus exactly precise even if magnified greatly). To the right we see a closed polygon of four points being smoothed by cubic Béziers that are smooth along the whole path, and the blue line on the left shows a smoothed open path. On the bottom you can see a rotated rasterized image.
Please see https://www.patreon.com/tdewolff for ways to contribute, otherwise please contact him directly!
This package has some additional features for the ebiten renderer, some removed features due to licensing issues or portability, and some minor changes.
Package renderers/ebiten
is the new renderer. For more details, see the API document and the example.
There are some removed features (below is the list) due to licensing issues or portability. Now all dependent libraries are MIT, BSD-3, or Apache2.0 licensed.
github.com/golang/freetype
which is FTL/GPL licensed
font.FromGoFreeType
renderers.GoChart
renderers.GonumPlot
Due to some minor changes, compatibility with the original is not guaranteed.
CartesianIV
(top-left corner is (0, 0)
)LoadLocalFont
uses github.com/flopp/go-findfont
SRGBColorSpace
, only available for rasterizer)Street Map: the centre of Amsterdam is drawn from data loaded from the Open Street Map API.
Mauna-Loa CO2 conentration: using data from the Mauna-Loa observatory, carbon dioxide concentrations over time are drawn
Document: an example of a text document.
Gio: an example using the Gio backend.
TeX/PGF: an example showing the usage of the PGF (TikZ) LaTeX package as renderer in order to generated a PDF using LaTeX.
PDF: an example using the PDF backend.
Released under the MIT license.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.