oksvg

Partial implementation of SVG 2.0 specification in golang.

Github星跟蹤圖

oksvg

oksvg is a rasterizer for a partial implementation of the SVG2.0 specification in golang.

Although many SVG elements will not be read by oksvg, it is good enough to faithfully produce thousands, but certainly not all, SVG icons available both for free and commercially. A list of valid and invalid elements is in the doc folder.

oksvg uses the rasterx rasterizer package which implements full SVG2.0 path functions, including the newer 'arc' join-mode.

arcs and caps

Extra non-standard features.

In addition to 'arc' as a valid join mode value, oksvg also allows 'arc-clip' which is the arc analog of miter-clip and some extra capping and gap values. It can also specify different capping functions for line starts and ends.

Rasterizations of SVG to PNG from creative commons 3.0 sources.

Example renderings of unedited open source SVG files by oksvg and rasterx are shown below.

Thanks to Freepik from Flaticon
Licensed by Creative Commons 3.0 for the example icons shown below, and also used as test icons in the testdata folder.

Jupiter

lander

mountains

bus

Non-standard library dependencies

oksvg requires the following imports which are not included in the go standard library:

  • golang.org/x/net/html/charset
  • golang.org/x/image/colornames
  • golang.org/x/image/math/fixed

These can be included in your gopath by the following 'get' commands:

  • "go get golang.org/x/image/math/fixed"
  • "go get golang.org/x/image/colornames"
  • "go get golang.org/x/net/html/charset"

oksvg also requires the user to get or clone into the workspace the rasterx package located here:

  • github.com/srwiley/rasterx

主要指標

概覽
名稱與所有者srwiley/oksvg
主編程語言Go
編程語言Go (語言數: 1)
平台
許可證BSD 3-Clause "New" or "Revised" License
所有者活动
創建於2018-04-21 00:41:45
推送於2023-05-29 21:50:16
最后一次提交2022-10-11 09:52:16
發布數0
用户参与
星數169
關注者數5
派生數42
提交數101
已啟用問題?
問題數24
打開的問題數17
拉請求數15
打開的拉請求數4
關閉的拉請求數8
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?