Documentation ¶
Index ¶
- func FindFonts(fontsPath string, config adrianConfig.Config)
- func FontFaceCSS(font FontData, fontWeights []int, display string) string
- func GetCanonicalExtension(filePath string) string
- func InstantiateWatcher(path string, config adrianConfig.Config)
- func LoadFont(filePath string, config adrianConfig.Config)
- type FontData
- type FontFileData
- type FontVariant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindFonts ¶
func FindFonts(fontsPath string, config adrianConfig.Config)
FindFonts loads all the fonts in a directory
func FontFaceCSS ¶
FontFaceCSS generates the CSS for a font
func GetCanonicalExtension ¶
GetCanonicalExtension is
func InstantiateWatcher ¶
func InstantiateWatcher(path string, config adrianConfig.Config)
InstantiateWatcher is a thing
func LoadFont ¶
func LoadFont(filePath string, config adrianConfig.Config)
LoadFont loads a font into memory
Types ¶
type FontData ¶
type FontData struct { Family string Metadata map[sfnt.NameID]string Variants map[string]FontVariant }
FontData describes a font file and the various metadata associated with it.
type FontFileData ¶
type FontFileData struct { Name string Path string FileName string Extension string CSSFormat string MD5 string }
FontFileData describes a font (format) belonging to a font family
type FontVariant ¶
type FontVariant struct { Name string SubFamily string UniqueID string CSSFontStyle string CSSWeight int Files map[string]FontFileData }
FontVariant describes a variant (ex: "Black", "Italic") of a font
func GetFontVariantByUniqueID ¶
func GetFontVariantByUniqueID(uniqueID string) (fontVariant *FontVariant, err error)
GetFontVariantByUniqueID returns the data for a single font by its unique ID
Click to show internal directories.
Click to hide internal directories.