Documentation ¶
Overview ¶
TODO write a script to do this as part of CI Currently using an online converter: https://dopiaza.org/tools/datauri/index.php
Index ¶
Constants ¶
View Source
const ( FONT_SIZE_XS = 13 FONT_SIZE_S = 14 FONT_SIZE_M = 16 FONT_SIZE_L = 20 FONT_SIZE_XL = 24 FONT_SIZE_XXL = 28 FONT_SIZE_XXXL = 32 FONT_STYLE_REGULAR FontStyle = "regular" FONT_STYLE_BOLD FontStyle = "bold" FONT_STYLE_SEMIBOLD FontStyle = "semibold" FONT_STYLE_ITALIC FontStyle = "italic" SourceSansPro FontFamily = "SourceSansPro" SourceCodePro FontFamily = "SourceCodePro" HandDrawn FontFamily = "HandDrawn" )
Variables ¶
View Source
var D2_FONT_TO_FAMILY = map[string]FontFamily{ "default": SourceSansPro, "mono": SourceCodePro, }
View Source
var FontEncodings map[Font]string
View Source
var FontFaces map[Font][]byte
View Source
var FontFamilies = []FontFamily{ SourceSansPro, SourceCodePro, HandDrawn, }
View Source
var FontSizes = []int{ FONT_SIZE_XS, FONT_SIZE_S, FONT_SIZE_M, FONT_SIZE_L, FONT_SIZE_XL, FONT_SIZE_XXL, FONT_SIZE_XXXL, }
View Source
var FontStyles = []FontStyle{ FONT_STYLE_REGULAR, FONT_STYLE_BOLD, FONT_STYLE_SEMIBOLD, FONT_STYLE_ITALIC, }
Functions ¶
Types ¶
type Font ¶
type Font struct { Family FontFamily Style FontStyle Size int }
func (Font) GetEncodedSubset ¶ added in v0.3.0
type FontFamily ¶
type FontFamily string
func AddFontFamily ¶ added in v0.3.0
func AddFontFamily(name string, regularTTF, italicTTF, boldTTF, semiboldTTF []byte) (*FontFamily, error)
Click to show internal directories.
Click to hide internal directories.