legos/font
Types
pub type Adjustment {
Adjustment(
capital: Float,
lowercase: Float,
baseline: Float,
descender: Float,
)
}
Constructors
-
Adjustment( capital: Float, lowercase: Float, baseline: Float, descender: Float, )
pub type ExternalFontConfig {
ExternalFontConfig(url: String, name: String)
}
Constructors
-
ExternalFontConfig(url: String, name: String)
pub type FontConfig {
FontConfig(
name: String,
adjustment: option.Option(@internal Adjustment),
variants: List(@internal Variant),
)
}
Constructors
-
FontConfig( name: String, adjustment: option.Option(@internal Adjustment), variants: List(@internal Variant), )
Add a text shadow
pub type TextShadowConfig {
TextShadowConfig(
offset: #(Float, Float),
blur: Float,
color: @internal Color,
)
}
Constructors
-
TextShadowConfig( offset: #(Float, Float), blur: Float, color: @internal Color, )
Values
pub fn align_left() -> @internal Attribute(@internal Aligned, msg)
Align text to the left
pub fn align_right() -> @internal Attribute(
@internal Aligned,
msg,
)
Align text to the right
pub fn color(
font_color: @internal Color,
) -> @internal Attribute(decorative, msg)
Set the font color
pub fn extra_bold() -> @internal Attribute(@internal Aligned, msg)
Extra bold font weight
pub fn extra_light() -> @internal Attribute(
@internal Aligned,
msg,
)
Extra light font weight
pub fn family(
families: List(@internal Font),
) -> @internal Attribute(@internal Aligned, msg)
Set the font family from a list of fonts
pub fn feature(name: String, on: Bool) -> @internal Variant
Set a feature by name and enabled state
pub fn glow(
clr: @internal Color,
intensity: Float,
) -> @internal Attribute(decorative, msg)
Add a glow effect (simplified shadow)
pub fn indexed(name: String, index: Int) -> @internal Variant
Set an indexed font variant
pub fn letter_spacing(
offset: Float,
) -> @internal Attribute(@internal Aligned, msg)
Set letter spacing in pixels
pub fn semi_bold() -> @internal Attribute(@internal Aligned, msg)
Semi-bold font weight
pub fn shadow(
config: TextShadowConfig,
) -> @internal Attribute(decorative, msg)
pub fn size_by_capital() -> @internal Attribute(
@internal Aligned,
msg,
)
Size by capital height
pub fn unitalicized() -> @internal Attribute(
@internal Aligned,
msg,
)
Remove italic styling
pub fn variant(
var: @internal Variant,
) -> @internal Attribute(@internal Aligned, msg)
Set a single font variant
pub fn variant_list(
vars: List(@internal Variant),
) -> @internal Attribute(@internal Aligned, msg)
Set multiple font variants
pub fn word_spacing(
offset: Float,
) -> @internal Attribute(@internal Aligned, msg)
Set word spacing in pixels