On Mon, 2017-10-23 at 15:19 +0200, Tavmjong Bah wrote:
On Sat, 2017-10-21 at 14:27 -0600, Amelia Bellamy-Royds wrote:
It would be very useful if Inkscape was to suppport CSS @font-face, which could have relative URLs to fonts in the same folder or a subfolder.

This is a long term goal of mine. I looked at adding 'user fonts' to Inkscape some time ago (I was interested in adding SVG font support) but ran into problems with the FontConfig/Cairo/Pango stack.



I've just added code to trunk that will load local ttf or otf fonts listed in a CSS @font-face rule. The code is rather primitive. It basically searches for sources that end in .ttf or .otf, assumes they are font files, and then loads the font file using FcConfigAppFontAddFile(). No refresh of the font-family menu list is done so the font will only appear in the menu if loaded before the menu is generated the first time (i.e. if the file with the @font-rule is specified on the command line). The 'font-family' part of the CSS @font-face rule is completely ignored so the font can only be used with its native name. And there is no GUI to edit a CSS @font-face rule.

Despite these limits, it can be used to load fonts in the same folder or in a subfolder...

Tav