View on GitHub

CSS-Font-Resources-raku

CSS `@font-face` driven Font Selection and Loading

[Raku CSS Project] / [CSS-Font-Resources] / CSS::Font :: Resources

class CSS::Font::Resources

Lightweight CSS Font Resource Manager

Description

This is lightweight font resource manager, driven by CSS @font-face font descriptors.

Methods

method match

method match(
    @font-face = Code.new
) returns Mu

Return only matching font-descriptors

These are matched and ordered by preference, using the W3C Font Matching Algorithm.

multi method sources

multi method sources(
    Bool :$fallback = Bool::True,
    |c
) returns Mu

Return sources for matching fonts

These matches are ordered by user preference. The fonts themselves can be fetched using the .IO or .Str or Blob methods on the first matching font.