d2/d2renderers/d2fonts
2023-03-29 10:03:44 -07:00
..
encoded SourceCodePro bold/italic: use .woff for encoded fonts instead of .ttf 2023-01-24 21:20:16 -05:00
testdata/d2fonts copy byte slice first 2023-03-28 13:58:53 -07:00
ttf d2renderers: d2fonts: add bold + italic styles for Source Code Pro 2023-01-23 00:35:19 -05:00
d2fonts.go rename cutset -> corpus 2023-03-29 10:03:44 -07:00
d2fonts_test.go copy byte slice first 2023-03-28 13:58:53 -07:00
NOTICE.txt 2022-11-21 04:32:58PM 2022-11-21 16:32:58 -08:00
README.md oss 2022-11-03 06:54:49 -07:00

d2fonts

The SVG renderer embeds fonts directly into the SVG as base64 data. This is to give determinstic outputs and load without a network call.

To include your own font, e.g. Helvetica, you must include the Truetype glyphs:

  • ./ttf/Helvetica-Bold.ttf
  • ./ttf/Helvetica-Italic.ttf
  • ./ttf/Helvetica-Regular.ttf

You must also include an encoded version of these of mimetype application/font-woff:

  • ./ttf/Helvetica-Bold.txt
  • ./ttf/Helvetica-Italic.txt
  • ./ttf/Helvetica-Regular.txt

If you include a font to contribute, it must have an open license.