diff --git a/docs/_scripts/serve.sh b/docs/_scripts/serve.sh index ed795542a..203156643 100755 --- a/docs/_scripts/serve.sh +++ b/docs/_scripts/serve.sh @@ -3,7 +3,7 @@ set -e cd "$(dirname "$0")/.." if [ ! -d lab/fonts ]; then - ln -fs ../../build/unhinted lab/fonts + ln -fs ../../build/fonts lab/fonts fi # jekyll is a little dumb and resolves the lab/fonts symlink and copies @@ -11,15 +11,15 @@ fi # Let's work around that. # # Step 1/2: remove any previous symlink, or jekyll crashes -rm -rf _site/lab/fonts +rm -f _site/lab/fonts # # Step 2/2: create symlink again after some delay. Ugh. sh <<_EOF_ & N=3 while [ \$N -gt 0 ]; do sleep 1 - rm -rf _site/lab/fonts - ln -fs ../../../build/unhinted _site/lab/fonts + rm -f _site/lab/fonts + ln -fs ../../../build/fonts _site/lab/fonts let N=N-1 done _EOF_ diff --git a/docs/inter-ui.css b/docs/inter-ui.css index ccd5a0aff..542b6fd5d 100644 --- a/docs/inter-ui.css +++ b/docs/inter-ui.css @@ -2,14 +2,16 @@ font-family: 'Inter UI'; font-style: normal; font-weight: 400; - src: url("font-files/Inter-UI-Regular.woff2?v=2.5") format("woff2"), + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url("font-files/Inter-UI-Regular.woff2?v=2.5") format("woff2"), url("font-files/Inter-UI-Regular.woff?v=2.5") format("woff"); } @font-face { font-family: 'Inter UI'; font-style: italic; font-weight: 400; - src: url("font-files/Inter-UI-Italic.woff2?v=2.5") format("woff2"), + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url("font-files/Inter-UI-Italic.woff2?v=2.5") format("woff2"), url("font-files/Inter-UI-Italic.woff?v=2.5") format("woff"); } @@ -17,14 +19,16 @@ font-family: 'Inter UI'; font-style: normal; font-weight: 500; - src: url("font-files/Inter-UI-Medium.woff2?v=2.5") format("woff2"), + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url("font-files/Inter-UI-Medium.woff2?v=2.5") format("woff2"), url("font-files/Inter-UI-Medium.woff?v=2.5") format("woff"); } @font-face { font-family: 'Inter UI'; font-style: italic; font-weight: 500; - src: url("font-files/Inter-UI-MediumItalic.woff2?v=2.5") format("woff2"), + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url("font-files/Inter-UI-MediumItalic.woff2?v=2.5") format("woff2"), url("font-files/Inter-UI-MediumItalic.woff?v=2.5") format("woff"); } @@ -32,14 +36,16 @@ font-family: 'Inter UI'; font-style: normal; font-weight: 700; - src: url("font-files/Inter-UI-Bold.woff2?v=2.5") format("woff2"), + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url("font-files/Inter-UI-Bold.woff2?v=2.5") format("woff2"), url("font-files/Inter-UI-Bold.woff?v=2.5") format("woff"); } @font-face { font-family: 'Inter UI'; font-style: italic; font-weight: 700; - src: url("font-files/Inter-UI-BoldItalic.woff2?v=2.5") format("woff2"), + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url("font-files/Inter-UI-BoldItalic.woff2?v=2.5") format("woff2"), url("font-files/Inter-UI-BoldItalic.woff?v=2.5") format("woff"); } @@ -47,13 +53,37 @@ font-family: 'Inter UI'; font-style: normal; font-weight: 900; - src: url("font-files/Inter-UI-Black.woff2?v=2.5") format("woff2"), + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url("font-files/Inter-UI-Black.woff2?v=2.5") format("woff2"), url("font-files/Inter-UI-Black.woff?v=2.5") format("woff"); } @font-face { font-family: 'Inter UI'; font-style: italic; font-weight: 900; - src: url("font-files/Inter-UI-BlackItalic.woff2?v=2.5") format("woff2"), + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url("font-files/Inter-UI-BlackItalic.woff2?v=2.5") format("woff2"), url("font-files/Inter-UI-BlackItalic.woff?v=2.5") format("woff"); } + +/* +Single variable font. +Note that you may want to do something like this to make sure you're serving +constant fonts to older browsers: + +html { + font-family: 'Inter UI', sans-serif; +} +@supports (font-variation-settings: normal) { + html { + font-family: 'Inter UI var', sans-serif; + } +} + +*/ +@font-face { + font-family: 'Inter UI var'; + font-weight: 400 900; /* safe weight range */ + src: url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2-variations"), + url('font-files/Inter-UI.var.woff2?v=2.6') format("woff2"); +} diff --git a/docs/lab/index.html b/docs/lab/index.html index 8c1295516..9deb630d3 100644 --- a/docs/lab/index.html +++ b/docs/lab/index.html @@ -753,78 +753,95 @@ for (const ch of uniqueChars) { font-family: 'Inter-UI-VERSION'; font-style: normal; font-weight: 400; - src: url("fonts/Inter-UI-Regular.woff2") format("woff2"), - url("fonts/Inter-UI-Regular.woff") format("woff"); + src: url("fonts/const/Inter-UI-Regular.woff2") format("woff2"), + url("fonts/const/Inter-UI-Regular.woff") format("woff"); } @font-face { font-family: 'Inter-UI-VERSION'; font-style: italic; font-weight: 400; - src: url("fonts/Inter-UI-Italic.woff2") format("woff2"), - url("fonts/Inter-UI-Italic.woff") format("woff"); + src: url("fonts/const/Inter-UI-Italic.woff2") format("woff2"), + url("fonts/const/Inter-UI-Italic.woff") format("woff"); } @font-face { font-family: 'Inter-UI-VERSION'; font-style: normal; font-weight: 500; - src: url("fonts/Inter-UI-Medium.woff2") format("woff2"), - url("fonts/Inter-UI-Medium.woff") format("woff"); + src: url("fonts/const/Inter-UI-Medium.woff2") format("woff2"), + url("fonts/const/Inter-UI-Medium.woff") format("woff"); } @font-face { font-family: 'Inter-UI-VERSION'; font-style: italic; font-weight: 500; - src: url("fonts/Inter-UI-MediumItalic.woff2") format("woff2"), - url("fonts/Inter-UI-MediumItalic.woff") format("woff"); + src: url("fonts/const/Inter-UI-MediumItalic.woff2") format("woff2"), + url("fonts/const/Inter-UI-MediumItalic.woff") format("woff"); } @font-face { font-family: 'Inter-UI-VERSION'; font-style: normal; font-weight: 700; - src: url("fonts/Inter-UI-Bold.woff2") format("woff2"), - url("fonts/Inter-UI-Bold.woff") format("woff"); + src: url("fonts/const/Inter-UI-Bold.woff2") format("woff2"), + url("fonts/const/Inter-UI-Bold.woff") format("woff"); } @font-face { font-family: 'Inter-UI-VERSION'; font-style: italic; font-weight: 700; - src: url("fonts/Inter-UI-BoldItalic.woff2") format("woff2"), - url("fonts/Inter-UI-BoldItalic.woff") format("woff"); + src: url("fonts/const/Inter-UI-BoldItalic.woff2") format("woff2"), + url("fonts/const/Inter-UI-BoldItalic.woff") format("woff"); } @font-face { font-family: 'Inter-UI-VERSION'; font-style: normal; font-weight: 900; - src: url("fonts/Inter-UI-Black.woff2") format("woff2"), - url("fonts/Inter-UI-Black.woff") format("woff"); + src: url("fonts/const/Inter-UI-Black.woff2") format("woff2"), + url("fonts/const/Inter-UI-Black.woff") format("woff"); } @font-face { font-family: 'Inter-UI-VERSION'; font-style: italic; font-weight: 900; - src: url("fonts/Inter-UI-BlackItalic.woff2") format("woff2"), - url("fonts/Inter-UI-BlackItalic.woff") format("woff"); + src: url("fonts/const/Inter-UI-BlackItalic.woff2") format("woff2"), + url("fonts/const/Inter-UI-BlackItalic.woff") format("woff"); } -.inter-ui, .inter-ui input, .inter-ui select { +.inter-ui, +.inter-ui input, +.inter-ui select { font-family: 'Inter-UI-VERSION', 'Inter UI', serif !important; } +@font-face { + font-family: 'Inter-UI-var-VERSION'; + font-weight: 400 900; + src: url('fonts/var/Inter-UI.var.woff2') format("woff2-variations"); +} + +body.varfont .inter-ui, +body.varfont .inter-ui input, +body.varfont .inter-ui select { + font-family: 'Inter-UI-var-VERSION', 'Inter UI var', serif !important; +} + + + \ No newline at end of file