Documentation
¶
Index ¶
Constants ¶
View Source
const ( AxisWeight = "wght" // Weight axis AxisWidth = "wdth" // Width axis AxisSlant = "slnt" // Slant axis AxisItalic = "ital" // Italic axis AxisOpticalSize = "opsz" // Optical size axis AxisTexture = "TXTR" // Texture healing AxisLigatures = "liga" // Ligatures )
Common variable font axis tags
View Source
const ( MonaspaceWeightMin = 200 MonaspaceWeightMax = 800 MonaspaceWidthMin = 100 MonaspaceWidthMax = 125 MonaspaceSlantMin = -11 MonaspaceSlantMax = 1 )
Monaspace specific ranges
Variables ¶
This section is empty.
Functions ¶
func IsFontAvailable ¶
IsFontAvailable is a super fast check to see if the given font is available on the system
Types ¶
type FallbackVariant ¶ added in v0.3.0
type FallbackVariant string
FallbackVariant represents the type of fallback font to use
const ( FallbackSans FallbackVariant = "sans" FallbackMono FallbackVariant = "mono" )
type Font ¶
type Font struct { Name string // Name of the font family Font *opentype.Font // Parsed font Style FontStyle // Style information for this font variant FilePath string // Path to the font file on disk Filename string // Name of the font file }
Font represents a loaded font with its metadata
func GetFallback ¶
func GetFallback(variant FallbackVariant) (*Font, error)
GetFallback returns either Monaspace Argon or Neon as the fallback font
func GetFontVariants ¶
func (*Font) GetFontFace ¶
GetFontFace returns a font.Face with the specified size
type FontStyle ¶
type FontStyle struct { Weight FontWeight // Font weight Italic bool // Whether the font is italic Condensed bool // Whether the font is condensed Mono bool // Whether the font is monospaced Variations map[string]float32 // Variable font variations }
FontStyle represents the style of a font
type FontWeight ¶
type FontWeight int
FontWeight represents the weight of a font
const ( WeightThin FontWeight = iota + 1 // Thinnest font weight WeightExtraLight // Extra light font weight WeightLight // Light font weight WeightRegular // Regular (normal) font weight WeightMedium // Medium font weight WeightSemiBold // Semi-bold font weight WeightBold // Bold font weight WeightExtraBold // Extra bold font weight WeightBlack // Black font weight WeightHeavy // Heaviest font weight )
Font weight constants represent standard font weights from thin to heavy
Click to show internal directories.
Click to hide internal directories.