{"id":18248942,"url":"https://github.com/css-tricks/coding-fonts","last_synced_at":"2025-04-06T20:09:40.150Z","repository":{"id":45446393,"uuid":"298681464","full_name":"CSS-Tricks/coding-fonts","owner":"CSS-Tricks","description":"https://coding-fonts.css-tricks.com/","archived":false,"fork":false,"pushed_at":"2022-03-17T23:21:35.000Z","size":125459,"stargazers_count":455,"open_issues_count":12,"forks_count":66,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-05-22T06:08:47.031Z","etag":null,"topics":["coding-fonts","font"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/CSS-Tricks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-25T21:18:23.000Z","updated_at":"2024-05-09T03:29:15.000Z","dependencies_parsed_at":"2022-08-22T12:51:39.380Z","dependency_job_id":null,"html_url":"https://github.com/CSS-Tricks/coding-fonts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSS-Tricks%2Fcoding-fonts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSS-Tricks%2Fcoding-fonts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSS-Tricks%2Fcoding-fonts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSS-Tricks%2Fcoding-fonts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CSS-Tricks","download_url":"https://codeload.github.com/CSS-Tricks/coding-fonts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543589,"owners_count":20955865,"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":["coding-fonts","font"],"created_at":"2024-11-05T09:38:46.924Z","updated_at":"2025-04-06T20:09:35.129Z","avatar_url":"https://github.com/CSS-Tricks.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coding Fonts\n\nA microsite that shows off fonts designed for writing code.\n\nhttps://coding-fonts.css-tricks.com/\n\n## Running this site.\n\n- Install dependencies: `npm install`\n- Start server: `npm run dev`\n\n## Adding a font\n\n- Start server (see above)\n- If the font is open source, put a copy of the font in the `fonts` folder. At the very least a `.woff2` file in a folder of the fonts name. e.g. `/src/assets/fonts/NewFont/NewFont.woff2`\n- Make a stylesheet that gets that font ready to use in that font folder. e.g. `/src/assets/fonts/NewFont/NewFont.css`\n- Add a file like `new-font.md` to `/src/fonts`. Add the font's information. Mark the URL of the stylesheet from the previous step in the `stylesheet_url` field, relative to `/src/assets/fonts/`. If the URL is absolute, i.e. not added to the repo, add a `stylesheet_absolute: true` field. [See this one](https://github.com/chriscoyier/coding-fonts/blob/master/src/fonts/fira-code.md) as an example.\n- To preview what will be screenshot, the URL structure is like: http://localhost:8080/code_samples/html/?font=anonymous-pro\u0026theme=dark where font matches the kebab-case `Title` of the Markdown file that you created.\n- Take screenshots! This is a local-only process. Follow the [taking screenshots instructions](#taking-screenshots) in the command line.\n- Make a Pull Request for it. You should be able to see a built preview on Netlify as part of the PR.\n\n## Taking Screenshots\n\nYou can take screenshots using the included `takeScreenshots.js` file. The options are listed in the help screen below.\n\n```\nOptions:\n  --version    Show version number\n  -f, --font   Font to use for screenshots\n  -l, --lang   Code sample to use for screenshot\n  -t, --theme  Theme to use for screenshots\n  --parallel   Run the screenshots in parallel\n  -h, --help   Show help\n```\n\n`--font`, `--lang`, and `--theme` all accept the 'all' keyword to handle taking screenshots of all of their respective data points.\n\nThe `--parallel` flag allows the running of Puppeteer in parallel which is useful if you need to repeatedly take screenshots of a font. Do note that this will spawn as many Puppeteer instances as you have the total permutations you request.\nTake the following command for example.\n\n```\nnode takeScreenshots.js -f source-code-pro -l all -t all\n```\n\nIt will spawn 8 Puppeteer instances (1 font * 4 languages * 2 themes = 8 instances) all at once to take the screenshots. This is usually fine and doesn't result in any issues but in the event you were to do this for all fonts as well, you'd spawn hundreds of instances which will almost always in a failure.\n\n### Additional Examples\n\n```bash\n# Take a screenshot of the Source Code Pro font, using the JavaScript code sample, and the dark theme.\nnode takeScreenshots.js -f source-code-pro -l js -t dark\n\n# Take a screenshot of the Menlo font, using all of the code samples, and the light theme.\nnode takeScreenshots.js -f menlo -l all -t light\n\n# Take a screenshot of all of the fonts, using all of the code samples, and all of the themes.\nnode takeScreenshots.js -f all -l all -t all\n\n# Take a screenshot of the Input font, using all of the code samples, all of the themes, and do so in parallel\nnode takeScreenshots.js -f input -l all -t all --parallel\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcss-tricks%2Fcoding-fonts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcss-tricks%2Fcoding-fonts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcss-tricks%2Fcoding-fonts/lists"}