Setting fallback font for text in svg?
-
I use drawbot to make svg illustrations. Razorsharp diagrams! For this it would be useful to be able to set a fontstack rather than just a single name.
Drawbot:
font('Menlo-Regular')
SVG:
font-family="Menlo-Regular"
Maybe we could add an attribute to the font function that accepts a list of names. For normal non-svg output this could be ignored.
Drawbot:
font('Menlo-Regular', fallback=['godforbid-arial', 'sans-serif'])
SVG:
font-family="Menlo-Regular, godforbid-arial, sans-serif"
I can easily open the svg file and manipulate the text to include the extra names. But maybe it is useful to have a more explicit way.
-
there is already a
fallbackFont(fontName)
seebut no connection with the svg, this would be indeed nice to add, as the fonts are not embedded into the svg.
Embedding of font in svg is not allowed.
-
further discussion here https://github.com/typemytype/drawbot/issues/274
also read why we dont allow embedding fonts: https://github.com/typemytype/drawbot/issues/23