• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Customize your own version of Recursive for code. Build your own, or find the built fonts in releases within the main Recursive repo.

Customize Recursive for Code

#                                             /$$$$$$     /$$                  
#                                            /$$    /    /  /             $$$  
#    /$$$$$$$    /$$$$$$$    /$$ $$$$$    /$$$$$$$$$   /$$$$$      /$$$$$$$ /  
#   /$$_____/   /$$____ $$  | $$$___ $$  |___ $$___/  |___ $$     /$$     $$   
#  | $$        | $$   | $$  | $$   | $$     | $$         | $$    \  $$$$$$$    
#  | $$        | $$   | $$  | $$   | $$     | $$         | $$     \  $$   /    
#  \  $$$$$$$  \  $$$$$$$   | $$   | $$   /$$$$$$$$$  /$$$$$$$$$  / $$$$$$$$   
#   \_______/   \_______/   |__/   |__/  |_________/ |_________/ | $$      $$  
#                                                                \  $$$$$$$$   
#                                                                 \_______/    

You can get premade Recursive fonts for Desktop, Web, & Code at https://github.com/arrowtype/recursive/releases/latest. If you are just looking for the premade fonts for code, they are also in this repo within the fonts folder. But, if you want to customize your own build of Recursive for Code, you can run the script in this repo!

If you find issues in this customization workflow, please report them in this repo’s Issues.

If you find issues in the fonts themselves, please report them in the Recursive project Issues.

Usage

The basic way to use this tool is to:

  1. Clone the repo and install dependencies (you may wish to fork first, so you can save your preferences to GitHub)
  2. Configure your font options in config.yaml
  3. Run the build script
  4. Install the fonts and activate calt in your coding app, if you want the code ligatures to be active

This instantiates custom fonts for Regular, Italic, Bold, and Bold Italic styles, which you can then use in your preferred editor. One VS Code theme that supports Italics is the Recursive Theme.

Video tutorial for Python beginners

Here’s a step-by-step video tutorial, if you aren’t used to working with Python projects like this one:

IMAGE ALT TEXT HERE

You can also follow the instructions below. I have tried to make them pretty granular. My advice is to try the instructions below, and watch the video if you get stuck. If you get really stuck, please file an issue)! It may not be your fault.

Step-by-step guide

Prerequisites for this Python project

  • To work directly with these examples, you should have Git set up on your computer.
  • To run the font-building script, you must also Download Python and install it if you haven’t already.
  • This uses a virtual environment to keep installed Python modules contained. If you are used to using node_modules in a JavaScript-based project, it’s somewhat similar to that.

In a terminal, use cd to get to a folder you want this project in. Then, clone the repo and move into it:

git clone https://github.com/arrowtype/recursive-code-config.git
cd recursive-code-config
Using the venv, on macOS (and maybe Linux?)

Then, set up the venv and install requirements:

python3 -m venv venv             # make a virtual environment called "venv"
source venv/bin/activate         # activate the virtual environment
pip install -r requirements.txt  # install dependencies
Using the venv, on Windows

Setting up the venv and install requirements is slightly different in Windows, in my testing. Navigate to the project in a terminal, and then use the following commands:

py -m venv venv                  # make a virtual environment called "venv"
venv\Scripts\activate            # activate the virtual environment 
pip install -r requirements.txt  # install dependencies

1. Customize your font settings in config.yaml

This file uses YAML. Hopefully, it is fairly self-explanatory. If not, file an issue and someone will hopefully help out!

First, specify the family name you want (e.g. Rec Mono Custom).

Then, specify axis values you want for Regular, Italic, Bold, & Bold Italic fonts.

Then, specify whether you want code ligatures on by default. Mark True for yes or False for no.

Finally, you can copy in the font feature options you want:

# These options only have an affect at CRSV<=0.5 (Roman/normal styles)
- ss01 # Single-story a
- ss02 # Single-story g
- ss03 # Simplified f
- ss04 # Simplified i ### NOT CURRENTLY WORKING, see issue #4
- ss05 # Simplified l
- ss06 # Simplified r

# These options affect both Roman & Cursive styles
- ss07 # Simplified italic diagonals (kwxyz) ### NOT CURRENTLY WORKING, see issue #4
- ss08 # No-serif L and Z
- ss09 # Simplified 6 and 9
- ss10 # Dotted 0
- ss11 # Simplified 1
- ss12 # Simplified @

OpenType features

If you want to turn off all features, you can specify an empty array in YAML like this:

Features: []

2. Build the fonts!

Build the fonts by running the main Python script in the project:

source venv/bin/activate         # activate the virtual environment if you haven’t already
python3 scripts/instantiate-code-fonts.py

