d2/d2renderers/d2fonts
Andreas Deininger 6ae417cde9
Fixing typos
Signed-off-by: Andreas Deininger <andreas@deininger.net>
2023-04-14 07:48:22 +02:00
..
encoded add SourceCodePro-Semibold font 2023-04-10 15:06:26 -07:00
testdata/d2fonts copy byte slice first 2023-03-28 13:58:53 -07:00
ttf add SourceCodePro-Semibold font 2023-04-10 15:06:26 -07:00
d2fonts.go handdrawn semibold 2023-04-10 15:06:26 -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 Fixing typos 2023-04-14 07:48:22 +02:00

d2fonts

The SVG renderer embeds fonts directly into the SVG as base64 data. This is to give deterministic 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.