Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions assets/css/fonts.css

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

6 changes: 3 additions & 3 deletions assets/css/icons.css

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

8 changes: 4 additions & 4 deletions layouts/partials/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
{{ $parts := slice }}
{{ range $files }}{{ $parts = $parts | append (resources.Get (printf "css/%s.css" .)) }}{{ end }}
{{ $css := $parts | resources.Concat "css/doors.css" | minify | fingerprint "md5" }}
<link rel="preload" href="{{ "fonts/doors/source-sans-3-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="{{ "fonts/source-sans-3-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>
{{/* Arabic content sets its text in the self-hosted Arabic faces, Chinese in system fonts (decision D18). */}}
{{ $language := partial "functions/page_language.html" . }}
{{ if not (or (hasPrefix $language "ar") (hasPrefix $language "zh")) }}<link rel="preload" href="{{ "fonts/doors/newsreader-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>{{ end }}
{{ if hasPrefix $language "ar" }}<link rel="preload" href="{{ "fonts/doors/noto-sans-arabic-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin><link rel="preload" href="{{ "fonts/doors/noto-naskh-arabic-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>{{ end }}
{{ if not (or (hasPrefix $language "ar") (hasPrefix $language "zh")) }}<link rel="preload" href="{{ "fonts/newsreader-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>{{ end }}
{{ if hasPrefix $language "ar" }}<link rel="preload" href="{{ "fonts/noto-sans-arabic-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin><link rel="preload" href="{{ "fonts/noto-naskh-arabic-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>{{ end }}
{{/* Bulgarian pages set headings and text in Source Sans 3, whose Cyrillic is a face of its own (fonts.css). */}}
{{ if hasPrefix $language "bg" }}<link rel="preload" href="{{ "fonts/doors/source-sans-3-cyrillic-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>{{ end }}
{{ if hasPrefix $language "bg" }}<link rel="preload" href="{{ "fonts/source-sans-3-cyrillic-var.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>{{ end }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{ $screen := slice }}
{{ if .IsHome }}{{ $screen = slice "home" }}{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/clusters/map_metrics.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{/* Advance widths (units per 1000 em) of Source Sans 3 at weights 400 and 700, read from
static/fonts/doors/source-sans-3-var.woff2 with fontTools. map.html wraps the pill and label
static/fonts/source-sans-3-var.woff2 with fontTools. map.html wraps the pill and label
text with them at build time. Characters not listed count as 560. */}}
{{ return (`{"400":{" ":200,"!":289,"\"":426,"#":497,"$":497,"%":824,"&":609,"'":249,"(":303,")":303,"*":418,"+":497,",":249,"-":311,".":249,"/":350,"0":497,"1":497,"2":497,"3":497,"4":497,"5":497,"6":497,"7":497,"8":497,"9":497,":":249,";":249,"<":497,"=":497,">":497,"?":425,"@":847,"A":543,"B":588,"C":571,"D":615,"E":527,"F":494,"G":617,"H":652,"I":263,"J":479,"K":579,"L":486,"M":727,"N":647,"O":664,"P":566,"Q":664,"R":569,"S":534,"T":536,"U":645,"V":515,"W":786,"X":513,"Y":476,"Z":539,"[":303,"\\":350,"]":303,"^":497,"_":500,"a":504,"b":553,"c":456,"d":555,"e":496,"f":292,"g":504,"h":544,"i":246,"j":247,"k":495,"l":255,"m":829,"n":547,"o":542,"p":555,"q":555,"r":347,"s":419,"t":338,"u":544,"v":467,"w":719,"x":446,"y":467,"z":425,"{":303,"|":241,"}":303,"~":497,"‘":249,"’":249,"“":426,"”":426,"–":480,"—":800,"é":496},"700":{" ":200,"!":340,"\"":537,"#":528,"$":528,"%":857,"&":667,"'":300,"(":344,")":344,"*":457,"+":528,",":300,"-":332,".":300,"/":338,"0":528,"1":528,"2":528,"3":528,"4":528,"5":528,"6":528,"7":528,"8":528,"9":528,":":300,";":300,"<":528,"=":528,">":528,"?":463,"@":902,"A":572,"B":605,"C":582,"D":635,"E":548,"F":524,"G":638,"H":674,"I":301,"J":508,"K":615,"L":518,"M":763,"N":665,"O":684,"P":596,"Q":684,"R":613,"S":556,"T":556,"U":665,"V":556,"W":814,"X":567,"Y":525,"Z":541,"[":344,"\\":338,"]":344,"^":528,"_":500,"a":527,"b":572,"c":468,"d":573,"e":518,"f":341,"g":534,"h":571,"i":276,"j":278,"k":548,"l":286,"m":857,"n":573,"o":555,"p":573,"q":573,"r":398,"s":443,"t":383,"u":568,"v":523,"w":777,"x":513,"y":521,"z":461,"{":344,"|":267,"}":344,"~":528,"‘":300,"’":300,"“":537,"”":537,"–":480,"—":800,"é":518}}` | transform.Unmarshal) }}
2 changes: 1 addition & 1 deletion scripts/rebrand/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ python3 scripts/rebrand/capture_pages.py /tmp/public-main --out /tmp/baseline-sh
- `check_design.py` checks the designed screens in a browser, on a build or the preview, in Chromium by default and with `--browser firefox` or `--browser webkit` in the others: overflow, also on the sample pages, italics, line length, one `h1`, hidden buttons, and the resources directory's filters, address, search and pages. On a build it also sweeps the reading layout's pages, including for empty space beside the text, and scans for icons and theme assets.
- `screenshot_pages.py <public-dir | address> --out <dir>` shoots the sample pages, or `--paths`, at phone (390 px) and desktop (1440 px) size for design review, with the cookie banner answered, and cuts each page into tiles about two screens tall so text stays legible. `manifest.json` lists the tiles.
- `capture_pages.py` also weighs and screenshots a preview build with `--base /rebrand-doors/`.
- `build_fonts.py` rebuilds `static/fonts/doors/`, and with `--icons` the subset of Font Awesome and `assets/css/icons.css`. Add a new icon to its `ICONS` list.
- `build_fonts.py` rebuilds `static/fonts/`, and with `--icons` the subset of Font Awesome and `assets/css/icons.css`. Add a new icon to its `ICONS` list.
- `render_castle_still.py` rerenders the home page's still image.
10 changes: 5 additions & 5 deletions scripts/rebrand/allowed_changes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Paths allowed to differ from main, one normalised path or glob per line. Say why.
fonts/doors/Newsreader-OFL.txt # Licence beside the self-hosted font, not a page
fonts/doors/SourceSans3-OFL.txt # Licence beside the self-hosted font, not a page
fonts/doors/FontAwesome-LICENSE.txt # Licence beside the self-hosted icon subset, not a page
fonts/doors/NotoNaskhArabic-OFL.txt # Licence beside the self-hosted Arabic heading font, not a page
fonts/doors/NotoSansArabic-OFL.txt # Licence beside the self-hosted Arabic text font, not a page
fonts/Newsreader-OFL.txt # Licence beside the self-hosted font, not a page
fonts/SourceSans3-OFL.txt # Licence beside the self-hosted font, not a page
fonts/FontAwesome-LICENSE.txt # Licence beside the self-hosted icon subset, not a page
fonts/NotoNaskhArabic-OFL.txt # Licence beside the self-hosted Arabic heading font, not a page
fonts/NotoSansArabic-OFL.txt # Licence beside the self-hosted Arabic text font, not a page
resources/page/*/index.html # Crawlable pages of the directory (D16, #868). Their number follows the collection
resources/directory.json # The directory's filter data (D16, #868)
resources/search.json # The directory's search data, fetched on first search (D16, #868)
Expand Down
8 changes: 4 additions & 4 deletions scripts/rebrand/build_fonts.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
"""Rebuild the self-hosted WOFF2 fonts in static/fonts/doors/ from Google's sources.
"""Rebuild the self-hosted WOFF2 fonts in static/fonts/ from Google's sources.

Run: python3 scripts/rebrand/build_fonts.py <dir-with-source-ttfs> static/fonts/doors
Run: python3 scripts/rebrand/build_fonts.py <dir-with-source-ttfs> static/fonts

python3 scripts/rebrand/build_fonts.py --icons <dir-with-font-awesome-files> static/fonts/doors assets/css/icons.css
python3 scripts/rebrand/build_fonts.py --icons <dir-with-font-awesome-files> static/fonts assets/css/icons.css

Needs `pip install fonttools brotli`. Sources are the OFL files in github.com/google/fonts
(ofl/newsreader, ofl/sourcesans3, ofl/notonaskharabic, ofl/notosansarabic). The Latin faces keep
Expand Down Expand Up @@ -90,7 +90,7 @@ def build_icons(source, output, css_path):
font.flavor = "woff2"
font.save(os.path.join(output, f"icons-{style}.woff2"))
selector, weight = ICON_STYLES[style]
lines.append(f"@font-face{{font-family:'Doors Icons {style}';src:url(../fonts/doors/icons-{style}.woff2) format('woff2');font-weight:{weight};font-display:block}}")
lines.append(f"@font-face{{font-family:'Doors Icons {style}';src:url(../fonts/icons-{style}.woff2) format('woff2');font-weight:{weight};font-display:block}}")
lines.append(f"{selector}{{font-family:'Doors Icons {style}';font-weight:{weight}}}")
bases.append(selector)
lines.append(f"{','.join(bases)}{{display:inline-block;line-height:1;-webkit-font-smoothing:antialiased;text-rendering:auto}}")
Expand Down
4 changes: 2 additions & 2 deletions scripts/sync_newsletters.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ def tidy_page(page):
# main landmark around the email, set in the site's fonts (DESIGN.md §7, §12).
ARCHIVE_STYLE = (
'<style id="forrt-archive">'
'@font-face{font-family:"Source Sans 3";src:url(/fonts/doors/source-sans-3-var.woff2) format("woff2");'
'@font-face{font-family:"Source Sans 3";src:url(/fonts/source-sans-3-var.woff2) format("woff2");'
"font-weight:200 900;font-display:swap}"
'@font-face{font-family:Newsreader;src:url(/fonts/doors/newsreader-var.woff2) format("woff2");'
'@font-face{font-family:Newsreader;src:url(/fonts/newsreader-var.woff2) format("woff2");'
"font-weight:200 800;font-display:swap}"
'body :is(p,li,td,div,span,a,strong,em,b,i):not(:is(h1,h2,h3,h4) *){font-family:"Source Sans 3","Segoe UI",system-ui,sans-serif,'
'"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji"!important}'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading
Loading