Skip to content

Commit

Permalink
feat(deps): update fontaine to use new capsize metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 7, 2024
1 parent 2b1588a commit 1800995
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 30 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"css-tree": "^2.3.1",
"defu": "^6.1.4",
"esbuild": "^0.20.1",
"fontaine": "^0.4.1",
"fontaine": "^0.5.0",
"globby": "^14.0.1",
"h3": "^1.11.1",
"jiti": "^1.21.0",
Expand Down Expand Up @@ -79,4 +79,4 @@
"resolutions": {
"@nuxt/fonts": "workspace:*"
}
}
}
32 changes: 19 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions test/basic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ describe('features', () => {
const html = await $fetch('/fallbacks')
expect(extractFontFaces('Lato Fallback: Arial', html)).toMatchInlineSnapshot(`
[
"@font-face{font-family:"Lato Fallback: Arial";src:local("Arial");size-adjust:97.4159%;ascent-override:101.3181%;descent-override:21.865%;line-gap-override:0%}",
"@font-face{font-family:"Lato Fallback: Arial";src:local("Arial");size-adjust:97.6894%;ascent-override:101.0345%;descent-override:21.8038%;line-gap-override:0%}",
]
`)
expect(extractFontFaces('Nunito Fallback: Arial', html)).toMatchInlineSnapshot(`
[
"@font-face{font-family:"Nunito Fallback: Arial";src:local("Arial");size-adjust:101.7204%;ascent-override:99.3901%;descent-override:34.703%;line-gap-override:0%}",
"@font-face{font-family:"Nunito Fallback: Arial";src:local("Arial");size-adjust:101.3906%;ascent-override:99.7134%;descent-override:34.8159%;line-gap-override:0%}",
]
`)
})
Expand All @@ -96,12 +96,12 @@ describe('features', () => {
const html = await $fetch('/fallbacks')
expect(extractFontFaces('Oswald Fallback: Times New Roman', html)).toMatchInlineSnapshot(`
[
"@font-face{font-family:"Oswald Fallback: Times New Roman";src:local("Times New Roman");size-adjust:90.5221%;ascent-override:131.791%;descent-override:31.9259%;line-gap-override:0%}",
"@font-face{font-family:"Oswald Fallback: Times New Roman";src:local("Times New Roman");size-adjust:89.3538%;ascent-override:133.5141%;descent-override:32.3433%;line-gap-override:0%}",
]
`)
expect(extractFontFaces('Fredoka Fallback: Tahoma', html)).toMatchInlineSnapshot(`
[
"@font-face{font-family:"Fredoka Fallback: Tahoma";src:local("Tahoma");size-adjust:101.2772%;ascent-override:96.1717%;descent-override:23.3024%;line-gap-override:0%}",
"@font-face{font-family:"Fredoka Fallback: Tahoma";src:local("Tahoma");size-adjust:101.395%;ascent-override:96.06%;descent-override:23.2753%;line-gap-override:0%}",
]
`)
})
Expand Down
22 changes: 11 additions & 11 deletions test/parse.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ describe('parsing', () => {
"@font-face {
font-family: "Open Sans Fallback: Times New Roman";
src: local("Times New Roman");
size-adjust: 116.6056%;
ascent-override: 91.6635%;
descent-override: 25.1248%;
size-adjust: 115.3846%;
ascent-override: 92.6335%;
descent-override: 25.3906%;
line-gap-override: 0%;
}
Expand Down Expand Up @@ -82,19 +82,19 @@ describe('parsing', () => {
"@font-face {
font-family: "Poppins Fallback: Arial";
src: local("Arial");
size-adjust: 113.7274%;
ascent-override: 92.326%;
descent-override: 30.7753%;
line-gap-override: 8.793%;
size-adjust: 112.1577%;
ascent-override: 93.6182%;
descent-override: 31.2061%;
line-gap-override: 8.916%;
}
@font-face {
font-family: "Poppins Fallback: Times New Roman";
src: local("Times New Roman");
size-adjust: 125.5306%;
ascent-override: 83.6449%;
descent-override: 27.8816%;
line-gap-override: 7.9662%;
size-adjust: 123.0769%;
ascent-override: 85.3125%;
descent-override: 28.4375%;
line-gap-override: 8.125%;
}
@font-face {
Expand Down

0 comments on commit 1800995

Please sign in to comment.