Using fonts in custom fontconfig directories for SVG Conversion
Posted: 2016-09-01T08:57:42-07:00
Hello. I've been trying to gather everything I can about ImageMagick's SVG handling(/offloading) with custom fonts.
I've learned that I have to place the fonts in directories that are scanned by fontconfig. As such, if I put my fonts in '/usr/local/share/fonts', for example, the conversion from SVG to PNG/PDF works just fine (which is invoked via IMagick).
However, through fontconfig's 'local.xml', I've defined a custom directory so that I don't have to copy fonts into the system path. fc-match does pick up these fonts as I add new ones to the directory. Unfortunately, ImageMagick (or RSVG? I'm still unclear on the relationship between the two libraries) does not render these fonts unless I explicitly copy them to /usr/local/share/fonts (or perhaps other directories directly in fonts.conf; I haven't checked that yet).
This may ultimately be a fontconfig question, but again, these are registered in fc, but it's IM that's not properly picking them up (through IMagick.. I just tested 'convert' on the command line and I get custom fonts... so could this be an IMagick-specific issue somehow?)
I've learned that I have to place the fonts in directories that are scanned by fontconfig. As such, if I put my fonts in '/usr/local/share/fonts', for example, the conversion from SVG to PNG/PDF works just fine (which is invoked via IMagick).
However, through fontconfig's 'local.xml', I've defined a custom directory so that I don't have to copy fonts into the system path. fc-match does pick up these fonts as I add new ones to the directory. Unfortunately, ImageMagick (or RSVG? I'm still unclear on the relationship between the two libraries) does not render these fonts unless I explicitly copy them to /usr/local/share/fonts (or perhaps other directories directly in fonts.conf; I haven't checked that yet).
This may ultimately be a fontconfig question, but again, these are registered in fc, but it's IM that's not properly picking them up (through IMagick.. I just tested 'convert' on the command line and I get custom fonts... so could this be an IMagick-specific issue somehow?)