All Projects → chriscoyier → Coding Fonts

chriscoyier / Coding Fonts

Licence: mit
https://coding-fonts.css-tricks.com/

Labels

Projects that are alternatives of or similar to Coding Fonts

Latin-Character-Sets
Latin character sets for fonts that want to support more than the European languages.
Stars: ✭ 47 (-82.46%)
Mutual labels:  font
dotfiles
My arch setup script and dotfiles
Stars: ✭ 37 (-86.19%)
Mutual labels:  font
Lora Cyrillic
Lora fonts — serif family for text. Variable Open Source Font
Stars: ✭ 266 (-0.75%)
Mutual labels:  font
fontster
Font installer for Android.
Stars: ✭ 33 (-87.69%)
Mutual labels:  font
Kepler-452b
Futuristic / minimal font family.
Stars: ✭ 13 (-95.15%)
Mutual labels:  font
Agave
sappy monospaced programming font
Stars: ✭ 235 (-12.31%)
Mutual labels:  font
lato-font
Distribution repository for Lato font
Stars: ✭ 36 (-86.57%)
Mutual labels:  font
Keyrune
Magic: the Gathering set symbol pictographic font
Stars: ✭ 272 (+1.49%)
Mutual labels:  font
svgs2fonts
npm-svgs2fonts。svg图标转字体图标库(svgs -> svg,ttf,eot,woff,woff2),nodejs。
Stars: ✭ 29 (-89.18%)
Mutual labels:  font
Nuxt Webfontloader
Efficient web font loading has never been easier!
Stars: ✭ 264 (-1.49%)
Mutual labels:  font
fonts
Web fonts that you probably won't find in a CDN
Stars: ✭ 26 (-90.3%)
Mutual labels:  font
tstyle
Customize Termux Font & Colors
Stars: ✭ 186 (-30.6%)
Mutual labels:  font
Xits
XITS - OpenType implementation of STIX fonts with math support
Stars: ✭ 257 (-4.1%)
Mutual labels:  font
mactype
Better font rendering for Windows.
Stars: ✭ 7,037 (+2525.75%)
Mutual labels:  font
Polyicon
Flutter icon set generator
Stars: ✭ 268 (+0%)
Mutual labels:  font
postcss-font-grabber
A postcss plugin, it grabs remote font files and update your CSS, just like that.
Stars: ✭ 26 (-90.3%)
Mutual labels:  font
DaddyTimeMono
A Monospaced Font
Stars: ✭ 69 (-74.25%)
Mutual labels:  font
Xcode Monokai Revisited
Monokai Revisited Xcode Theme
Stars: ✭ 272 (+1.49%)
Mutual labels:  font
Decovar
A multistyle decorative variable font by David Berlow
Stars: ✭ 269 (+0.37%)
Mutual labels:  font
Bungee
A chromatic signage typeface for vertical and horizontal setting.
Stars: ✭ 262 (-2.24%)
Mutual labels:  font

Coding Fonts

A microsite that shows off fonts designed for writing code.

https://coding-fonts.css-tricks.com/

Running this site.

  • npm install
  • npm run serve

Adding a font

  • Start server (see above)
  • 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
  • Make a stylesheet that gets that font ready to use in that font folder. e.g. /src/assets/fonts/NewFont/NewFont.css
  • 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 as an example.
  • To preview what will be screenshot, the URL structure is like: http://localhost:8080/code_samples/html/?font=anonymous-pro&theme=dark where font matches the kebab-case Title of the Markdown file that you created.
  • Run the screenshots! This is a local-only process. At the command line: FONT='consolas' npm run screenshots. You can change FONT to a font name matching the kebab-case Title of the Markdown file that you created.

Then make a Pull Request for it. You should be able to see a built preview on Netlify as part of the PR.

Taking Screenshots

You can take screenshots using the included takeScreenshots.js file. The options are listed in the help screen below.

Options:
  --version    Show version number
  -f, --font   Font to use for screenshots
  -l, --lang   Code sample to use for screenshot
  -t, --theme  Theme to use for screenshots
  --parallel   Run the screenshots in parallel
  -h, --help   Show help

--font, --lang, and --theme all accept the 'all' keyword to handle taking screenshots of all of their respective data points.

The --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. Take the following command for example.

node takeScreenshots.js -f source-code-pro -l all -t all

It 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.

Additional Examples

# Take a screenshot of the Source Code Pro font, using the JavaScript code sample, and the dark theme.
node takeScreenshots.js -f source-code-pro -l js -t dark

# Take a screenshot of the Menlo font, using all of the code samples, and the light theme.
node takeScreenshots.js -f menlo -l all -t light

# Take a screenshot of all of the fonts, using all of the code samples, and all of the themes.
node takeScreenshots.js -f all -l all -t all

# Take a screenshot of the Input font, using all of the code samples, all of the themes, and do so in parallel
node takeScreenshots.js -f input -l all -t all --parallel

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].