pdf

package module
v0.0.0-...-86c5517 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 32 Imported by: 0

README

goldmark-pdf

goldmark-pdf is a renderer for goldmark that allows rendering to PDF.

goldmark-pdf screenshot

Reference

See https://pkg.go.dev/github.com/stephenafamo/goldmark-pdf

Usage

Care has been taken to match the semantics of goldmark and its extensions.

The PDF renderer can be initiated with pdf.New() and the returned value satisfies goldmark's renderer.Renderer interface, so it can be passed to goldmark.New() using the goldmark.WithRenderer() option.

markdown := goldmark.New(
    goldmark.WithRenderer(pdf.New()),
)

Options can also be passed to pdf.New(), the options interface to be satisfied is:

// An Option interface is a functional option type for the Renderer.
type Option interface {
	SetConfig(*Config)
}

Here is the Config struct that is to be modified:

type Config struct {
	Context context.Context

	PDF PDF

	// A source for images
	ImageFS fs.FS

	// All other options have sensible defaults
	Styles Styles

	// A cache for the fonts
	FontsCache fonts.Cache

	// For debugging
	TraceWriter io.Writer

	NodeRenderers util.PrioritizedSlice
}

Some helper functions for adding options are already provided. See option.go

An example with some more options:

goldmark.New(
    goldmark.WithRenderer(
        pdf.New(
            pdf.WithTraceWriter(os.Stdout),
            pdf.WithContext(context.Background()),
            pdf.WithImageFS(os.DirFS(".")),
            pdf.WithLinkColor("cc4578"),
            pdf.WithHeadingFont(pdf.GetTextFont("IBM Plex Serif", pdf.FontLora)),
            pdf.WithBodyFont(pdf.GetTextFont("Open Sans", pdf.FontRoboto)),
            pdf.WithCodeFont(pdf.GetCodeFont("Inconsolata", pdf.FontRobotoMono)),
        ),
    ),
)

Fonts

The fonts that can be used in the PDF are based on the Font struct

// Represents a font.
type Font struct {
	CanUseForText bool
	CanUseForCode bool

	Category string
	Family   string

	FileRegular    string
	FileItalic     string
	FileBold       string
	FileBoldItalic string

	Type fontType
}

To be used for text, a font should have regular, italic, bold and bold-italic styles. Each of these has to be loaded separately.

To ease this process, variables have been generated for all the Google fonts that have these styles. For example:

var FontRoboto = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Roboto",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           fontTypeGoogle,
}

For codeblocks, if any other style is missing, the regular font is used in place.

var FontMajorMonoDisplay = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Major Mono Display",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           fontTypeGoogle,
}

When loading the fonts, they are downloaded on the fly using the fonts.

If you'd like to use a font outside of these, you should pass your own font struct which have been loaded into the PDF object you set in the Config. Be sure to set the FontType to FontTypeCustom so that we do not attempt to download it.

Contributing

Here's a list of things that I'd love help with:

  • More documentation
  • Testing
  • Finish the (currently buggy) implementation based on gopdf

License

MIT

Author

Stephen Afam-Osemene

Documentation

Index

Constants

View Source
const (
	FontTypeInbuilt fontType = "inbuilt_font"
	FontTypeCustom  fontType = "custom_font"
	FontTypeGoogle  fontType = "google_font"
)
View Source
const (
	FontStyleRegular    = ""
	FontStyleBold       = "B"
	FontStyleItalic     = "I"
	FontStyleBoldItalic = "BI"
)

Variables

View Source
var CodeFontsInbuilt = map[string]Font{FontCourier.Family: FontCourier}

A map of the inbuilt monospace fonts. To be used for code blocks

