Open arlith opened 7 years ago
Same problem for me. Did you find a workaround ?
I did not find a way to get embedded SVG fonts to work (the <font>
tag). I ended up using SVGSalamander's FontSystem
class. If you look at line 283 of Text.java
, if the Universe
doesn't know about the requested font-family
, it will call FontSystem.createFont(4)
. Ultimately, this can end up using a java.awt.Font
that the JVM knows about.
However, I did find that SVGSalamander uses ints in the MissingGlyph
class to store the bounding volume of the glyph for an individual character. Depending on the font you use, this can cause kerning issues. I created a PR to fix this issue (#21).
Font.loaderEndElement
callsUniverse.registerFont
.Universe
keeps a map of font face names that map toFont
instances. However, at the timeFont.loader.EndElement
is called,FontFace.build
has not been called, which means thatFontFace.fontFamily
will be null. This means that any<font>
tags in the SVG will get registered in theUniverse
with a key value of null.As far as I can tell, this makes it so no
<font>
tags will ever get used properly.