package svg
import "github.com/alecthomas/chroma/formatters/svg"
Package svg contains an SVG formatter.
Index ¶
- Variables
- func StyleEntryToSVG(e chroma.StyleEntry) string
- type FontFormat
- type Formatter
- func New(options ...Option) *Formatter
- func (f *Formatter) Format(w io.Writer, style *chroma.Style, iterator chroma.Iterator) (err error)
- type Option
Variables ¶
var FontLiberationMono = "" /* 233250 byte string literal not displayed */
Liberation Mono as base64 encoded woff (SIL Open Font License)[https://en.wikipedia.org/wiki/Liberation_fonts]
Functions ¶
func StyleEntryToSVG ¶
func StyleEntryToSVG(e chroma.StyleEntry) string
StyleEntryToSVG converts a chroma.StyleEntry to SVG attributes.
Types ¶
type FontFormat ¶
type FontFormat int
const ( WOFF FontFormat = iota WOFF2 TRUETYPE )
https://transfonter.org/formats
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter that generates SVG.
func New ¶
New SVG formatter.
func (*Formatter) Format ¶
type Option ¶
type Option func(f *Formatter)
Option sets an option of the SVG formatter.
func EmbedFont ¶
func EmbedFont(fontFamily string, font string, format FontFormat) Option
EmbedFont embeds given base64 encoded font
func EmbedFontFile ¶
EmbedFontFile embeds given font file
func FontFamily ¶
FontFamily sets the font-family.
Source Files ¶
font_liberation_mono.go svg.go
- Version
- v0.10.0 (latest)
- Published
- Jan 12, 2022
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 6 hours ago –
Tools for package owners.