Forum Feature requests

Plans for modernized OpenType font format support?

twardoch
In March 2015, the OpenType font format specification version 1.7 was released. This was a major extension of the spec, which added support for the “MATH” table for mathematical typesetting, as well as support for three storage formats for multi-color glyphs: “COLR/CPAL” which combines pre-existing monochrome outline glyphs into multi-color glyphs, “CBDT/CBLC”, which uses PNG bitmaps to store multi-color glyph images, and “SVG”, which stores multi-color glyphs as a mixture of complex vector graphics (with gradients, strokes and transparencies) as well as bitmaps.

Throughout 2016, a working group consisting of five large companies (Apple, Adobe, Google, Microsoft and Monotype) and a few invited experts worked on another major extension to the standardized font format: OpenType Font Variations. In September 2016, the results were presented at the ATypI Warsaw conference: OpenType version 1.8 added support for variable glyphs and metrics via the “gvar” table, backwards-compatible to the TrueType GX Variations extension which was introduced in 1993 by Apple but never gained any traction, and the “CFF2” table, which provides a similar mechanism for PostScript-flavored fonts and replaces the previous “CFF” table. The “sbix” table was also added, which uses PNG bitmaps for multi-color glyphs, much like the “CBDT” table.

So today, we have 4 OpenType font flavors with multi-color glyphs (some of them being supported in HTML browsers). For variable fonts, we have proposed CSS4 syntax, support in Chrome, Firefox and WebKit, and alpha fonts.

Does Prince have any timeframe for adding support for any of these new aspects of OpenType?
mikeday
The diligence of font developers in creating extra labour for us knows no bounds! Two different variation formats, four different emoji formats, all on top of the existing two different outline formats, two different WOFF formats, and three different typesetting feature formats. It is truly a blessing that I have devoted my life to the seemingly simple task of getting glyphs on paper. :D

We do plan to implement these features, although it will take time, and our schedule also depends upon the needs and priorities of our customers.
twardoch
Mike,

it masy be of interest to you that fontkit, a modern an extensive OpenType font parser and layout engine work in JS has just received a comprehensive upgrade with a full Indic shaper that is a port of the spec-compliant Harfbuzz shaper:
https://github.com/devongovett/fontkit/pull/99

Perhaps Prince could make use of fontkit (if it's more convenient than using Harfbuzz) via JS so that you could do full OpenType Layout rendering for all Indic scripts. Note that fontkit also supports AAT features and variable OprnType fonts.
mikeday
Nice, I'll take a look! If nothing else it may encourage us to lift our game. :D
twardoch
Here's a demo of fontkit rendering variable fonts with features into HTML canvas:

https://fontkit-demo.now.sh/
https://github.com/devongovett/fontkit-demo
twardoch
BTW, as of now, LuaTeX is the only automated solution that supports these new things in long PDF creation (there is https://github.com/devongovett/pdfkit by the fontkit author but that's only good for PDFs that are composed like graphics rather than typeset).

Prince is unique because it supports OpenType Layout features and custom fonts well. With support for variable fonts, it might get ahead of the game not only with Antenna House but also traditional GUI document creation tools like InDesign, for whom adding support for variable fonts will be difficult.
twantzen
@mike I couldn’t find the information on your page, so I'll ask here: Does PrinceXML support variable OpenType fonts? (We are using PrinceXML 14, but I think, I'll advice our IT to update soon.)

Thanks, Tobias
mikeday
Not variable fonts yet, no. But we do support more emoji formats now! And the second generation of Indic shapers.
mikeday
The Prince latest builds now support variable fonts! We will post more about this next week. :D
mparento
Hi Mike,
Does the support for variable fonts include TrueType variable fonts? When testing some of them with version 15.4.1, the output suggests that they are not supported yet.
Thanks,
Martin
mikeday
Yes it should! Do you have an example font we could look at?
mparento
Here are the files that I used to test the conversion with version 15.4.1. I got the fonts "Dosis" and "Josefin Sans" from Google Fonts. I also join the resulting PDF where the characters of the variable fonts are much thinner than in the Web browser.
  1. Dosis-VariableFont_wght.ttf116.1 kB
  2. JosefinSans-VariableFont_wght.ttf117.7 kB
  3. TestJosefinSans.html0.8 kB
  4. TestJosefinSans.pdf22.7 kB
wezm
mparento wrote:
Does the support for variable fonts include TrueType variable fonts? When testing some of them with version 15.4.1


The variable fonts support is not in a numbered Prince release yet. You'll need to use a latest build to try it out.