khaledhosny / harf

A HarfBuzz-based font loader and shaper for HarfTeX
GNU General Public License v2.0
10 stars 1 forks source link

SVG in OpenType unsupported? #48

Closed emojifreak closed 5 years ago

emojifreak commented 5 years ago

HarfBuzz seems to support color SVG in OpenType font format from Oct. 2018 as https://github.com/harfbuzz/harfbuzz/issues/1192#issuecomment-433875264

As I understand, the PDF spec. does not support SVG-in-OT, so SVG has to be converted to PDF or Type3 font to render it in PDF. If one downloads Abelone font (or anything) to current directory and process the below file by harflatex, no SVG-to-PDF or SVG-to-Type3 conversion seems taking place. Can I consider SVG-in-OT as unsupported by harftex? I have little opinion on whether or not SVG-in-OT should be supported, though use of stylish color SVG font may be fun.

Location of Abelone font: https://www.fontself.com/colorfontweek/2018#abelone

LaTeX file:

\documentclass{minimal}
\usepackage{harfload}
\font\svgcolorfont={file:./Abelone-FREE.otf:mode=harf;+svg}
\begin{document}
\noindent
\svgcolorfont ABCDEF abcdef
\end{document}
khaledhosny commented 5 years ago

Currently SVG glyphs are unsupported. These would require either a pure Lua SVG to PDF convertor (I’m not aware of any), or depending on an external tool (complicated to setup and not the best UX).

I’d like to give the first option a try at some point (finding a Lua implementation or writing one), but it isn’t a priority at the moment.