The Scalable Vector Graphics (SVG) drawing software---Batik---that's used by the application may be unable to read certain SVG files produced by Inkscape. The result is that embedding the vector graphics files may trigger the following issues:
- Unable to create nested element
- Black blocks, no text displayed
- Black text instead of coloured
The remainder of this document explains these problems and how to fix them.
When referencing a vector graphic using Markdown, the status bar may show the following error:
The current document is unable to create an element of the requested type (namespace: http://www.w3.org/2000/svg, name: flowRoot).
This error is due to a version mismatch of the flowRoot
element that Inkscape creates.
Resolve the issue by changing the SVG version number as follows:
- Edit the vector graphics file using any text editor.
- Find
version="1.1"
and change it toversion="1.2"
. - Save the file.
The SVG will now appear inside the application; however, the text may appear as black blocks.
Depending on how text is added to a vector graphic in Inkscape, the text may be inserted within an element called a flowRoot
. Although Batik recognizes flowRoot
for SVG version 1.2, it cannot fully interpret the contents. Black blocks are drawn instead of the text, such as those depicted in the following figure:
Resolve the issue by "unflowing" all text elements as follows:
- Start Inkscape.
- Load the SVG file.
- Select all the text elements.
- Click Text → Unflow.
The text may change size and position; recreate the text without dragging using the text tool. After all the text areas have been recreated, continue as follows:
- Click Edit → XML Editor.
- Expand the XML Editor to see more elements.
- Delete all elements named
svg:flowRoot
. - Save the file.
When the illustration is reloaded, the black blocks will have disappeared, but the text elements ignore any assigned colour.
When an SVG style
attribute contains a reference to -inkscape-font-specification
, Batik ignores all values that follow said reference. This results in black text, such as:
Resolve the issue of colourless text as follows:
- Open the SVG file in a plain text editor.
- Remove all references
-inkscape-font-specification:'<FONT>';
, including the trailing (or leading) semicolon. - Save the file.
When the illustration is reloaded, the colours will have reappeared, such as: