class
Components::Assets::FontAsset
- Components::Assets::FontAsset
- Reference
- Object
Overview
Describes a web font delivery strategy without forcing CDN or self-hosting. CDN assets emit stylesheet/preconnect tags; self-hosted assets emit preload tags plus @font-face CSS.
Defined in:
components/assets/font_asset.crConstructors
- .cdn(family : String, stylesheet_href : String) : FontAsset
- .new(family : String, href : String, weight : String = "400", style : String = "normal", format : String = "woff2", display : String = "swap", strategy : Symbol = :self_hosted, preload : Bool = true)
- .self_hosted(family : String, href : String, weight : String = "400", style : String = "normal", format : String = "woff2", display : String = "swap", preload : Bool = true) : FontAsset
Instance Method Summary
- #display : String
- #family : String
- #font_face_css : String
- #format : String
- #href : String
- #link_tags : String
- #preload : Bool
- #strategy : Symbol
- #style : String
- #weight : String
Constructor Detail
def self.new(family : String, href : String, weight : String = "400", style : String = "normal", format : String = "woff2", display : String = "swap", strategy : Symbol = :self_hosted, preload : Bool = true)
#
def self.self_hosted(family : String, href : String, weight : String = "400", style : String = "normal", format : String = "woff2", display : String = "swap", preload : Bool = true) : FontAsset
#