From c52bbc373401cb39fee1c65dc70adb79267ffd44 Mon Sep 17 00:00:00 2001 From: Jeff Carey Date: Wed, 13 May 2026 10:49:48 -0700 Subject: [PATCH 1/7] add a font and cleanup a bit --- .github/CODEOWNERS | 1 - .github/DISCUSSIONS_GUIDE.md | 2 -- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/workflows/ci.yml | 33 +++++++++++++++++++ CONTRIBUTING.md | 2 +- LICENSE | 21 ++++++++++++ README.md | 12 +++++-- examples/consumer-app/App.jsx | 2 +- .../consumer-app/public/fonts/placeholder.txt | 6 +++- src/MyComponent.jsx | 2 +- 10 files changed, 72 insertions(+), 11 deletions(-) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/DISCUSSIONS_GUIDE.md create mode 100644 .github/workflows/ci.yml create mode 100644 LICENSE diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 1b206a1..0000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @monotype/devrel-webfonts @monotype/engineering diff --git a/.github/DISCUSSIONS_GUIDE.md b/.github/DISCUSSIONS_GUIDE.md deleted file mode 100644 index 42b07de..0000000 --- a/.github/DISCUSSIONS_GUIDE.md +++ /dev/null @@ -1,2 +0,0 @@ -# Discussions Guide -Use Q&A, Ideas, Announcements, FAQ. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index ec4bb38..3ba13e0 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1 @@ -blank_issues_enabled: false \ No newline at end of file +blank_issues_enabled: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..22811ce --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +# Check that the pattern stays compile-clean. + +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: "20" + cache: npm + + - name: Install dependencies - library + run: npm ci + + - name: Build - library + run: npm run build + + - name: Install dependencies - consumer app + run: npm ci + working-directory: examples/consumer-app + + - name: Build - consumer app + run: npm run dev + working-directory: examples/consumer-app diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a4da79..45a1d4f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,5 +15,5 @@ This repository is a reference implementation pattern. Changes should remain min - Keep the library minimal — `src/` demonstrates the pattern, it is not a production component library - The CSS variable approach in `src/MyComponent.jsx` is intentional; do not replace it with direct font imports or bundled font files -- Do not commit font files; the `.gitignore` exclusion of font extensions must remain intact +- The **demo subset** font under `examples/consumer-app/public/fonts/` is intentional so CI and `next build` succeed; do not add unrelated font binaries without legal review. The `.gitignore` rule for `*.woff2` still applies to **new** files unless explicitly whitelisted or force-added - If a canonical assertion changes in the reference repo, update this pattern to stay aligned diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b1ae531 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Monotype Imaging Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index b49b518..57c4b3e 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,10 @@ This pattern implements the following assertions from [reference-fonts-implement ## Usage +1. Obtain font files under a valid Monotype web font license (this repo ships a **small subset** for build/CI; use your own files in forks or production) +2. Place `.woff2` files in `examples/consumer-app/public/fonts/` and update the `src` path in `examples/consumer-app/fonts.css` (`@font-face`) to match. Additional font names remain **gitignored** unless you force-add (`git add -f`) or add a `!` exception in `.gitignore` +3. Install and run: + ### Build the library ```bash @@ -45,11 +49,13 @@ npm install npm run dev ``` -Before running, place a `.woff2` font file in `examples/consumer-app/public/fonts/` and update the `src` path in `examples/consumer-app/fonts.css` to match. Font files are gitignored — supply your own under a valid Monotype web font license. +This repository includes a committed **`package-lock.json`**. After cloning, use **`npm ci`** when you want installs to match CI and the lockfile exactly; use **`npm install`** when you intentionally add or upgrade dependencies (then commit the updated lockfile). ## Font files -Font files are intentionally excluded from this repository via `.gitignore`. The consuming application is responsible for providing font files under a valid license. See `examples/consumer-app/public/fonts/placeholder.txt` for placement instructions. +This repository includes **`examples/consumer-app/public/fonts/MyFont.woff2`**, a heavily subsetted version of Gotham Regular, so **`npm run build`** and **GitHub Actions** work out of the box. It demonstrates self-hosting only; **redistribution rights for that file are not granted to you**—use fonts you are licensed to deploy. For your own project, replace the file and the `src:` path in `examples/consumer-app/fonts.css`. See `examples/consumer-app/public/fonts/placeholder.txt` for placement notes. + +To commit a different binary despite `*.woff2` in `.gitignore`, use **`git add -f public/fonts/YourFile.woff2`** once, or add a **`!public/fonts/YourFile.woff2`** line after the `*.woff2` rule. ## Requirements @@ -70,4 +76,4 @@ Use GitHub Discussions (Q&A category) for questions about this pattern. ## License -Code in this repository is provided for educational and interoperability purposes. Font files are not included. Canonical guidance © Monotype Imaging Inc. \ No newline at end of file +Sample application **code** in this repository is licensed under the [MIT License](LICENSE). The **subset font file** in `public/fonts/` is included **only** as a build/CI demonstration asset; it is **not** licensed to third parties for separate redistribution—use fonts you have rights to ship. Canonical assertion text in [reference-fonts-implementation](https://github.com/Monotype/reference-fonts-implementation) remains subject to that repository’s terms. diff --git a/examples/consumer-app/App.jsx b/examples/consumer-app/App.jsx index 5a52a53..735a784 100644 --- a/examples/consumer-app/App.jsx +++ b/examples/consumer-app/App.jsx @@ -7,4 +7,4 @@ export default function App() { ); -} \ No newline at end of file +} diff --git a/examples/consumer-app/public/fonts/placeholder.txt b/examples/consumer-app/public/fonts/placeholder.txt index b0b45f6..8f04e0e 100644 --- a/examples/consumer-app/public/fonts/placeholder.txt +++ b/examples/consumer-app/public/fonts/placeholder.txt @@ -1 +1,5 @@ -place fonts here \ No newline at end of file +Place your licensed .woff2 files in this directory (same folder as this file). + +- Obtain files under a valid Monotype web font license for self-hosted delivery. +- This repository includes **MyFont.woff2**, a heavily subsetted version of Gotham Regular, for CI and local `next build` only; replace it with your own file and update `app/layout.tsx` (`localFont` `src`) if you fork or ship your app. +- Additional font filenames are covered by `*.woff2` in `.gitignore`; use `git add -f` or a `!` exception in `.gitignore` when you intentionally commit another binary. diff --git a/src/MyComponent.jsx b/src/MyComponent.jsx index d6055d9..c68aaae 100644 --- a/src/MyComponent.jsx +++ b/src/MyComponent.jsx @@ -7,4 +7,4 @@ export default function MyComponent() { React font pattern demo ) -} \ No newline at end of file +} From a54183379a4ad8bebb7fa6ca35fc1b9fb553f0c4 Mon Sep 17 00:00:00 2001 From: Jeff Carey Date: Wed, 13 May 2026 14:03:36 -0400 Subject: [PATCH 2/7] minor --- .github/workflows/ci.yml | 3 +++ README.md | 7 +++++-- examples/consumer-app/package.json | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22811ce..9559aa8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,9 @@ jobs: with: node-version: "20" cache: npm + cache-dependency-path: | + package-lock.json + examples/consumer-app/package-lock.json - name: Install dependencies - library run: npm ci diff --git a/README.md b/README.md index 57c4b3e..a4771e4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > License-safe web font delivery in a React component library using CSS variables. -This repository demonstrates the correct pattern for font delivery in a shared React component library. The library references fonts only through CSS custom properties — it never bundles, embeds, or redistributes font files. Font definitions and license-covered assets remain with the consuming application. +This repository demonstrates the correct pattern for font delivery in a shared React component library. The library references fonts only through CSS custom properties — it never bundles, embeds, or redistributes font files. Font definitions and license-covered assets remain with the consuming application, which serves font files from its own deployment (end users’ browsers still download font data for rendering — that is normal for the web; the pattern avoids putting font binaries inside the installable library package). ## What this pattern demonstrates @@ -22,6 +22,9 @@ This pattern implements the following assertions from [reference-fonts-implement - `lc-006` — using a font differs from distributing a font - `pc-008` — self-hosting web fonts requires a web font license; desktop licenses do not permit web delivery - `bd-001` — self-hosted fonts integrate into CI/CD pipelines as versioned static assets +- `pc-010` — cross-origin font delivery requires CORS configuration + +In the consumer example, `@font-face` points at **`/fonts/...` on the same origin** as the Vite app, so you typically do not hit cross-origin `@font-face` blocking. **`pc-010` still applies** if you move font files to another origin (for example a CDN): that host must send correct `Access-Control-Allow-Origin` (and related) headers on font responses. ## Repository structure @@ -76,4 +79,4 @@ Use GitHub Discussions (Q&A category) for questions about this pattern. ## License -Sample application **code** in this repository is licensed under the [MIT License](LICENSE). The **subset font file** in `public/fonts/` is included **only** as a build/CI demonstration asset; it is **not** licensed to third parties for separate redistribution—use fonts you have rights to ship. Canonical assertion text in [reference-fonts-implementation](https://github.com/Monotype/reference-fonts-implementation) remains subject to that repository’s terms. +Sample application **code** in this repository is licensed under the [MIT License](LICENSE). The **subset font file** in `examples/consumer-app/public/fonts/` is included **only** as a build/CI demonstration asset; it is **not** licensed to third parties for separate redistribution—use fonts you have rights to ship. Canonical assertion text in [reference-fonts-implementation](https://github.com/Monotype/reference-fonts-implementation) remains subject to that repository’s terms. diff --git a/examples/consumer-app/package.json b/examples/consumer-app/package.json index 7894b62..d742635 100644 --- a/examples/consumer-app/package.json +++ b/examples/consumer-app/package.json @@ -16,6 +16,7 @@ }, "scripts": { "dev": "vite", + "build": "vite build", "test": "echo \"Error: no test specified\" && exit 1" } } From 2f7bc67adc5bd85026ed7144c7ad8ec59b98bcf6 Mon Sep 17 00:00:00 2001 From: Jeff Carey Date: Wed, 13 May 2026 11:05:48 -0700 Subject: [PATCH 3/7] tabs --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9559aa8..e8e0745 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,8 +29,8 @@ jobs: - name: Install dependencies - consumer app run: npm ci - working-directory: examples/consumer-app + working-directory: examples/consumer-app - name: Build - consumer app run: npm run dev - working-directory: examples/consumer-app + working-directory: examples/consumer-app From d776e14095dcd39eae77c24db716522b3c55136a Mon Sep 17 00:00:00 2001 From: Jeff Carey Date: Wed, 13 May 2026 14:08:42 -0400 Subject: [PATCH 4/7] build --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8e0745..e18eb10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,5 +32,5 @@ jobs: working-directory: examples/consumer-app - name: Build - consumer app - run: npm run dev + run: npm run build working-directory: examples/consumer-app From a8722e80d73c5f28bb2c291b33ec5eac14c4afb5 Mon Sep 17 00:00:00 2001 From: Jeff Carey Date: Wed, 13 May 2026 12:03:59 -0700 Subject: [PATCH 5/7] font --- examples/consumer-app/public/fonts/MyFont.woff2 | Bin 0 -> 7480 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 examples/consumer-app/public/fonts/MyFont.woff2 diff --git a/examples/consumer-app/public/fonts/MyFont.woff2 b/examples/consumer-app/public/fonts/MyFont.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..ea77b04ea6ce61088e5aea07da79774da4cce906 GIT binary patch literal 7480 zcmV-89mnE#Pew9NR8&s@03A303;+NC05VVj030R&000000337x006@P00GPZ00000 z0000DsxTUM8;>p=hfoG!0D(9GHUcCAfo22-1)Ej}ARBivRR+#Us|OLqe8^O_N{G9| zUKPLo`0Jnl{saIYTND~k@YWER=@O4dm18=1M52q^C_oZ#ugq?vaIlw$D z0omht;}TNl=H0J5yd4P@i4P3II?TVi#gi;R4-n4xX=?+UxESv*Q}G>>z-` zcv}WK22l$k)`mYk{Ok7K1isfL6^DFrI(-q_`Vt=Su%r>F`K(jVuD15<9Y)=LXC2Ld zey&gZv)SDuT1tV129hp4x$}Or=ig?5-x8-dQ-b78W(NzziiFw8atT`JbQ965v2GmB;*NFQvF=#kWG}%cOnPyFzG;NeUy=JXUpNQiIow%uOx<{<(8VnlD$`U5-B%FBKnPiV?gvlJ@N~}Ba z^6D*Y(^K=GB`Kj05*f%u7P66p_1J)o*o5uaft}ce-PnV@*oXZ% zfP*-X3%G%sxP{xegNJy8$9N+7B)=4pVp2xR$|xBvW5g>y@k>C0l8|X~TF%H>xgw9{ zi9D6J@e^YmXiBH+44tX7bhggXxjIkh>jGVOK)0*D-^ce92dSNb{ZMd(96dl0=bc5<_B1 z9Em3hWEELW){wPi9a&E{kd0&$*-Q+?NZuzOkPpd6)91-oGn?1g=B4$i{`xCjs6Av}V|Pz1$L0;Ny} z+82F%>AK zl%6)==mvF?ky1*rz@+`5G`H-5o>FRFCZoZzeln$K*V**zkLEZ=ld_^a;8vU&IA>^#VxIp)5Pj`=Zx*)mU;$(KE(Wt$|@UInui zN_U6@@i#&*$T8<;oP6@ecJbleYo#yp-e2`xzF7pfCTE_0Pv?;`F4RQ|=~`*tAU7Iw zjnm%PDo&rXa`c!nXCF?G7fk|6si}5}L7iJ`GE%Dlfu1&~M~pl*sB`K}Mw-9i-RHhK zX2V7XGCvoI`5+BM+aD^Pmpqck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&=rHasa_bTYf9%+P@8F0T1*8gQUXy$96}>W4Va{y5wrziARf3% zTyu$-xaeWP!vo<`iq29hLV(k-^+*oJtA+)WGU#cR1rTgoOS)mWCNPX^sT2#d;t{!v zJP}xoDWX8LTEGCNbZHahq9u%pC9*{F(qN)0wIaU2ka{qH0c!x+y#QH~M5UP~*BB&a zRn^(0Nfl@0B~AsPg9-!5fumKza{2+549SJ~1!9);!?3$*9vo z_S&JbwLY0&=3}dOYGZj7szd`wrO+xB*PaAutm=j}Ak{v^;2sb7V*#RUr8Uz%P=pYp zw$~&VUo*)v;RJ7*c8)Yf+>V}Qnk#2zH!9ERDe=gun<$rYX6RaBW@a-p`?17$RuTdp zDY{2Sp}NenKxWVfJWn(?^Eor!2!~6ilg0xDakh&l>9Eao=zSY3qL_vIO!KePtwrWi zy2}4W_x1lBP5b~G%K-r7=$udJK)!mx6O5?!R;!->V>?X{WRj_ZcAKJQMaydB+}sny z-!xoC->8eTf0@C1sC5TC7x!>r(~AJFX#^1e@c`=#h78rV;ALC47Mg~?_QLFhU&c8H z5D#~=OpmqFWzNl+*E?JS#A~rMDI~-sWpG$6r_aL!N?n7rat1NhIOKFA5aX7X!ZIe5 zjtQRhF&XQ$YIkIjHaAzNn8KE Date: Wed, 13 May 2026 15:30:26 -0400 Subject: [PATCH 6/7] touch-up --- CONTRIBUTING.md | 2 +- examples/README.md | 6 +++++- examples/consumer-app/package.json | 4 +--- examples/consumer-app/public/fonts/placeholder.txt | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45a1d4f..bebd980 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,5 +15,5 @@ This repository is a reference implementation pattern. Changes should remain min - Keep the library minimal — `src/` demonstrates the pattern, it is not a production component library - The CSS variable approach in `src/MyComponent.jsx` is intentional; do not replace it with direct font imports or bundled font files -- The **demo subset** font under `examples/consumer-app/public/fonts/` is intentional so CI and `next build` succeed; do not add unrelated font binaries without legal review. The `.gitignore` rule for `*.woff2` still applies to **new** files unless explicitly whitelisted or force-added +- The **demo subset** font under `examples/consumer-app/public/fonts/` is intentional so CI and `npm run build` succeed; do not add unrelated font binaries without legal review. The `.gitignore` rule for `*.woff2` still applies to **new** files unless explicitly whitelisted or force-added - If a canonical assertion changes in the reference repo, update this pattern to stay aligned diff --git a/examples/README.md b/examples/README.md index 9065211..e64e8af 100644 --- a/examples/README.md +++ b/examples/README.md @@ -8,7 +8,7 @@ A minimal runnable application that demonstrates how a consuming project provide - `App.jsx` — imports `MyComponent` from the library and applies the font via the CSS variable - `main.jsx` — mounts the app and imports `fonts.css` -The font file itself is not included. Place a `.woff2` file in `public/fonts/` and update the `src` path in `fonts.css` to match. +This repository includes **`public/fonts/MyFont.woff2`**, a heavily subsetted version of Gotham Regular. **Redistribution rights for that file are not granted to you.** For your own project, replace the file and the `src:` path in `examples/consumer-app/fonts.css`. See `public/fonts/placeholder.txt` for placement notes. ## Running @@ -18,3 +18,7 @@ npm run dev ``` Requires Node.js 18+. + +## Notes + +This app has no `vite.config.js`. Vite 8 processes `.jsx` files via esbuild by default, so builds and `npm run dev` work without `@vitejs/plugin-react`. The trade-off is no React Fast Refresh in dev mode — acceptable for a minimal demo. diff --git a/examples/consumer-app/package.json b/examples/consumer-app/package.json index d742635..13f111d 100644 --- a/examples/consumer-app/package.json +++ b/examples/consumer-app/package.json @@ -6,7 +6,6 @@ "keywords": [], "author": "", "license": "ISC", - "type": "commonjs", "dependencies": { "react": "^18.3.1", "react-dom": "^18.3.1" @@ -16,7 +15,6 @@ }, "scripts": { "dev": "vite", - "build": "vite build", - "test": "echo \"Error: no test specified\" && exit 1" + "build": "vite build" } } diff --git a/examples/consumer-app/public/fonts/placeholder.txt b/examples/consumer-app/public/fonts/placeholder.txt index 8f04e0e..e14328c 100644 --- a/examples/consumer-app/public/fonts/placeholder.txt +++ b/examples/consumer-app/public/fonts/placeholder.txt @@ -1,5 +1,5 @@ Place your licensed .woff2 files in this directory (same folder as this file). - Obtain files under a valid Monotype web font license for self-hosted delivery. -- This repository includes **MyFont.woff2**, a heavily subsetted version of Gotham Regular, for CI and local `next build` only; replace it with your own file and update `app/layout.tsx` (`localFont` `src`) if you fork or ship your app. +- This repository includes **MyFont.woff2**, a heavily subsetted version of Gotham Regular, for CI and local `npm run build` only; replace it with your own file and update `examples/consumer-app/fonts.css` (`@font-face` `src`) if you fork or ship your app. - Additional font filenames are covered by `*.woff2` in `.gitignore`; use `git add -f` or a `!` exception in `.gitignore` when you intentionally commit another binary. From 471b3f614f7cce405154f23d1e735d1dfbf49129 Mon Sep 17 00:00:00 2001 From: Jeff Carey Date: Wed, 13 May 2026 13:37:57 -0700 Subject: [PATCH 7/7] nit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4771e4..c273b67 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ This repository includes a committed **`package-lock.json`**. After cloning, use This repository includes **`examples/consumer-app/public/fonts/MyFont.woff2`**, a heavily subsetted version of Gotham Regular, so **`npm run build`** and **GitHub Actions** work out of the box. It demonstrates self-hosting only; **redistribution rights for that file are not granted to you**—use fonts you are licensed to deploy. For your own project, replace the file and the `src:` path in `examples/consumer-app/fonts.css`. See `examples/consumer-app/public/fonts/placeholder.txt` for placement notes. -To commit a different binary despite `*.woff2` in `.gitignore`, use **`git add -f public/fonts/YourFile.woff2`** once, or add a **`!public/fonts/YourFile.woff2`** line after the `*.woff2` rule. +To commit a different binary despite `*.woff2` in `.gitignore`, use **`git add -f examples/consumer-app/public/fonts/YourFile.woff2`** once, or add a **`!examples/consumer-app/public/fonts/YourFile.woff2`** line after the `*.woff2` rule. ## Requirements