Skip to content

Commit f0f037b

Browse files
committed
Fix @font-face src format() rule for CSS::Font::Resources
1 parent 14e55d9 commit f0f037b

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

lib/CSS/Module/CSS3/Fonts/AtFontFace/Gen/Actions.rakumod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ method family-name ($/) {
55
method font-src-expr ($/) {
66
make $.build.rule($/)
77
}
8+
method font-format ($/) {
9+
make $.build.rule($/)
10+
}
811
method font-face-name ($/) {
912
make $.build.rule($/)
1013
}

lib/CSS/Module/CSS3/Fonts/AtFontFace/Gen/Grammar.rakumod

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@ rule css-val-font-weight { :i [normal | bold ]& <keyw> || [100 | 200 | 300 | 40
6262
#| src: <font-src-expr>#
6363
rule decl:sym<src> { :i (src) ":" <val(/<css-val-src> +% <op(",")> /, &?ROUTINE.WHY)>}
6464
rule css-val-src { :i <font-src-expr> }
65-
#| <font-src-expr> = [<uri>|local(<font-face-name>)] [format(<string>#)]? | <font-face-name>
65+
#| <font-src-expr> = [<uri>|local(<font-face-name>)] [format(<font-format>#)]? | <font-face-name>
6666
rule font-src-expr { :i [<uri> || <local> ] <format> ? || <font-face-name> }
67+
#| <font-format> = [<string> | collection | embedded-opentype | opentype | svg | truetype | woff | woff2 ]
68+
rule font-format { :i [<string> || [collection | "embedded-opentype" | opentype | svg | truetype | woff | woff2 ]& <keyw> ] }
6769
#| <font-face-name> = <identifiers> | <string>
6870
rule font-face-name { :i <identifiers> || <string> }
6971
#| local(<font-face-name>)
7072
rule local { :i "local(" [<font-face-name> || <usage(&?ROUTINE.WHY)> ] ")" }
71-
#| format(<string>#)
72-
rule format { :i "format(" [<string> +% "," || <usage(&?ROUTINE.WHY)> ] ")" }
73+
#| format(<font-format>#)
74+
rule format { :i "format(" [<font-format> +% "," || <usage(&?ROUTINE.WHY)> ] ")" }
7375
#| unicode-range: <urange>#
7476
rule decl:sym<unicode-range> { :i ("unicode-range") ":" <val(/<css-val-unicode-range> +% <op(",")> /, &?ROUTINE.WHY)>}
7577
rule css-val-unicode-range { :i <urange> }

src/css3x-font-@fontface-properties.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ font-style normal | italic | oblique normal
77
font-variant normal | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic(<feature-value-name>) || historical-forms || styleset(<feature-value-name>#) || character-variant(<feature-value-name>#) || swash(<feature-value-name>) || ornaments(<feature-value-name>) || annotation(<feature-value-name>) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ] normal
88
font-weight normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 normal
99
src <font-src-expr># N/A
10-
<font-src-expr> = [<uri>|local(<font-face-name>)] [format(<string>#)]? | <font-face-name>
10+
<font-src-expr> = [<uri>|local(<font-face-name>)] [format(<font-format>#)]? | <font-face-name>
11+
<font-format>= [<string> | collection | embedded-opentype | opentype | svg | truetype | woff | woff2 ]
1112
<font-face-name> = <identifiers> | <string>
1213
<local()> = local(<font-face-name>)
13-
<format()> = format(<string>#)
14+
<format()> = format(<font-format>#)
1415
unicode-range <urange># U+0-10FFFF

0 commit comments

Comments
 (0)