View Source
var FontAlbertSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Albert Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAlegreya = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Alegreya",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAlegreyaSC = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Alegreya SC",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAlegreyaSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Alegreya Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAlegreyaSansSC = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Alegreya Sans SC",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAleo = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Aleo",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAlmendra = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Almendra",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAlumniSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Alumni Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAmaranth = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Amaranth",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAmiri = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Amiri",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAndadaPro = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Andada Pro",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAndika = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Andika",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAnonymousPro = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Anonymous Pro",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAnybody = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Anybody",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontArchivo = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Archivo",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontArchivoNarrow = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Archivo Narrow",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontArimo = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Arimo",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontArsenal = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Arsenal",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontArvo = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Arvo",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAsap = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Asap",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAsapCondensed = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Asap Condensed",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAtkinsonHyperlegible = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Atkinson Hyperlegible",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAveriaLibre = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Averia Libre",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAveriaSansLibre = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Averia Sans Libre",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAveriaSerifLibre = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Averia Serif Libre",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontAzeretMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Azeret Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontB612 = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "B612",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontB612Mono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "B612 Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBaiJamjuree = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Bai Jamjuree",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBalsamiqSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Balsamiq Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBarlow = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Barlow",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBarlowCondensed = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Barlow Condensed",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBarlowSemiCondensed = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Barlow Semi Condensed",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBeVietnamPro = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Be Vietnam Pro",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBellota = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Bellota",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBellotaText = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Bellota Text",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBesley = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Besley",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBitter = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Bitter",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBodoniModa = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Bodoni Moda",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontBrygada1918 = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Brygada 1918",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCabin = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Cabin",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCaladea = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Caladea",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCambay = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Cambay",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCantarell = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Cantarell",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCaudex = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Caudex",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontChakraPetch = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Chakra Petch",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCharisSIL = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Charis SIL",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontChivo = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Chivo",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontChivoMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Chivo Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontComicNeue = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "handwriting",
	Family:         "Comic Neue",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCormorant = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Cormorant",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCormorantGaramond = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Cormorant Garamond",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCormorantInfant = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Cormorant Infant",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCourier = Font{
	CanUseForText: true,
	CanUseForCode: true,
	Category:      "monospace",
	Family:        "Courier",
	Type:          FontTypeInbuilt,
}
View Source
var FontCourierPrime = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Courier Prime",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCousine = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Cousine",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCrimsonPro = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Crimson Pro",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCrimsonText = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Crimson Text",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCuprum = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Cuprum",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontCutiveMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Cutive Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontDMMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "DM Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontDMSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "DM Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontEBGaramond = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "EB Garamond",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontEconomica = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Economica",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontEpilogue = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Epilogue",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontExo = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Exo",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontExo2 = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Exo 2",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontExpletusSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Expletus Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFahkwang = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Fahkwang",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFamiljenGrotesk = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Familjen Grotesk",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFaustina = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Faustina",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFigtree = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Figtree",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFinlandica = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Finlandica",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFiraCode = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Fira Code",
	FileBold:       "700",
	FileBoldItalic: "700",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFiraMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Fira Mono",
	FileBold:       "700",
	FileBoldItalic: "700",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFiraSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Fira Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFiraSansCondensed = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Fira Sans Condensed",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFiraSansExtraCondensed = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Fira Sans Extra Condensed",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFragmentMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Fragment Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontFraunces = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Fraunces",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGFSNeohellenic = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "GFS Neohellenic",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGantari = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Gantari",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGelasio = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Gelasio",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGenos = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Genos",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGentiumBookBasic = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Gentium Book Basic",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGentiumBookPlus = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Gentium Book Plus",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGentiumPlus = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Gentium Plus",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGeorama = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Georama",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGlory = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Glory",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGrandstander = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Grandstander",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontGrenze = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Grenze",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontHankenGrotesk = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Hanken Grotesk",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontHelvetica = Font{
	CanUseForText: true,
	CanUseForCode: false,
	Category:      "sans-serif",
	Family:        "Helvetica",
	Type:          FontTypeInbuilt,
}
View Source
var FontIBMPlexMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "IBM Plex Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontIBMPlexSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "IBM Plex Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontIBMPlexSansCondensed = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "IBM Plex Sans Condensed",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontIBMPlexSerif = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "IBM Plex Serif",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontIbarraRealNova = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Ibarra Real Nova",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontInconsolata = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Inconsolata",
	FileBold:       "700",
	FileBoldItalic: "700",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontInriaSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Inria Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontInriaSerif = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Inria Serif",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontInterTight = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Inter Tight",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontIstokWeb = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Istok Web",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontJetBrainsMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "JetBrains Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontJosefinSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Josefin Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontJosefinSlab = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Josefin Slab",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontJost = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Jost",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontK2D = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "K2D",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontKanit = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Kanit",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontKantumruyPro = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Kantumruy Pro",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontKarla = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Karla",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontKoHo = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "KoHo",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontKodchasan = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Kodchasan",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontKrub = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Krub",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontKufam = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Kufam",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontKulimPark = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Kulim Park",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontLato = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Lato",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontLibreBodoni = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Libre Bodoni",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontLibreFranklin = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Libre Franklin",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontLiterata = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Literata",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontLivvic = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Livvic",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontLobsterTwo = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Lobster Two",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontLora = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Lora",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMajorMonoDisplay = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Major Mono Display",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMali = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "handwriting",
	Family:         "Mali",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontManuale = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Manuale",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMartianMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Martian Mono",
	FileBold:       "700",
	FileBoldItalic: "700",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMarvel = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Marvel",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMerriweather = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Merriweather",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMerriweatherSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Merriweather Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMohave = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Mohave",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMontserrat = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Montserrat",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMontserratAlternates = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Montserrat Alternates",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMulish = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Mulish",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontMuseoModerno = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "MuseoModerno",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNanumGothicCoding = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Nanum Gothic Coding",
	FileBold:       "700",
	FileBoldItalic: "700",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNewsreader = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Newsreader",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNiramit = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Niramit",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNobile = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Nobile",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNoticiaText = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Noticia Text",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNotoSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Noto Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNotoSansDisplay = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Noto Sans Display",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNotoSansMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Noto Sans Mono",
	FileBold:       "700",
	FileBoldItalic: "700",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNotoSerif = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Noto Serif",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNotoSerifDisplay = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Noto Serif Display",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNotoSerifTamil = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Noto Serif Tamil",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNovaMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Nova Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNunito = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Nunito",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontNunitoSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Nunito Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontOpenSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Open Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontOverlock = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Overlock",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontOverpass = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Overpass",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontOverpassMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Overpass Mono",
	FileBold:       "700",
	FileBoldItalic: "700",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontOxygenMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Oxygen Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPTMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "PT Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPTSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "PT Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPTSerif = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "PT Serif",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPetrona = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Petrona",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPhilosopher = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Philosopher",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPiazzolla = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Piazzolla",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPlayfairDisplay = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Playfair Display",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPlayfairDisplaySC = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Playfair Display SC",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPlusJakartaSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Plus Jakarta Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPoppins = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Poppins",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPrompt = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Prompt",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontProzaLibre = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Proza Libre",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPublicSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Public Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontPuritan = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Puritan",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontQuantico = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Quantico",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontQuattrocentoSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Quattrocento Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRadioCanada = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Radio Canada",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRaleway = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Raleway",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRambla = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Rambla",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRasa = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Rasa",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRedHatDisplay = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Red Hat Display",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRedHatMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Red Hat Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRedHatText = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Red Hat Text",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRoboto = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Roboto",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRobotoCondensed = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Roboto Condensed",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRobotoMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Roboto Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRobotoSerif = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Roboto Serif",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRosario = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Rosario",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontRubik = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Rubik",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSTIXTwoText = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "STIX Two Text",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSaira = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Saira",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSansita = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Sansita",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSarabun = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Sarabun",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontScada = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Scada",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontShare = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Share",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontShareTechMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Share Tech Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSourceCodePro = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Source Code Pro",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSourceSans3 = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Source Sans 3",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSourceSansPro = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Source Sans Pro",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSourceSerif4 = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Source Serif 4",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSourceSerifPro = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Source Serif Pro",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSpaceMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Space Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSpectral = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Spectral",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSpectralSC = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Spectral SC",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSplineSansMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Spline Sans Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontSyneMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Syne Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontTaviraj = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Taviraj",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontTexturina = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Texturina",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontThasadith = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Thasadith",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontTimes = Font{
	CanUseForText: true,
	CanUseForCode: false,
	Category:      "serif",
	Family:        "Times",
	Type:          FontTypeInbuilt,
}
View Source
var FontTinos = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Tinos",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontTitilliumWeb = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Titillium Web",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontTomorrow = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Tomorrow",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontTourney = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "display",
	Family:         "Tourney",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontTrirong = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Trirong",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontUbuntu = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Ubuntu",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontUbuntuMono = Font{
	CanUseForCode:  true,
	CanUseForText:  true,
	Category:       "monospace",
	Family:         "Ubuntu Mono",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontUnna = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Unna",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontUrbanist = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Urbanist",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontVT323 = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "VT323",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "regular",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontVolkhov = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Volkhov",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontVollkorn = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Vollkorn",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontWorkSans = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "sans-serif",
	Family:         "Work Sans",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontXanhMono = Font{
	CanUseForCode:  true,
	CanUseForText:  false,
	Category:       "monospace",
	Family:         "Xanh Mono",
	FileBold:       "regular",
	FileBoldItalic: "regular",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontYrsa = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Yrsa",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var FontZillaSlab = Font{
	CanUseForCode:  false,
	CanUseForText:  true,
	Category:       "serif",
	Family:         "Zilla Slab",
	FileBold:       "700",
	FileBoldItalic: "700italic",
	FileItalic:     "italic",
	FileRegular:    "regular",
	Type:           FontTypeGoogle,
}
View Source
var TextFontsGoogle = map[string]Font{}/* 199 elements not displayed */
View Source
var TextFontsInbuilt = map[string]Font{FontTimes.Family: FontTimes, FontHelvetica.Family: FontHelvetica}

A map of the inbuilt fonts that should be used for text (Headings, body)

Functions

func AddFonts

func AddFonts(ctx context.Context, pdf PDF, fonts []Font, fontsCache fonts.Cache) error

func New

func New(options ...Option) goldrender.Renderer

NewRreturns a new PDF Renderer with given options.

func SetStyle

func SetStyle(pdf PDF, s Style)

Types

type Config

type Config struct {
	Context context.Context

	PDF PDF

	// A source for images
	ImageFS http.FileSystem

	// All other options have sensible defaults
	Styles Styles

	// A cache for the fonts
	FontsCache fonts.Cache

	// For debugging
	TraceWriter io.Writer

	NodeRenderers util.PrioritizedSlice
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) AddDefaultNodeRenderers

func (c *Config) AddDefaultNodeRenderers()

type Font

type Font struct {
	CanUseForText bool
	CanUseForCode bool

	Category string
	Family   string

	FileRegular    string
	FileItalic     string
	FileBold       string
	FileBoldItalic string

	Type fontType
}

Represents a font.

func GetCodeFont

func GetCodeFont(family string, fallback Font) Font

Returns a font from CodeFontsInbuilt and CodeFontsGoogle, or the backup

func GetTextFont

func GetTextFont(family string, fallback Font) Font

Returns a font from one of TextFontsInbuilt and TextFontsGoogle, or the backup

type Fpdf

type Fpdf struct {
	Fpdf *gofpdf.Fpdf
	// contains filtered or unexported fields
}

func NewFpdf

func NewFpdf(ctx context.Context, c FpdfConfig, fontsCache fonts.Cache) *Fpdf

func (Fpdf) AddFont

func (f Fpdf) AddFont(family string, style string, data []byte) error
func (f *Fpdf) AddInternalLink(anchor string)

func (Fpdf) AddPage

func (f Fpdf) AddPage()

Add a new page

func (Fpdf) BR

func (f Fpdf) BR(height float64)

func (Fpdf) CellFormat

func (f Fpdf) CellFormat(w float64, h float64, txtStr string, borderStr string, ln int, alignStr string, fill bool, link int, linkStr string)

func (Fpdf) GetMargins

func (f Fpdf) GetMargins() (left, top, right, bottom float64)

func (Fpdf) GetPageSize

func (f Fpdf) GetPageSize() (width float64, height float64)

Page size

func (Fpdf) GetX

func (f Fpdf) GetX() float64

Position

func (Fpdf) GetY

func (f Fpdf) GetY() float64

func (Fpdf) Line

func (f Fpdf) Line(x1 float64, y1 float64, x2 float64, y2 float64)

func (Fpdf) MeasureTextWidth

func (f Fpdf) MeasureTextWidth(text string) float64

Measuring

func (Fpdf) RegisterImage

func (f Fpdf) RegisterImage(id string, format string, src io.Reader)

Images

func (Fpdf) SetDrawColor

func (f Fpdf) SetDrawColor(r uint8, g uint8, b uint8)

Colors

func (Fpdf) SetFillColor

func (f Fpdf) SetFillColor(r uint8, g uint8, b uint8)

func (Fpdf) SetFont

func (f Fpdf) SetFont(family string, style string, size int) error

func (Fpdf) SetLineWidth

func (f Fpdf) SetLineWidth(width float64)

Width

func (Fpdf) SetMarginLeft

func (f Fpdf) SetMarginLeft(margin float64)

Margins

func (Fpdf) SetMarginRight

func (f Fpdf) SetMarginRight(margin float64)

func (Fpdf) SetMarginTop

func (f Fpdf) SetMarginTop(margin float64)

func (Fpdf) SetTextColor

func (f Fpdf) SetTextColor(r uint8, g uint8, b uint8)

func (Fpdf) SetX

func (f Fpdf) SetX(x float64)

func (Fpdf) SetY

func (f Fpdf) SetY(y float64)

func (Fpdf) SplitText

func (f Fpdf) SplitText(txt string, w float64) []string

func (Fpdf) UseImage

func (f Fpdf) UseImage(imgID string, x, y, w, h float64)

func (Fpdf) Write

func (f Fpdf) Write(w io.Writer) error
func (f Fpdf) WriteExternalLink(lineHeight float64, text string, destination string)
func (f *Fpdf) WriteInternalLink(lineHeight float64, text string, anchor string)

func (Fpdf) WriteText

func (f Fpdf) WriteText(height float64, text string)

Writing

type FpdfConfig

type FpdfConfig struct {
	Title   string
	Subject string

	Orientation string // Default Portriat
	PaperSize   string // Default A4

	LogoFormat string

	// Header
	HeaderFunc func(impl Fpdf, fontsCache fonts.Cache) func()

	// Footer
	FooterFunc func(impl Fpdf, fontsCache fonts.Cache) func()
}

type NodeRenderer

type NodeRenderer interface {
	// RendererFuncs registers NodeRendererFuncs to given NodeRendererFuncRegisterer.
	RegisterFuncs(NodeRendererFuncRegisterer)
}

A NodeRenderer interface offers NodeRendererFuncs.

type NodeRendererFunc

type NodeRendererFunc func(w *Writer, source []byte, n ast.Node, entering bool) (ast.WalkStatus, error)

A function to render an ast.Node to the given Writer. The writer contains the PDF and style information

type NodeRendererFuncRegisterer

type NodeRendererFuncRegisterer interface {
	// Register registers given NodeRendererFunc to this object.
	Register(ast.NodeKind, NodeRendererFunc)
}

A NodeRendererFuncRegisterer registers

type Option

type Option interface {
	SetConfig(*Config)
}

An Option interface is a functional option type for the Renderer.

func WithBodyColor

func WithBodyColor(color color.Color) Option

func WithBodyFont

func WithBodyFont(f Font) Option

Set the font for every body element

func WithCodeBlockTheme

func WithCodeBlockTheme(theme *chroma.Style) Option

Set the code block chroma theme

func WithCodeFont

func WithCodeFont(f Font) Option

Set a font for code spans and code blocks

func WithConfig

func WithConfig(config *Config) Option

Pass a completely new config

func WithContext

func WithContext(ctx context.Context) Option

Add a context that will be used for operations like downloading fonts

func WithFontsCache

func WithFontsCache(fc fonts.Cache) Option

Set a cache for fonts

func WithFpdf

func WithFpdf(ctx context.Context, c FpdfConfig) Option

Easily configure a PDF writer to use based on https://github.com/phpdave11/gofpdf

func WithHeadingFont

func WithHeadingFont(f Font) Option

Set the font for every heading style

func WithImageFS

func WithImageFS(images http.FileSystem) Option

Set the image filesystem

func WithLinkColor

func WithLinkColor(val color.Color) Option

Set a color for links

func WithNodeRenderers

func WithNodeRenderers(ps ...util.PrioritizedValue) Option

Extend the NodeRenderers to support or overwrite how nodes are rendered.

func WithPDF

func WithPDF(pdf PDF) Option

Pass your own PDF object that satisfies the PDF interface

func WithTraceWriter

func WithTraceWriter(val io.Writer) Option

Provide an io.Write where debug information will be written to

type OptionFunc

type OptionFunc func(*Config)

A function that implements the Option interface

func (OptionFunc) SetConfig

func (o OptionFunc) SetConfig(c *Config)

To implement the SetConfig method of the Option interface

type PDF

type PDF interface {
	// Add a new page
	AddPage()

	// Position
	GetX() float64
	GetY() float64

	SetX(x float64)
	SetY(y float64)

	// Page size
	GetPageSize() (width, height float64)

	SetMarginLeft(margin float64)
	SetMarginRight(margin float64)
	GetMargins() (left, top, right, bottom float64)

	// Font
	AddFont(family string, style string, data []byte) error
	SetFont(family string, style string, size int) error

	// Writing
	WriteText(height float64, text string)
	CellFormat(w, h float64, txtStr, borderStr string, ln int, alignStr string, fill bool, link int, linkStr string)
	BR(h float64)

	// Links
	// Add an internal link anchor to the current position
	AddInternalLink(anchor string)
	// record an internal ink to the given anchor
	WriteInternalLink(lineHeight float64, text string, anchor string)
	WriteExternalLink(lineHeight float64, text, destination string)

	// Images
	RegisterImage(id, format string, src io.Reader)
	UseImage(id string, x, y, w, h float64)

	// Measuring
	MeasureTextWidth(text string) float64
	SplitText(txt string, w float64) []string

	// Colors
	SetDrawColor(r uint8, g uint8, b uint8)
	SetFillColor(r uint8, g uint8, b uint8)
	SetTextColor(r uint8, g uint8, b uint8)

	// Width
	SetLineWidth(width float64)
	Line(x1, x2, y1, y2 float64)

	// Rendering
	Write(io.Writer) error
}

type Style

type Style struct {
	Font      Font
	Size      float64
	Spacing   float64
	TextColor color.Color
	FillColor color.Color
	// contains filtered or unexported fields
}

Style is the struct to capture the styling features for text Size and Spacing are specified in points. The sum of Size and Spacing is used as line height value in the gofpdf API

type Styles

type Styles struct {
	// Headings
	H1 *Style
	H2 *Style
	H3 *Style
	H4 *Style
	H5 *Style
	H6 *Style

	// normal text
	Normal *Style

	// blockquote text
	Blockquote *Style

	// Table styling
	THeader *Style
	TBody   *Style

	// code and preformatted text
	CodeFont Font
	// Codeblock Chroma Theme
	CodeBlockTheme *chroma.Style

	// link text
	LinkColor color.Color
}

func DefaultStyles

func DefaultStyles() Styles

type Writer

type Writer struct {
	Pdf     PDF
	ImageFS http.FileSystem
	Styles  Styles
	States  states

	DebugWriter io.Writer
}

Holds the neccessary information to write to a PDF

func (*Writer) ChromaToStyle

func (w *Writer) ChromaToStyle(chSt chroma.StyleEntry) *Style

Converts a chroma.StyleEntry to a Style, based on the backtickStyle

func (*Writer) GetBacktickStyle

func (w *Writer) GetBacktickStyle() *Style

Returns the current style with the font set to Styles.CodeFont

func (*Writer) GetLinkStyle

func (w *Writer) GetLinkStyle() *Style

Returns the currentStyle adding underline and setting the color to Styles.LinkColor

func (*Writer) LogDebug

func (r *Writer) LogDebug(source, msg string)

To log debug information. Nothing is logged if DebugWriter is nil

func (*Writer) Text

func (w *Writer) Text(s Style, t string)

Write a string with a given style

func (w *Writer) WriteLink(s Style, display, url string)

Write a link

func (*Writer) WriteText

func (w *Writer) WriteText(stringContents string)

Write text based on the current state.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL