From 8e3d070826c32ff196fc25b478dc3780e179c52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Jab=C5=82o=C5=84ski?= Date: Sun, 10 Aug 2025 11:45:01 +0200 Subject: [PATCH] feat: use Atkinson font --- .gitignore | 5 +++-- package-lock.json | 10 ++++++++++ package.json | 4 +++- public/styles.css | 4 ++++ src/browser.ts | 1 + 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b3e2e43..5751d32 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,6 @@ lib coverage @types -public/*.js -/public/bundle.js.map +public/bundle.* +public/*.woff +public/*.woff2 diff --git a/package-lock.json b/package-lock.json index 3cdb7b9..2d5969a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "hasInstallScript": true, "license": "ISC", "dependencies": { + "@fontsource/atkinson-hyperlegible": "^5.2.6", "@types/mocha": "^10.0.1", "@types/node": "^20.10.4", "@types/yargs": "^17.0.32", @@ -900,6 +901,15 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fontsource/atkinson-hyperlegible": { + "version": "5.2.6", + "resolved": "https://registry.npmjs.org/@fontsource/atkinson-hyperlegible/-/atkinson-hyperlegible-5.2.6.tgz", + "integrity": "sha512-Kfh6/UlHhotKuv4Oi9PXQIsmzwbtJIR442sSJnEHsO7TDZaDczK8cY0AlTNOB0XMDZj1j35nAlgbi2HZCdNg/Q==", + "license": "OFL-1.1", + "funding": { + "url": "https://github.com/sponsors/ayuhito" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", diff --git a/package.json b/package.json index 57b445f..db7a44e 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,14 @@ "test": "mocha", "build": "npm run build-node && npm run build-browser", "build-node": "tsc", - "build-browser": "esbuild src/browser.ts --bundle --minify --sourcemap --target=firefox120 --outfile=public/bundle.js", + "build-browser": "esbuild src/browser.ts --bundle --minify --sourcemap --target=firefox120 --outfile=public/bundle.js --loader:.woff=file --loader:.woff2=file", "postinstall": "npm run build", "clean-coverage": "rm -rf coverage .nyc_output .xunit", "coverage": "npm run clean-coverage && nyc mocha", "test-reports": "npm run clean-coverage && nyc --reporter clover mocha --reporter xunit --reporter-option output=.xunit", "coverage-html": "npm run test-reports && nyc report --reporter lcov && xdg-open coverage/lcov-report/index.html", "start": "http-server public -p 8080", + "dev": "esbuild src/browser.ts --bundle --outfile=public/bundle.js --watch --loader:.woff=file --loader:.woff2=file & http-server public -p 8080", "format": "prettier --write .", "format:check": "prettier --check ." }, @@ -38,6 +39,7 @@ }, "types": "./@types/index.d.ts", "dependencies": { + "@fontsource/atkinson-hyperlegible": "^5.2.6", "@types/mocha": "^10.0.1", "@types/node": "^20.10.4", "@types/yargs": "^17.0.32", diff --git a/public/styles.css b/public/styles.css index de0a10d..5bd7b16 100644 --- a/public/styles.css +++ b/public/styles.css @@ -1,3 +1,7 @@ +:root { + --pico-font-family: "Atkinson Hyperlegible", sans-serif; +} + body { max-width: 600px; margin: 0 auto; diff --git a/src/browser.ts b/src/browser.ts index 995b372..17fb1e9 100644 --- a/src/browser.ts +++ b/src/browser.ts @@ -1,4 +1,5 @@ import { convert } from "."; +import "@fontsource/atkinson-hyperlegible"; function download(data: string, filename: string, type: string) { var file = new Blob([data], { type: type });