[NTG-context] SVG comments, transparency, and extended font styles

Thangalin thangalin at gmail.com
Sat Apr 3 20:10:55 CEST 2021


Issues encountered with version 2021.03.31 18:04.

1. Comments in SVG

% SOF
\startbuffer[svg]
<svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
<!-- Hello --><g><circle cx="50" cy="50" r="20"/></g></svg>
\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Black circle, no border, comment lines ignored.
Actual: Empty square.

2. Transparent stroke

% SOF
\startbuffer[svg]
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<polygon fill="#eeffff" stroke="transparent" points="500,10 500,0 0,0 0,10"
/>
</svg>
\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: Light cyan rectangle, no border (it's transparent).
Actual: Light cyan rectangle with visible border.

3. Inkscape font specification

We discussed this previously: Inkscape extends the SVG specification with a
custom style class ("-inkscape-font-specification") that allows its users
to refine font styles.

% SOF
\startbuffer[svg]
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 154.6 19.3"
width="155" height="19"><text x="-6.7" y="-2.3"><tspan x="-1.9" y="15"
style="-inkscape-font-specification:'Roboto,
Ultra-Light';font-family:Roboto;font-size:20px;font-weight:200">Roboto
Ultra-Light</tspan></text></svg>
\stopbuffer

\starttext
  \placefigure{}{\includesvgbuffer[svg][conversion=mp]}
\stoptext
% EOF

Expected: "Roboto Ultra-Light" appears in Roboto Ultra-Light font.
Actual: Empty square.

Supporting this via MetaPost would help maintain backwards compatibility
(with ConTeXt invoking Inkscape).

Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20210403/83823f38/attachment.htm>


More information about the ntg-context mailing list