Closed jonathan-laurent closed 6 years ago
Looking where head is used (in only two places), my conclusion is that the font has no kerning but it is the standard option is to use kerning. Then this bug occurs. Until it is fixed try HADV instead of KERN:
textSVG' $ TextOpts t lin INSIDE_H HADV False 1 1
Thanks for your quick reply. I tried HADV but this results in the same error.
@tkvogt are you talking about this line https://github.com/diagrams/SVGFonts/blob/6efb50a84e8f986b80c25bf731770218fbf40f75/src/Graphics/SVGFonts/ReadFont.hs#L253 ? That can't cause this error, because it checks for not (null s0)
before calling head s0
.
The other place head
is used seems to be https://github.com/diagrams/SVGFonts/blob/6efb50a84e8f986b80c25bf731770218fbf40f75/src/Graphics/SVGFonts/ReadFont.hs#L97 , but I don't know what that code is doing.
I just played around with cmutt.svg, and found that changing the third line from
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
to just
<svg xmlns:xlink="http://www.w3.org/1999/xlink">
makes the error go away. So obviously some tags like <font>
don't have the right namespace and are discarded. The easiest way to fix this would be IMHO an error message like "No font tag found by SVGFonts, delete the namespace in the
Fixed. The library can now handle svg namespace or no namespace.
Thanks!
I tried to load a font that I had converted to SVG format using FontForge and got the following error:
I am using the latest version of SVGFonts. You can find attached:
Thanks for your help!