On 20/02/2020 18:33, Simon Tatham wrote:
A user of my notation font Gonville reported to me this week that they
had tried to use the Lilypond SVG backend with Gonville, and had found
that everything worked fine except that the sharp signs were
mysteriously missing from the output.I debugged the problem and found that this happened because Fontforge
had generated the SVG path string for that glyph in a way that happened
to include the floating-point literal "9.91821e-05", written in
scientific notation, and that the 'glyph-path-regexp' definition in
output-svg.scm was failing to match the path string as a result, because
it doesn't permit the letter 'e'.I was able to work around the issue by editing my SVG font file to
re-express that number as 0.0000991821, without the 'e'. But as far as I
can see, scientific notation of that form is legal per the SVG spec:
https://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathDataBNFApplying the attached patch against output-svg.scm also solved the
problem for me, and I think it's a better fix.Cheers,
Simon
Looks good, thanks for the detailed explanation. Looking further into https://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathDataBNF, we're also missing the characters
+Aa,? Does it make sense to fuse attached patch with the original one?Am Freitag, den 21.02.2020, 11:33 +0000 schrieb Simon Tatham:
Absolutely correct, good spot. Luckily (for my testing) '-' is between
'+' and 'M', but that's actually too broad. Will fix the patch.
Thanks
Jonas
SVG: Permit 'e' to appear in SVG font glyph paths
The definition of 'glyph-path-regexp' will only match a <path d="...">
element if the contents of the 'd' attribute do not include the letter
e. But the SVG spec permits coordinates to be given in C-style
exponential notation such as 9.8e-5. If a glyph in an SVG font uses
that ability, extract-glyph will fail, and the glyph will be silently
omitted from the output file.</path>
by Simon Tatham anakin@pobox.com
Follow-up: Also allow '+Aa,' in SVG path descriptions
See https://www.w3.org/TR/2011/REC-SVG11-20110816/paths.html#PathDataBNF
Note that - must be first in the character class or it will specify
a range of characters (as the first version of this patch did).
http://codereview.appspot.com/561460044
Passes make, make check and a full make doc.
Passes make, make check and a full make doc.
Patch on countdown for Feb 26th.
Patch counted down - please push
pushed as
@dakas if not too late, this could be worth picking into 2.20