Option to disable font embedding for xmlsvg/getSvg export in draw.io (Editor.embedExtFonts)
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Is your feature request related to a problem? Please describe. Currently, when exporting diagrams in the 'xmlsvg' format (editable SVG) using draw.io, the embedded font-handling logic in Editor.embedExtFonts fetches and embeds font files as data URIs inside the SVG. This results in large SVG files and can complicate workflows that require references to web fonts rather than embedding fonts. There is no option to programmatically suppress font embedding in the xmlsvg/getSvg export path.
Describe the solution you'd like
I would like an option (e.g., a flag or URL parameter such as embedFonts=0) to be added to the draw.io editor. When this option is specified, Editor.embedExtFonts should skip font embedding even in the xmlsvg/getSvg export path, allowing the output SVG to reference external web fonts instead of embedding them as data URIs. This option should be respected for API/export actions as well as interactive exports via the UI.
Describe alternatives you've considered
- Post-processing the exported SVG to manually strip embedded font data, but this is error-prone and can affect other styles.
- Removing fontSource/extFonts attributes prior to export, but this is not ideal as it alters the diagram semantics.
- Using the PNG/JPG export methods, which must rasterize and do not preserve vector text.
Additional context This feature would benefit automation scenarios (e.g., VS Code extension use, CI/CD, web integrations) and make draw.io more interoperable in environments that prefer not to embed font data. It would align the xmlsvg export behavior with other export methods that respect font embedding toggles./n/nRelated code: src/main/webapp/js/diagramly/Editor.js (Editor.embedExtFonts, embedCssFonts, addFontCss).
Uncheck the embed fonts option in the export dialog:
Thank you for your response. I would like to clarify a few points regarding this issue:
The “embed fonts” option in the GUI works as intended and correctly toggles font embedding for exported SVG files. However, this issue is targeting a different problem. Specifically, when re-saving an SVG that contains fontSource URLs—such as when using draw.io in Embed mode (for example, via https://embed.diagrams.net) - the font data is actively fetched from those URLs and then embedded into the SVG file itself. I am seeking a solution to prevent this automatic font embedding behavior—so that external font references remain as links and are not converted into embedded font data. If you have any ideas or suggestions on how this could be achieved, I would greatly appreciate your advice.