jfree / jfreesvg

A fast, lightweight Java library for creating Scalable Vector Graphics (SVG) output.
http://www.jfree.org/jfreesvg
GNU General Public License v3.0
319 stars 58 forks source link

Font family name issue #27

Closed jfree closed 3 years ago

jfree commented 4 years ago

Reported in the forum at jfree.org : http://www.jfree.org/forum/viewtopic.php?f=32&t=120857

atoone commented 3 years ago

A workaround is to provide an alternate mapping that includes the single quotes around the problematic font name:

SVGGraphics2D g2 = new SVGGraphics2D(...);
((StandardFontMapper)g2.getFontMapper()).put("My Font Name", "'My Font Name'");
jfree commented 3 years ago

I've committed the fix for inclusion in version 5.0. Thanks for the StandardFontMapper suggestion - I've added the single quotes in this part of the code (plus refactored to use Function<String, String> instead of the custom FontMapper interface).