package d2fonts

Import Path
	oss.terrastruct.com/d2/d2renderers/d2fonts (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 6 packages

Involved Source Files TODO write a script to do this as part of CI Currently using an online converter: https://dopiaza.org/tools/datauri/index.php
Package-Level Type Names (total 3)
/* sort by: | */
Family FontFamily Size int Style FontStyle ( Font) GetEncodedSubset(corpus string) string func FontFamily.Font(size int, style FontStyle) Font func AddFontStyle(font Font, style FontStyle, ttf []byte) error func oss.terrastruct.com/d2/lib/textmeasure.(*Ruler).Measure(font Font, s string) (width, height int) func oss.terrastruct.com/d2/lib/textmeasure.(*Ruler).MeasureMono(font Font, s string) (width, height int) func oss.terrastruct.com/d2/lib/textmeasure.(*Ruler).MeasurePrecise(font Font, s string) (width, height float64)
( FontFamily) Font(size int, style FontStyle) Font func AddFontFamily(name string, regularTTF, italicTTF, boldTTF, semiboldTTF []byte) (*FontFamily, error) func oss.terrastruct.com/d2/d2renderers/d2svg.EmbedFonts(buf *bytes.Buffer, diagramHash, source string, fontFamily *FontFamily, corpus string) func oss.terrastruct.com/d2/d2exporter.Export(ctx context.Context, g *d2graph.Graph, fontFamily *FontFamily) (*d2target.Diagram, error) func oss.terrastruct.com/d2/d2graph.GetTextDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler, t *d2target.MText, fontFamily *FontFamily) *d2target.TextDimensions func oss.terrastruct.com/d2/d2graph.(*Graph).SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler, fontFamily *FontFamily) error func oss.terrastruct.com/d2/d2graph.(*Object).GetDefaultSize(mtexts []*d2target.MText, ruler *textmeasure.Ruler, fontFamily *FontFamily, labelDims d2target.TextDimensions, withLabelPadding bool) (*d2target.TextDimensions, error) func oss.terrastruct.com/d2/d2graph.(*Object).GetLabelSize(mtexts []*d2target.MText, ruler *textmeasure.Ruler, fontFamily *FontFamily) (*d2target.TextDimensions, error) func oss.terrastruct.com/d2/lib/textmeasure.MeasureMarkdown(mdText string, ruler *textmeasure.Ruler, fontFamily *FontFamily, fontSize int) (width, height int, err error) func oss.terrastruct.com/d2/lib/textmeasure.(*Ruler).HasFontFamilyLoaded(fontFamily *FontFamily) bool const HandDrawn const SourceCodePro const SourceSansPro
func AddFontStyle(font Font, style FontStyle, ttf []byte) error func FontFamily.Font(size int, style FontStyle) Font const FONT_STYLE_BOLD const FONT_STYLE_ITALIC const FONT_STYLE_REGULAR const FONT_STYLE_SEMIBOLD
Package-Level Functions (total 2)
func AddFontFamily(name string, regularTTF, italicTTF, boldTTF, semiboldTTF []byte) (*FontFamily, error)
func AddFontStyle(font Font, style FontStyle, ttf []byte) error
Package-Level Constants (total 14)
const FONT_SIZE_L = 20
const FONT_SIZE_M = 16
const FONT_SIZE_S = 14
const FONT_SIZE_XL = 24
const FONT_SIZE_XS = 13
const FONT_SIZE_XXL = 28
const FONT_SIZE_XXXL = 32
const FONT_STYLE_BOLD FontStyle = "bold"
const FONT_STYLE_ITALIC FontStyle = "italic"
const FONT_STYLE_REGULAR FontStyle = "regular"
const FONT_STYLE_SEMIBOLD FontStyle = "semibold"
const HandDrawn FontFamily = "HandDrawn"
const SourceCodePro FontFamily = "SourceCodePro"
const SourceSansPro FontFamily = "SourceSansPro"