{"id":19875991,"url":"https://github.com/ernxst/subfont","last_synced_at":"2025-05-02T10:32:34.016Z","repository":{"id":58267392,"uuid":"530870205","full_name":"Ernxst/subfont","owner":"Ernxst","description":"A plugin to purge unused glyphs from your font files to minimise bundle size","archived":false,"fork":false,"pushed_at":"2022-08-31T19:06:30.000Z","size":748,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T19:57:55.171Z","etag":null,"topics":["font","optimiser","website"],"latest_commit_sha":null,"homepage":"subfont-testing.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ernxst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null},"funding":{"github":"ernxst","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"custom":null}},"created_at":"2022-08-30T23:45:28.000Z","updated_at":"2024-11-12T08:24:08.000Z","dependencies_parsed_at":"2022-08-31T04:41:21.634Z","dependency_job_id":null,"html_url":"https://github.com/Ernxst/subfont","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ernxst%2Fsubfont","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ernxst%2Fsubfont/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ernxst%2Fsubfont/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ernxst%2Fsubfont/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ernxst","download_url":"https://codeload.github.com/Ernxst/subfont/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252023442,"owners_count":21682188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["font","optimiser","website"],"created_at":"2024-11-12T16:30:13.669Z","updated_at":"2025-05-02T10:32:33.458Z","avatar_url":"https://github.com/Ernxst.png","language":"TypeScript","funding_links":["https://github.com/sponsors/ernxst"],"categories":[],"sub_categories":[],"readme":"# 🚀 Font Subsetter\n\nA plugin (likely compatible with your build tool) allowing you to remove unused glyphs from your output font files to improve page-load and time-to-first-byte.\n\nUses [`glyphhanger`](https://github.com/zachleat/glyphhanger) under the hood but with the added functionality of overwriting the build output fonts, rather than creating new ones (and having to create links to/stylesheets for them).\n\n## Installation\n\n[`glyphhanger`](https://github.com/zachleat/glyphhanger) is also required as a peer dependency:\n\n```bash\nnpm i --save-dev @ernxst/subfont glyphhanger\n\n```\n\n```bash\nyarn add -D @ernxst/subfont glyphhanger\n```\n\n```bash\npnpm i -D @ernxst/subfont glyphhanger\n```\n\n## Usage\n\nNote that this integration only works for static builds, it does nothing (rather than erroring) when SSR is enabled.\n\nYou may get unexpected results when using this plugin with dynamically generated content.\n\n### Astro\n\n ```js\nimport { defineConfig } from \"astro/config\";\nimport subfont from \"@ernxst/subfont/astro\";\n\nexport default defineConfig({\n  integrations: [subfont()],\n})\n```\n\n### Vite\n\n ```js\nimport { defineConfig } from \"vite\";\nimport subfont from \"@ernxst/subfont/vite\";\n\nexport default defineConfig({\n  plugins: [subfont()],\n})\n```\n\n### Rollup\n\n ```js\nimport { defineConfig } from \"rollup\";\nimport subfont from \"@ernxst/subfont/rollup\";\n\nexport default defineConfig({\n  plugins: [subfont()],\n})\n```\n\n### esbuild\n\n ```js\nimport esbuild from \"esbuild\";\nimport subfont from \"@ernxst/subfont/esbuild\";\n\nesbuild.build({\n  plugins: [subfont()],\n}).catch(() =\u003e process.exit(1));\n```\n\n### Webpack\n\nIn CommonJS form:\n\n```js\nconst SubfontWebpackPlugin = require(\"@ernxst/subfont/webpack\");\n\nmodule.exports = {\n  plugins: [new SubfontWebpackPlugin()],\n}\n```\n\n## Configuration\n\n- `log` - Whether to log to stdout.\n  - default: `true`\n\n## Contributing\n\nTo get started with development, you will need an editor (VS Code is recommended), a browser that runs JavaScript and some extra prerequisites:\n\n- [Node.js (\u003e= 16)](https://nodejs.org)\n- [pnpm 7.5.2](https://pnpm.io/installation#using-corepack)\n\nTo get started with contributing to this project, first fork this git repository:\n\n```sh\ngit clone https://github.com/Ernxst/subfont.git\n```\n\nThen, install dependencies and start coding.\n\n### Submitting Improvements\n\nIf you have a suggestion that would make this app better, please fork the repo and create a pull request. You can also\nsimply open an issue with the tag \"`enhancement`\".\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nDistributed under the MIT License. See [`LICENSE`](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fernxst%2Fsubfont","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fernxst%2Fsubfont","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fernxst%2Fsubfont/lists"}