3 ms·
This looks pretty great, though I'm surprised at the filesize for a simple diagram - 333kb from a simple test I made. A cat of the SVG prints out some base64 wh
by pedrovhb 4y ago
This looks pretty great, though I'm surprised at the filesize for a simple diagram - 333kb from a simple test I made. A cat of the SVG prints out some base64 which I didn't try decoding, but I'd assume it's the bundled font that takes up most of the space? It'd be nice if it contained only the characters necessary for the diagram itself.
- alixanderwang 4y agoyeah there's overhead with the fonts bundled in. we might change this, https://github.com/terrastruct/d2/discussions/132 https://github.com/terrastruct/d2/discussions/132 i wasn't aware you could selectively choose characters for fonts, but that'd be ideal
- andix 4y agoMaybe don’t bundle the font by default? Can‘t you just use the standard system fonts like tailwind does, and gives quite good results? font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";