Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uk0/go-ssvg
go svg gen golang svg 生成器
https://github.com/uk0/go-ssvg
go go-svg ssvg svg
Last synced: about 12 hours ago
JSON representation
go svg gen golang svg 生成器
- Host: GitHub
- URL: https://github.com/uk0/go-ssvg
- Owner: uk0
- License: apache-2.0
- Created: 2023-06-26T08:08:45.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-10T15:20:56.000Z (over 1 year ago)
- Last Synced: 2024-06-21T20:04:33.118Z (5 months ago)
- Topics: go, go-svg, ssvg, svg
- Language: Go
- Homepage:
- Size: 10.1 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## go-svg
### 实现了一个svg的基本实现,可以通过参数创建图像以及文字
```go
package ssvg
import (
"testing"
)func TestWriteSvg(t *testing.T) {
svg := new(Svg)
svg.Add(&Line{X1: 0, Y1: 0, X2: 100, Y2: 200})
svg.Add(&Line{X1: -100, Y1: -100, X2: 100, Y2: 200})
svg.Add(&Text{X: 50, Y: -50, Text: "Test"})
svg.WriteFile("test.svg", 220)
}```
### demo
![test.svg](test.svg)