modulepackage
1.4.1
Repository: https://github.com/essentialkaos/go-badge.git
Documentation: pkg.go.dev
# README
Usage example • Examples • CI Status • Contributing • Thanks • License
badge
is a Go package for generating SVG badges.
Usage example
package main
// ////////////////////////////////////////////////////////////////////////// //
import (
"fmt"
"github.com/essentialkaos/go-badge"
)
// ////////////////////////////////////////////////////////////////////////// //
func main() {
g, err := badge.NewGenerator("Verdana.ttf", 11)
if err != nil {
panic(err)
}
fmt.Println(string(g.GeneratePlastic("status", "ok", "#97ca00")))
}
Examples
Flat | Flat Square | Plastic | Flat (Simple) | Flat Square (Simple) | Plastic (Simple) |
---|---|---|---|---|---|
All badges are generated with the latest version of the package.
CI Status
Branch | Status |
---|---|
master | |
develop |
Contributing
Before contributing to this project please read our Contributing Guidelines.
Thanks
We would like to thank:
- All authors and contributors of shields.io service;
- All authors of
freetype
package; - @narqo for
go-badge
package.
License
# Functions
NewGenerator creates new badge generator using given path to font file.
NewGeneratorFromBytes creates a new card generator using given font data.
NewGeneratorFromReader creates a new card generator using a reader that provides font data.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
default font offset.
default letter spacing.