Sourced from: https://github.com/adobe-fonts/source-code-pro/releases/tag/2.038R-ro%2F1.058R-it%2F1.018R-VAR Translated with the following commands: ``` base64 -i ~/Downloads/WOFF-source-code-pro-2.038R-ro-1.058R-it/TTF/SourceCodePro-It.ttf.woff -o ./d2renderers/d2fonts/encoded/SourceCodePro-Italic.txt base64 -i ~/Downloads/WOFF-source-code-pro-2.038R-ro-1.058R-it/TTF/SourceCodePro-Bold.ttf.woff -o ./d2renderers/d2fonts/encoded/SourceCodePro-Bold.txt ``` I used the `.ttf.woff` files because that seemed "closer" to the original `.ttf` files included, but I'm not sure if that's correct. |
||
|---|---|---|
| .. | ||
| encoded | ||
| ttf | ||
| d2fonts.go | ||
| NOTICE.txt | ||
| README.md | ||
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.