Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


yeah there's overhead with the fonts bundled in. we might change this, https://github.com/terrastruct/d2/discussions/132

i wasn't aware you could selectively choose characters for fonts, but that'd be ideal


Maybe 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";




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: