Skip to content

Commit

Permalink
Updated webfonts & print fonts README
Browse files Browse the repository at this point in the history
  • Loading branch information
kontur committed Mar 11, 2024
1 parent 6a18ad1 commit 0571237
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ _site
.sass-cache
.jekyll-cache
.jekyll-metadata
print-fonts/*
!print-fonts/*.ttf
print-fonts/*.ttf
vendor
pdf
20 changes: 11 additions & 9 deletions assets/css/_fonts.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
$fontpath: "../ui-fonts" !default;
$fontpath: "https://webfonts.rosettatype.com/legibility" !default;

// base64 font definitions for the pdf generator to use as fallback
@import "print-fonts";

/* Display Extrabold */
Expand All @@ -7,7 +9,7 @@ $fontpath: "../ui-fonts" !default;
font-family: "Adapter PE Display";
font-weight: 800;
font-style: normal;
src: url("#{$fontpath}/AdapterPEDisplayWeb/AdapterPEDisplayWeb-Eb.woff") format("woff");
src: url("#{$fontpath}/AdapterPEDisplayWeb-Eb.woff2") format("woff2");
}

@font-face {
Expand All @@ -24,7 +26,7 @@ $fontpath: "../ui-fonts" !default;
font-family: "Adapter PE Display";
font-weight: 900;
font-style: normal;
src: url("#{$fontpath}/AdapterPEDisplayWeb/AdapterPEDisplayWeb-Bl.woff") format("woff");
src: url("#{$fontpath}/AdapterPEDisplayWeb-Bl.woff2") format("woff2");
}

@font-face {
Expand All @@ -41,7 +43,7 @@ $fontpath: "../ui-fonts" !default;
font-family: "Adapter PE Text";
font-weight: 400;
font-style: normal;
src: url("#{$fontpath}/AdapterPETextWeb/AdapterPETextWeb-Rg.woff") format("woff");
src: url("#{$fontpath}/AdapterPETextWeb-Rg.woff2") format("woff2");
}

@font-face {
Expand All @@ -58,7 +60,7 @@ $fontpath: "../ui-fonts" !default;
font-family: "Adapter PE Text";
font-weight: 700;
font-style: normal;
src: url("#{$fontpath}/AdapterPETextWeb/AdapterPETextWeb-Bd.woff") format("woff");
src: url("#{$fontpath}/AdapterPETextWeb-Bd.woff2") format("woff2");
}

@font-face {
Expand All @@ -77,7 +79,7 @@ $fontpath: "../ui-fonts" !default;
font-family: "Adapter PE VF";
font-weight: 100 900;
font-style: normal;
src: url("#{$fontpath}/AdapterPEVariableWeb/AdapterPEVFWeb-All.woff2") format("woff2");
src: url("#{$fontpath}/AdapterPEVFWeb-All.woff2") format("woff2");
}
}
}
Expand All @@ -89,7 +91,7 @@ $fontpath: "../ui-fonts" !default;
font-family: "Adapter Mono PE";
font-weight: 400;
font-style: normal;
src: url("#{$fontpath}/AdapterMonoPEWeb/AdapterMonoPEWeb-Rg.woff2") format("woff2");
src: url("#{$fontpath}/AdapterMonoPEWeb-Rg.woff2") format("woff2");
}

@font-face {
Expand All @@ -106,7 +108,7 @@ $fontpath: "../ui-fonts" !default;
font-family: "Adapter Mono PE";
font-weight: 700;
font-style: normal;
src: url("#{$fontpath}/AdapterMonoPEWeb/AdapterMonoPEWeb-Bd.woff2") format("woff2");
src: url("#{$fontpath}/AdapterMonoPEWeb-Bd.woff2") format("woff2");
}

@font-face {
Expand All @@ -125,7 +127,7 @@ $fontpath: "../ui-fonts" !default;
font-family: "Adapter Mono PE VF";
font-weight: 100 900;
font-style: normal;
src: url("#{$fontpath}/AdapterMonoPEVariableWeb/AdapterMonoPEVFWeb-All.woff2") format("woff2");
src: url("#{$fontpath}/AdapterMonoPEVFWeb-All.woff2") format("woff2");
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions make-print-fonts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
# This script will take the TTF files in print-fonts and save them as base64
# encoded SCSS variables in _print-fonts.scss, which can then be included in
# the print CSS and use those "webfonts"
#
# NOTE this assumes these proprietary fonts by Rosetta in print-fonts:
# - AdapterMonoPE-Bd.ttf
# - AdapterMonoPE-Rg.ttf
# - AdapterPEDisplay-Bl.ttf
# - AdapterPEDisplay-Eb.ttf
# - AdapterPEText-Bd.ttf
# - AdapterPEText-Rg.ttf

SCSS=assets/css/_print-fonts.scss
rm -f $SCSS
Expand Down
Empty file added print-fonts/KEEP
Empty file.

0 comments on commit 0571237

Please sign in to comment.