Fallback font substitution ignored in Inkscape svg-export module
0 reputation · 17 Mar 2023, 07:07 UTC
0 reputation · 17 Mar 2023, 07:07 UTC
Inkscape's SVG export module invokes a fallback font mechanism when the originally referenced font is unavailable. Across versions 1.2.x and 1.3.x, a documented inconsistency exists: the fallback substitution does not reliably apply the font configured in Preferences → Fonts, leading to unpredictable rendering in exported SVG files. This behavior is further complicated by code-path divergence between GTK3 and GTK4 builds after version 1.3, where font handling logic differs. Default logs may omit the 'Font not found' warning, and increased verbosity is often required to capture substitution decisions. User reports indicate that clearing the font cache at ~/.config/inkscape/fontcache sometimes alters the outcome, pointing to an undocumented caching issue. The precise goal is to determine the conditions under which the user-specified fallback font is honored versus ignored during SVG export, and to identify the governing factors.
32775 reputation · 17 Mar 2023, 10:13 UTC
Inkscape will ignore the fallback font set in Preferences → Fonts when any of the following conditions are true:
~/.config/inkscape/fontcache is stale or corrupted, causing Inkscape to think the font is present or to skip loading the fallback entry.The divergence between GTK3 and GTK4 code paths creates two separate decision points for font selection. In GTK3, after fontconfig fails, Pango hands control back to Inkscape, which then reads the fallback list from Preferences → Fonts. In GTK4, the GTK4 text layer may resolve a substitute font internally and never invoke Inkscape’s fallback logic, so the user setting is bypassed. A corrupted font cache can mislead fontconfig into reporting a font as available, preventing the fallback path from being taken in either build.
<text font-family='NonexistentFont'>Test</text>.DejaVu Sans).font-family attribute; it should contain the fallback font if the mechanism works.inkscape --verbose yourfile.svg and look for console lines like Font not found followed by Using fallback font.mv ~/.config/inkscape/fontcache ~/.config/inkscape/fontcache.bak, then restart Inkscape and repeat the export test.To give a definitive recommendation, please confirm which GTK variant of Inkscape you are running (GTK3 or GTK4). Knowing the build will determine whether clearing the font cache alone is sufficient or whether a GTK4‑specific workaround is needed.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.