Documentation ¶
Index ¶
- Constants
- Variables
- func AddFonts(ctx context.Context, pdf PDF, fonts []Font, fontsCache fonts.Cache) error
- func New(options ...Option) goldrender.Renderer
- func SetStyle(pdf PDF, s Style)
- type Config
- type Font
- type Fpdf
- func (f Fpdf) AddFont(family string, style string, data []byte) error
- func (f *Fpdf) AddInternalLink(anchor string)
- func (f Fpdf) AddPage()
- func (f Fpdf) BR(height float64)
- func (f Fpdf) CellFormat(w float64, h float64, txtStr string, borderStr string, ln int, alignStr string, ...)
- func (f Fpdf) GetMargins() (left, top, right, bottom float64)
- func (f Fpdf) GetPageSize() (width float64, height float64)
- func (f Fpdf) GetX() float64
- func (f Fpdf) GetY() float64
- func (f Fpdf) Line(x1 float64, y1 float64, x2 float64, y2 float64)
- func (f Fpdf) MeasureTextWidth(text string) float64
- func (f Fpdf) RegisterImage(id string, format string, src io.Reader)
- func (f Fpdf) SetDrawColor(r uint8, g uint8, b uint8)
- func (f Fpdf) SetFillColor(r uint8, g uint8, b uint8)
- func (f Fpdf) SetFont(family string, style string, size int) error
- func (f Fpdf) SetLineWidth(width float64)
- func (f Fpdf) SetMarginLeft(margin float64)
- func (f Fpdf) SetMarginRight(margin float64)
- func (f Fpdf) SetMarginTop(margin float64)
- func (f Fpdf) SetTextColor(r uint8, g uint8, b uint8)
- func (f Fpdf) SetX(x float64)
- func (f Fpdf) SetY(y float64)
- func (f Fpdf) SplitText(txt string, w float64) []string
- func (f Fpdf) UseImage(imgID string, x, y, w, h float64)
- 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 (f Fpdf) WriteText(height float64, text string)
- type FpdfConfig
- type NodeRenderer
- type NodeRendererFunc
- type NodeRendererFuncRegisterer
- type Option
- func WithBodyFont(f Font) Option
- func WithCodeBlockTheme(theme *chroma.Style) Option
- func WithCodeFont(f Font) Option
- func WithConfig(config *Config) Option
- func WithContext(ctx context.Context) Option
- func WithFontsCache(fc fonts.Cache) Option
- func WithFpdf(ctx context.Context, c FpdfConfig) Option
- func WithHeadingFont(f Font) Option
- func WithImageFS(images http.FileSystem) Option
- func WithLinkColor(val color.Color) Option
- func WithNodeRenderers(ps ...util.PrioritizedValue) Option
- func WithPDF(pdf PDF) Option
- func WithTraceWriter(val io.Writer) Option
- type OptionFunc
- type PDF
- type Style
- type Styles
- type Writer
- func (w *Writer) ChromaToStyle(chSt chroma.StyleEntry) *Style
- func (w *Writer) GetBacktickStyle() *Style
- func (w *Writer) GetLinkStyle() *Style
- func (r *Writer) LogDebug(source, msg string)
- func (w *Writer) Text(s Style, t string)
- func (w *Writer) WriteLink(s Style, display, url string)
- func (w *Writer) WriteText(stringContents string)
Constants ¶
const ( FontTypeInbuilt fontType = "inbuilt_font" FontTypeCustom fontType = "custom_font" FontTypeGoogle fontType = "google_font" )
const ( FontStyleRegular = "" FontStyleBold = "B" FontStyleItalic = "I" FontStyleBoldItalic = "BI" )
Variables ¶
var CodeFontsGoogle = map[string]Font{ FontAnonymousPro.Family: FontAnonymousPro, FontAzeretMono.Family: FontAzeretMono, FontB612Mono.Family: FontB612Mono, FontChivoMono.Family: FontChivoMono, FontCourierPrime.Family: FontCourierPrime, FontCousine.Family: FontCousine, FontCutiveMono.Family: FontCutiveMono, FontDMMono.Family: FontDMMono, FontFiraCode.Family: FontFiraCode, FontFiraMono.Family: FontFiraMono, FontFragmentMono.Family: FontFragmentMono, FontIBMPlexMono.Family: FontIBMPlexMono, FontInconsolata.Family: FontInconsolata, FontJetBrainsMono.Family: FontJetBrainsMono, FontMajorMonoDisplay.Family: FontMajorMonoDisplay, FontMartianMono.Family: FontMartianMono, FontNanumGothicCoding.Family: FontNanumGothicCoding, FontNotoSansMono.Family: FontNotoSansMono, FontNovaMono.Family: FontNovaMono, FontOverpassMono.Family: FontOverpassMono, FontOxygenMono.Family: FontOxygenMono, FontPTMono.Family: FontPTMono, FontRedHatMono.Family: FontRedHatMono, FontRobotoMono.Family: FontRobotoMono, FontShareTechMono.Family: FontShareTechMono, FontSourceCodePro.Family: FontSourceCodePro, FontSpaceMono.Family: FontSpaceMono, FontSplineSansMono.Family: FontSplineSansMono, FontSyneMono.Family: FontSyneMono, FontUbuntuMono.Family: FontUbuntuMono, FontVT323.Family: FontVT323, FontXanhMono.Family: FontXanhMono, }
var CodeFontsInbuilt = map[string]Font{FontCourier.Family: FontCourier}
A map of the inbuilt monospace fonts. To be used for code blocks
var FontAlbertSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Albert Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAlegreya = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Alegreya", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAlegreyaSC = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Alegreya SC", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAlegreyaSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Alegreya Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAlegreyaSansSC = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Alegreya Sans SC", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAleo = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Aleo", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAlmendra = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Almendra", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAlumniSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Alumni Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAmaranth = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Amaranth", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAmiri = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Amiri", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAndadaPro = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Andada Pro", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAndika = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Andika", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAnonymousPro = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Anonymous Pro", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAnybody = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Anybody", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontArchivo = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Archivo", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontArchivoNarrow = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Archivo Narrow", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontArimo = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Arimo", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontArsenal = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Arsenal", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontArvo = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Arvo", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAsap = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Asap", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAsapCondensed = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Asap Condensed", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAtkinsonHyperlegible = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Atkinson Hyperlegible", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAveriaLibre = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Averia Libre", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAveriaSansLibre = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Averia Sans Libre", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAveriaSerifLibre = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Averia Serif Libre", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontAzeretMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Azeret Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontB612 = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "B612", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontB612Mono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "B612 Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBaiJamjuree = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Bai Jamjuree", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBalsamiqSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Balsamiq Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBarlow = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Barlow", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBarlowCondensed = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Barlow Condensed", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBarlowSemiCondensed = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Barlow Semi Condensed", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBeVietnamPro = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Be Vietnam Pro", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBellota = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Bellota", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBellotaText = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Bellota Text", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBesley = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Besley", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBitter = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Bitter", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBodoniModa = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Bodoni Moda", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontBrygada1918 = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Brygada 1918", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCabin = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Cabin", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCaladea = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Caladea", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCambay = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Cambay", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCantarell = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Cantarell", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCaudex = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Caudex", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontChakraPetch = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Chakra Petch", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCharisSIL = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Charis SIL", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontChivo = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Chivo", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontChivoMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Chivo Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontComicNeue = Font{ CanUseForCode: false, CanUseForText: true, Category: "handwriting", Family: "Comic Neue", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCormorant = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Cormorant", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCormorantGaramond = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Cormorant Garamond", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCormorantInfant = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Cormorant Infant", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCourier = Font{ CanUseForText: true, CanUseForCode: true, Category: "monospace", Family: "Courier", Type: FontTypeInbuilt, }
var FontCourierPrime = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Courier Prime", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCousine = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Cousine", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCrimsonPro = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Crimson Pro", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCrimsonText = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Crimson Text", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCuprum = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Cuprum", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontCutiveMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Cutive Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontDMMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "DM Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontDMSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "DM Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontEBGaramond = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "EB Garamond", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontEconomica = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Economica", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontEpilogue = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Epilogue", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontExo = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Exo", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontExo2 = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Exo 2", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontExpletusSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Expletus Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFahkwang = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Fahkwang", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFamiljenGrotesk = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Familjen Grotesk", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFaustina = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Faustina", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFigtree = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Figtree", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFinlandica = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Finlandica", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFiraCode = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Fira Code", FileBold: "700", FileBoldItalic: "700", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFiraMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Fira Mono", FileBold: "700", FileBoldItalic: "700", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFiraSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Fira Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFiraSansCondensed = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Fira Sans Condensed", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
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, }
var FontFragmentMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Fragment Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontFraunces = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Fraunces", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGFSNeohellenic = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "GFS Neohellenic", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGantari = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Gantari", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGelasio = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Gelasio", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGenos = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Genos", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGentiumBookBasic = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Gentium Book Basic", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGentiumBookPlus = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Gentium Book Plus", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGentiumPlus = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Gentium Plus", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGeorama = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Georama", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGlory = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Glory", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGrandstander = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Grandstander", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontGrenze = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Grenze", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontHankenGrotesk = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Hanken Grotesk", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontHelvetica = Font{ CanUseForText: true, CanUseForCode: false, Category: "sans-serif", Family: "Helvetica", Type: FontTypeInbuilt, }
var FontIBMPlexMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "IBM Plex Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontIBMPlexSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "IBM Plex Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
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, }
var FontIBMPlexSerif = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "IBM Plex Serif", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontIbarraRealNova = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Ibarra Real Nova", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontInconsolata = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Inconsolata", FileBold: "700", FileBoldItalic: "700", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontInriaSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Inria Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontInriaSerif = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Inria Serif", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontInterTight = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Inter Tight", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontIstokWeb = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Istok Web", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontJetBrainsMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "JetBrains Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontJosefinSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Josefin Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontJosefinSlab = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Josefin Slab", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontJost = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Jost", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontK2D = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "K2D", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontKanit = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Kanit", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontKantumruyPro = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Kantumruy Pro", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontKarla = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Karla", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontKoHo = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "KoHo", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontKodchasan = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Kodchasan", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontKrub = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Krub", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontKufam = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Kufam", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontKulimPark = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Kulim Park", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontLato = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Lato", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontLibreBodoni = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Libre Bodoni", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontLibreFranklin = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Libre Franklin", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontLiterata = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Literata", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontLivvic = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Livvic", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontLobsterTwo = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Lobster Two", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontLora = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Lora", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMajorMonoDisplay = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Major Mono Display", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMali = Font{ CanUseForCode: false, CanUseForText: true, Category: "handwriting", Family: "Mali", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontManuale = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Manuale", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMartianMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Martian Mono", FileBold: "700", FileBoldItalic: "700", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMarvel = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Marvel", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMerriweather = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Merriweather", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMerriweatherSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Merriweather Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMohave = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Mohave", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMontserrat = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Montserrat", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMontserratAlternates = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Montserrat Alternates", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMulish = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Mulish", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontMuseoModerno = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "MuseoModerno", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNanumGothicCoding = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Nanum Gothic Coding", FileBold: "700", FileBoldItalic: "700", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNewsreader = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Newsreader", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNiramit = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Niramit", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNobile = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Nobile", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNoticiaText = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Noticia Text", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNotoSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Noto Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNotoSansDisplay = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Noto Sans Display", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNotoSansMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Noto Sans Mono", FileBold: "700", FileBoldItalic: "700", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNotoSerif = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Noto Serif", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNotoSerifDisplay = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Noto Serif Display", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNotoSerifTamil = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Noto Serif Tamil", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNovaMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Nova Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNunito = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Nunito", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontNunitoSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Nunito Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontOpenSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Open Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontOverlock = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Overlock", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontOverpass = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Overpass", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontOverpassMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Overpass Mono", FileBold: "700", FileBoldItalic: "700", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontOxygenMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Oxygen Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPTMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "PT Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPTSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "PT Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPTSerif = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "PT Serif", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPetrona = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Petrona", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPhilosopher = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Philosopher", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPiazzolla = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Piazzolla", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPlayfairDisplay = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Playfair Display", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPlayfairDisplaySC = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Playfair Display SC", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPlusJakartaSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Plus Jakarta Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPoppins = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Poppins", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPrompt = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Prompt", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontProzaLibre = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Proza Libre", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPublicSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Public Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontPuritan = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Puritan", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontQuantico = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Quantico", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontQuattrocentoSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Quattrocento Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRadioCanada = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Radio Canada", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRaleway = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Raleway", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRambla = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Rambla", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRasa = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Rasa", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRedHatDisplay = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Red Hat Display", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRedHatMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Red Hat Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRedHatText = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Red Hat Text", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRoboto = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Roboto", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRobotoCondensed = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Roboto Condensed", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRobotoMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Roboto Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRobotoSerif = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Roboto Serif", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRosario = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Rosario", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontRubik = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Rubik", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSTIXTwoText = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "STIX Two Text", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSaira = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Saira", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSansita = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Sansita", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSarabun = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Sarabun", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontScada = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Scada", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
false, CanUseForText: true, Category: "display", Family: "Share", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }CanUseForCode:
true, CanUseForText: false, Category: "monospace", Family: "Share Tech Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }CanUseForCode:
var FontSourceCodePro = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Source Code Pro", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSourceSans3 = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Source Sans 3", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSourceSansPro = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Source Sans Pro", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSourceSerif4 = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Source Serif 4", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSourceSerifPro = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Source Serif Pro", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSpaceMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Space Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSpectral = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Spectral", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSpectralSC = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Spectral SC", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSplineSansMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Spline Sans Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontSyneMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Syne Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontTaviraj = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Taviraj", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontTexturina = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Texturina", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontThasadith = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Thasadith", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontTimes = Font{ CanUseForText: true, CanUseForCode: false, Category: "serif", Family: "Times", Type: FontTypeInbuilt, }
var FontTinos = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Tinos", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontTitilliumWeb = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Titillium Web", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontTomorrow = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Tomorrow", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontTourney = Font{ CanUseForCode: false, CanUseForText: true, Category: "display", Family: "Tourney", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontTrirong = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Trirong", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontUbuntu = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Ubuntu", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontUbuntuMono = Font{ CanUseForCode: true, CanUseForText: true, Category: "monospace", Family: "Ubuntu Mono", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontUnna = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Unna", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontUrbanist = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Urbanist", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontVT323 = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "VT323", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "regular", FileRegular: "regular", Type: FontTypeGoogle, }
var FontVolkhov = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Volkhov", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontVollkorn = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Vollkorn", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontWorkSans = Font{ CanUseForCode: false, CanUseForText: true, Category: "sans-serif", Family: "Work Sans", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontXanhMono = Font{ CanUseForCode: true, CanUseForText: false, Category: "monospace", Family: "Xanh Mono", FileBold: "regular", FileBoldItalic: "regular", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontYrsa = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Yrsa", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var FontZillaSlab = Font{ CanUseForCode: false, CanUseForText: true, Category: "serif", Family: "Zilla Slab", FileBold: "700", FileBoldItalic: "700italic", FileItalic: "italic", FileRegular: "regular", Type: FontTypeGoogle, }
var TextFontsGoogle = map[string]Font{}/* 199 elements not displayed */
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 New ¶
func New(options ...Option) goldrender.Renderer
NewRreturns a new PDF Renderer with given options.
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 ¶
Returns a font from CodeFontsInbuilt and CodeFontsGoogle, or the backup
func GetTextFont ¶
Returns a font from one of TextFontsInbuilt and TextFontsGoogle, or the backup
type Fpdf ¶
func (*Fpdf) AddInternalLink ¶ added in v0.2.0
func (Fpdf) CellFormat ¶
func (Fpdf) GetMargins ¶
func (Fpdf) RegisterImage ¶
Images
func (Fpdf) SetMarginRight ¶
func (Fpdf) SetMarginTop ¶
func (Fpdf) WriteExternalLink ¶
func (*Fpdf) WriteInternalLink ¶ added in v0.2.0
type FpdfConfig ¶
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 WithCodeBlockTheme ¶
func WithCodeBlockTheme(theme *chroma.Style) Option
Set the code block chroma theme
func WithContext ¶
Add a context that will be used for operations like downloading 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 WithNodeRenderers ¶
func WithNodeRenderers(ps ...util.PrioritizedValue) Option
Extend the NodeRenderers to support or overwrite how nodes are rendered.
func WithTraceWriter ¶
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 ¶
Converts a chroma.StyleEntry to a Style, based on the backtickStyle
func (*Writer) GetBacktickStyle ¶
Returns the current style with the font set to Styles.CodeFont
func (*Writer) GetLinkStyle ¶
Returns the currentStyle adding underline and setting the color to Styles.LinkColor