It will build & output fonts to a folder like RecMono-Custom (this is affected by whatever custom name you give fonts in config.yaml).

3. Install the fonts and activate the ligatures!

This project saves the “code ligatures” to the calt feature of fonts, which is the feature most often used by code editors to control code ligatures.

In many apps, the calt feature will be on by default. In others, like VS Code, you will need to specifically turn it on.

In VS Code specifically, you can turn on calt by adding fontLigatures into the settings.json file and setting it to true:

    "editor.fontLigatures": true

Building with other config files

If you wish to build fonts with premade configurations (or reference these), just add their path as an argument (replace premade-configs/duotone.yaml below):

python3 scripts/instantiate-code-fonts.py premade-configs/duotone.yaml

This argument may also be helpful if you wish to create multiple custom versions. To experiment, just duplicate the config.yaml with a new filename, change the Family Name option, and run the script pointing to that new config file.

Happy coding!

Updating to new versions of Recursive (maintainer notes)

Recursive gets periodic updates, and this repo needs to get these updates, as well.

Currently, the process to bring in those updates is pretty simple:

  1. Copy the latest variable font (e.g. Recursive_VF_1.0xx.ttf) into the font-data folder, and delete the old one
  2. Activate the venv and run scripts/build-all.sh <FONTPATH> to build updated versions of the fonts

Then, you can run the build according to the instructions above.

More Repositories

1

recursive

Recursive Mono & Sans is a variable font family for code & UI
Python
3,252
star
2

shantell-sans

Shantell Sans, from Shantell Martin, is a marker-style font built for creative expression, typographic play, and animation.
HTML
400
star
3

type-x

Test your fonts across the web by easily overriding fonts on any webpage.
JavaScript
178
star
4

fonttools-intro

An introduction to FontTools & font development
83
star
5

spacing

A collection of resources & recommendations that are helpful for spacing
Python
55
star
6

NLI-test

A quick test of non-linear interpolation for variable fonts, using a “hidden” source as quadratic offcurves.
HTML
39
star
7

varfont-prep

RoboFont scripts to help clean up working fonts for variable font builds
Python
20
star
8

drawbot--loop-through-font-glyphs

DrawBot scripts to loop through all glyphs of a built font binary (TTF or OTF), e.g. for use in proofing & SVG icon font conversion
Python
16
star
9

recursive-minisite

A minisite for Recursive Sans & Mono, a new variable font from ArrowType
HTML
14
star
10

recursive-theme

A WIP theme for VS Code. Based on Night Owl, but with chiller colors & tweaked italics.
13
star
11

shantell-sans-specimen

A minisite for Shantell Sans, from Shantell Martin, which is a marker-style font built for creative expression, typographic play, and animation.
Svelte
11
star
12

typelab-2021

A tutorial on the basics of shell scripting for font builds, for TypeLab 2021
Python
10
star
13

arrowtype-glyphs-scripts

Scripts for random stuff in GlyphsApp
Python
8
star
14

drawbot-vscode

A demo of how to use DrawBot in VS Code rather than its standalone app
7
star
15

80forty

The utility of an 80% keyboard in a 40% layout
6
star
16

blog

Notes on type design & development
CSS
5
star
17

vf-slnt-test

Tests for browser support of CSS font-style property & variable fonts
HTML
4
star
18

name-sans-roadmap

This repo is a public roadmap for Name Sans, currently in-progress and available at Future Fonts
4
star
19

bern

Name Sans, made Swiss
3
star
20

ufo-workshop-april_2021

A slide presentation put together to explain aspects of why & how I use UFOs in variable font design project.
3
star
21

vf-default-instance-test

A test for a font handling bug on macOS Catalina
2
star
22

web-font-test-templates

test your fonts
HTML
2
star
23

overlapping-axis-test

A test of what happens if two axes in a variable font have an overlapping functionality.
Shell
2
star
24

charsets

A place to store & share useful starter character sets for type design in RoboFont.
Python
2
star
25

svelte-slider

A simple example of a slider component for SvelteJS
HTML
2
star
26

advice

Links to go along with a lecture of advice to college students
1
star
27

rf-guides

A few very simple scripts to quickly manage guidelines in RoboFont.
Python
1
star
28

safari-opsz-test

HTML
1
star
29

agl-naming-script

Applying AGL (Adobe Glyph List) names to a font based on Unicode values assigned to glyphs
Python
1
star
30

keebio-nyquist-minimalist-case

Plate/case designs for the Keebio Nyquist (Rev 3.5)
1
star
31

type-blog

This is the start of a blog. For now, it is just a repo.
1
star
32

arrowtype-robofont-helpers

Scripts I find useful in RoboFont. Many come from the forum or other public sources. I try to include credits in code documentation.
Python
1
star