Skip to main content

Fonts

D2 uses 4 font families:

Currently on the CLI, you can customize fonts by replacing Source Sans Pro with your own TTF files through the following flags:

  • --font-regular
  • --font-italic
  • --font-bold

These should point to a .ttf file, for example:

It's advisable to supply either none or all of the fonts, for consistency. If you supply one but not all of the fonts, it will fall back to Source Sans Pro for the missing styles. For example, if you give a --font-regular and --font-bold, then the italic will remain as Source Sans Pro Italic.

info

Do you want to customize the fonts for code or sketch mode? Please raise an Issue on GitHub. We'll support this if there's demand.