Fix embedded SVG @font-face import on Windows
Summary
This MR improves SVG import for embedded @font-face fonts on Windows.
It adds support for embedded data: font sources during SVG import and unpacks embedded WOFF / WOFF2 fonts into sfnt data on Windows before registering them through the existing font-loading path.
Problem
Imported SVGs with embedded fonts were not loading correctly on Windows.
Before this change:
- embedded
TTF/OTFsupport was incomplete in import flow - embedded
WOFF/WOFF2fonts failed because the Win32 private font loader does not accept raw.woff/.woff2files - SVGs that rendered correctly in browsers did not render correctly after import in Inkscape
Approach
- parse embedded font
data:URIs from SVG@font-facerules during import - decode the embedded font bytes
- on Windows:
- detect embedded
WOFF/WOFF2 - use DirectWrite to unpack them into sfnt font data
- continue through the existing temp-file +
AddFontFile()path
- detect embedded
- keep the current path for already-supported font formats
Validation
Tested manually on Windows / MSYS2 UCRT64 with ninja install. This is a test file that would not open correctly in normal inkscape
Un-modified version:
file:
Verified:
- embedded
TTFimport works - embedded
WOFF2import now works on Windows - the resulting SVG import behaves correctly for the tested Latin text cases

