Pattern

[Raku CSS Project] / [CSS-Properties] / CSS::Font :: Pattern

class CSS::Font::Pattern

Implements CSS Font Patterns and Matching

Synopsis

my CSS::Font $font .= new: :font-props("italic bold condensed 10pt/12pt times-roman);
my CSS::Stylesheet:D $css .= parse('style.css'.IO.slurp);
my CSS::Font::Descriptor @font-face = $css.font-face;
my CSS::Font::Pattern $patt = $font.pattern;
my  CSS::Font::Descriptor @matches = $patt.match(@font-face);
say @matches.first.Str;

Description

Implements CSS font matching for a font against CSS::Font::Descriptor @font-face rules.

See Font Matching Algorithm

Methods

match

method match(CSS::Font::Descriptor @font-face) returns Array[CSS::Font::Descriptor]

Reduces a list of font descriptors to matching fonts, ordered by preference.

CSS::Properties v0.8.1

CSS property manipulation library

Authors

  • David Warring

License

Artistic-2.0

Dependencies

CSS::Module:ver<0.5.9+>CSS::Writer:ver<0.2.8+>ColorMethod::Also

Test Dependencies

Provides

  • CSS::Box
  • CSS::Font
  • CSS::Font::Descriptor
  • CSS::Font::Pattern
  • CSS::PageBox
  • CSS::Properties
  • CSS::Properties::Calculator
  • CSS::Properties::Font
  • CSS::Properties::Optimizer
  • CSS::Properties::Property
  • CSS::Units

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.