From 799a362f8950459b082405e6fb47b95bb0d4b7fb Mon Sep 17 00:00:00 2001 From: Emmanuel Pelletier Date: Thu, 27 Feb 2025 14:51:31 +0100 Subject: [PATCH] gaufre: better handle the marianne font subsetting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this should be easier to handle if the one doing it is not… me. Still not that great but better than nothing! --- website/.env.example | 1 + website/README.md | 17 +++++++ website/bin/gaufre-glyphhanger-cmd.mjs | 43 +++++++++++++++++ website/package.json | 1 + .../fonts/Marianne-Regular-subset-1.woff2 | Bin 0 -> 4580 bytes .../fonts/Marianne-Regular-subset.woff2 | Bin 4476 -> 0 bytes website/public/fonts/readme.md | 18 ------- website/src/components/GaufrePage.astro | 44 ++++++++++++------ 8 files changed, 93 insertions(+), 31 deletions(-) create mode 100644 website/bin/gaufre-glyphhanger-cmd.mjs create mode 100644 website/public/fonts/Marianne-Regular-subset-1.woff2 delete mode 100644 website/public/fonts/Marianne-Regular-subset.woff2 delete mode 100644 website/public/fonts/readme.md diff --git a/website/.env.example b/website/.env.example index b5ac43e..359cb4c 100644 --- a/website/.env.example +++ b/website/.env.example @@ -1 +1,2 @@ PUBLIC_LASUITE_API_URL=https://integration.lasuite.numerique.gouv.fr +PUBLIC_USE_GAUFRE_SUBSETTED_FONT=1 diff --git a/website/README.md b/website/README.md index e391947..7bb2850 100644 --- a/website/README.md +++ b/website/README.md @@ -39,3 +39,20 @@ Source images are not tracked in the repo. To build images, you must: backgrounds in `public/api/backgrounds`. Depending on the offset passed, or the current week of the month, the service gets a different background. This is meant to be run in a cronjob to generate different backgrounds a few times a month. + +### La Gaufre font + +For the Gaufre content, we use a subset of Marianne font because we know we use just a few +characters for our list. This shrinks the font file size noticeably! + +When you change the Gaufre content (the services shown), use the `npm run gaufre-glyphhanger-cmd` +helper. It will show you the [glyphhanger](https://github.com/zachleat/glyphhanger) command you need +to run locally to generate the new font file before pushing your changes. + +:warning: It will also tell you what to do to update the code accordingly, don't miss it :) + +If for any reason, you want the Gaufre to use a non-subsetted font, set the env var +`PUBLIC_USE_GAUFRE_SUBSETTED_FONT` to `0` on the machine building the website. + +_This is not really streamlined and a bit error-prone, because Astro kinda gets in a way in that +specific case. Any contribution on this is welcome._ diff --git a/website/bin/gaufre-glyphhanger-cmd.mjs b/website/bin/gaufre-glyphhanger-cmd.mjs new file mode 100644 index 0000000..61d1137 --- /dev/null +++ b/website/bin/gaufre-glyphhanger-cmd.mjs @@ -0,0 +1,43 @@ +import path from "path" +import { execSync } from "child_process" +import pc from "picocolors" +import services from "../src/data/services.json" with { type: "json" } + +const glyphhangerIsInstalled = `glyphhanger --version` + +try { + execSync(glyphhangerIsInstalled, { encoding: "utf8", stdio: ["pipe", "pipe", "pipe"] }) +} catch (error) { + console.log(pc.yellow("Warning: it seems glyphhanger is not installed.")) + console.log("Please see https://github.com/zachleat/glyphhanger for installation instructions.\n") +} + +const enabledServices = services.filter((service) => service.enabled) + +const originalFontPath = path.join( + import.meta.dirname, + "..", + "public", + "fonts", + "Marianne-Regular.woff2", +) +const outputDir = path.join(import.meta.dirname, "..", "public", "fonts") + +const whitelist = [...enabledServices.map(({ name }) => name.replace(/ /g, "")), " ✕beta"].join("") + +console.log(`Run this command to generate the new subsetted gaufre font:`) +console.log(` +glyphhanger --formats=woff2 \\ + --subset="${originalFontPath}" \\ + --whitelist="${Array.from(whitelist).join("")}" \\ + --output="${outputDir}"`) + +console.log( + pc.yellow(` +Warning: after running the glyphhanger command, don't forget to: + - update the unicode-range of the subsetted font-family in the GaufrePage.astro component. The new unicode-range is outputed in the console when running glyphhanger. + - rename the newly generated \`Marianne-Regular-subset.woff2\` file to add a cachebusting number, that is superior to the one in the previous filename already existing in the folder. + - update the subsetted font-face src url in the GaufrePage.astro component to use the newly named filename. + - delete the previously existing subsetted font file in the \`public/fonts\` directory. + - commit and push the changes.`), +) diff --git a/website/package.json b/website/package.json index 0c7787f..8cc22a3 100644 --- a/website/package.json +++ b/website/package.json @@ -10,6 +10,7 @@ "dev": "astro dev", "start": "node ./server.mjs", "build-backgrounds": "node ./bin/build-services-backgrounds.mjs", + "gaufre-glyphhanger-cmd": "node ./bin/gaufre-font-cmd.mjs", "build": "astro check && npm run build-backgrounds && astro build", "preview": "astro preview", "astro": "astro" diff --git a/website/public/fonts/Marianne-Regular-subset-1.woff2 b/website/public/fonts/Marianne-Regular-subset-1.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..81609726fb764ce570c0f5265b2d713d5b5c0dc1 GIT binary patch literal 4580 zcmV3;+NC036r=01=Y_0RhSY00000000000000000000 z0000Dpn4iQ8;W=wgMJ2J0D&9tLu61tXMPZuRBkG2(x z6#y%O{QUmj^Jnq{yzhB#5Yn8MmX=kQ)|A)4A8^jTy)u*y0*5 z?JI!)p=;U{Mlb-GW!FXi_y524t1Z)C-WIfLl@HN{L4 zp?DIPCT5Lfr$Zt{S|oKEA*V&%5Z6qt=ZsS%lTI>$uVYr=2Kp0|5K>LSRlR=c?>!{p zfIIAg+*nbvg`b$D?3E88hXOGqRPab;S*LJ@+b#QWQf;Q(BBxX-Y23ltq)4 z-%L;_@~ow)fI4q==cxXjgR731hH06O>6ww4n3dTWVi?02$tXrMhOt3zR>%FZNwnhU z)iN>77{fjbbP3gkh>g*q$Tv9sy8{q{GPp!i5za|SnxLi75g1;QTQC8pB0UAk+>)#; z$w6R;PDjyMAcA4qr2IHjHw}_rq(q@mi&7aT2W2CNFvBm55<_YnGH#3qW{=637p=6# zwX&=y6;ahnu1=~4+p{O_QpdxYbyA&o_ZHXS9(OOas~*uC_2tssv17-19nW{X*|C+z z|7aMT{8-F-ECrceocdMdQ7qvw%mtRRy}Z1klAJM&XK}GXW)n)BofFG=>8*x6+2k57`DL9`?wQUL9x}@ zfuvEImI$|dP%3p6i?PFP-0ons>M5i=fK5-Ojc>(`zD05PO%?;OEy%$$kl+{6+inRP zs}-7c#N&zGbtvaB9z9Tjp%@B%Q30#r_tq;TYK~g14iH&CSfn%Uzin7rSz0Tx{m5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&uVKJV*sF;p6vV{iXuKQ#|4ozNq6-=GgO~#-R zluB4ir_vvXjHiE(nT>xtx8Bmx_ah#%o6-PDpYB5gPB$hPw^d*sfaX;;RpB_Q;pwH5wKl!rM)(4{k}#4FN82j@%+!GXBG6aUE{#w*$e-{S=6(Nsq{R|1^HmvIBO;8xtZIyqm}3MFuDDgcPWz=S1c ztYZy}TMeefJiXLmF;gN&#+E`?ER>5BDpIUO0AhT zl20`s&?ntVC1;3E1H^M)6av5mo`jx}n!tmFY;mbqefRVtAR5Ih@jjO6E6=3UD#X#B zh{3rQA%;Z6$cC|tQodXZ!VJB{pd^`S=nC*u5K_=E7{jah8So+oB#zFJk3B&^qH>LX zwa4cb4eZ~ycl!=IA|357-qZ@ji3ATeckb{qYMGv!zbU7D2>_2Txi0{KCs$-{+*0s6 z9{>PJ5UTk0zXAY%GJO9}?-t!n+A@W}#j8MkqhV2SXu=|Hj(z!1lVvjwt~iJUv~OVP z*f?seoX?T5c_ME@(KQ!PJi(}$bGv{9)R==>A7RGj=>#K{W9kZ7Q=c}PAa$m)& zSorN_AZr%Fi-(o);ge=WMupW_YtSwi0m(T{l$m59w(p`5XNYLag|M73JAT6E}B zjIPKg+3o@?%kRjl9K_BI!9iM9;a1u-7OHV^tu`IQm&JHYsK87&MW{EZ37Qc!o$Xum OFyisDRmIn&0ssJ@n_*A@ diff --git a/website/public/fonts/readme.md b/website/public/fonts/readme.md deleted file mode 100644 index 1dcd765..0000000 --- a/website/public/fonts/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -We use a subset of Marianne font because we know we use just a few characters for our list. This -shrinks the font file size noticeably! - -Example command to use to generate the subset with glyphhanger: - -``` -glyphhanger \ - --subset="./Marianne-Regular.woff2" \ - --formats=woff2 \ - --whitelist="DeskLaSuiteNumériqueMessagerieTchapResanaFranceTransfertContactsGristLePadWebConférencedel'ÉtatWebinaire  " -``` - -## ⚠ - -Make sure to also update the `unicode-range` on the `@font-face` CSS rule. You can get it on the -glyphhanger command output. - -Assuming you have the Marianne-Regular.woff2 file (you can take it from the DSFR). diff --git a/website/src/components/GaufrePage.astro b/website/src/components/GaufrePage.astro index 52bdf04..1f5f26c 100644 --- a/website/src/components/GaufrePage.astro +++ b/website/src/components/GaufrePage.astro @@ -8,6 +8,8 @@ import { Image } from "astro:assets" const logos = import.meta.glob<{ default: ImageMetadata }>("/src/assets/logos/*.{svg,png,jpg}") const { services } = Astro.props + +const useSubsettedFont = import.meta.env.PUBLIC_USE_GAUFRE_SUBSETTED_FONT !== "0" --- @@ -18,16 +20,27 @@ const { services } = Astro.props
+ {useSubsettedFont ? ( + + ) : ( + + )}