Thanks for supporting Fontsource!
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
For general support or questions, please make a Discussion instead. Issues should be used for bug reports or feature and font requests.
Before you submit an issue, please search the issue tracker to prevent duplicates as existing discussion might inform you of workarounds readily available.
For fixing bugs, we need to have the necessary information to reproduce and confirm it. At minimum we would expect device, browser and 3rd-party library usage information, however, it may be necessary to provide a minimal reproducible build for us to reproduce the error. Lack of information may lead to the issue being closed.
You can file issues by filling out an issue form.
-
Before you submit a PR, please search the repository for an open or closed PR that relates to your submission.
-
Fork the fontsource/fontsource repository (click the Fork button at the top right of this page).
-
Clone the repository locally before creating your own branch.
git clone https://github.com/fontsource/fontsource.git git checkout -b my-pr-branch main
-
Create your patch or feature addition, including appropriate test cases in the tests directory.
-
Ensure all tests and lints pass.
-
On GitHub, send a pull request to fontsource:main.
- If we suggest changes then:
- Make the required updates.
- Re-run the test suites to ensure tests are still passing.
- Rebase your branch and force push to your GitHub repository (this will update your PR):
git rebase main -i git push -f
- If we suggest changes then:
-
After your pull request is merged, you can safely delete your branch and pull changes from the main repository.
Fontsource is built completely with Typescript which extends to both the API and website.
- Google Font Metadata as the upstream source of Google Fonts data.
- mass-publish for publishing packages.
- Jest for testing.
- Fastify NestJS for the API architecture.
- Next.js and Chakra UI for the website.
After cloning the repo, run:
Ensure you have Corepack enabled:
// Node <16
npm i corepack -g
corepack enable
// Node >16 (comes installed already)
corepack enable
Install packages:
pnpm i
The project uses PNPM Workspaces, thus the packager, API and website should install in one command.
pnpm run test
- Runs tests.pnpm run format
- Runs Prettier and dprint across the repository.pnpm run format:scripts
- Runs Prettier only over thescripts
directory.pnpm run format:fonts
- Runs dprint on thefonts
directory.pnpm run lint
- Runs ESLint over thescripts
directory.
More details can be found in the README.md of the scripts
directory.
More details can be found in the README.md of the website
directory.
Submitting new or updating documentation for the Fontsource website is painless and doesn't necessarily require much setup. Navigating to website/docs
should contain a directory of markdown files. Editing those markdown files will reflect onto the website.
Please note when submitting brand new pages, it would be required to update website/src/configs/docsList.json
appropriately for it to reflect on the website sidebar.