![](https://secure.gravatar.com/avatar/46562c7d27388490d62e8d7a5bc960dd.jpg?s=120&d=mm&r=g)
On 8/26/2020 11:01 AM, Marcel Fabian Krüger wrote:
Hi,
I was playing with the variable font support of ConTeXt's font loader and noticed some issues.
1. While parsing the LocalSubRS and GlobalSubRS Indices, ConTeXt tries to use 16bit count fields as in CFF(1) instead of 32bit fields as in CFF2, reducing the number of found subroutines by a factor of 65536. Effectivly this suppressed all subroutines in the fonts I tested.
2. For fonts where the Top DICT does not contain an FDSelect entry, ConTeXt tries to read the Private dictionary offset from the Top dictionary as in name-keyed CFF1 fonts. This is not the expected behavior for CFF2, where the Top dictionary never contains the Privte offset. Instead, a missing FDSelect means that exactly one entry exists in FDArray which should be used for all CIDs. This caused problems when ConTeXt tried to find the Private directory in order to find local subroutines.
A test font demonstrating both issues is "SourceCode Variable" https://github.com/adobe-fonts/source-code-pro/releases:
The document
\definefontfeature [light] [default] [axis={weight=200}]
\definefont [sourcelight] [file:SourceCodeVariable-Roman.otf*light]
\starttext \sourcelight Hallo \stoptext
Thanks. I'll check it. (Reminds me to check another issue in a variable font that I observed recently, something with accuracy, but of could also be a border case in a viewer as acrobat views ok.) I would not be surprised of there are more issues because at the time I wrote that code there were hardly any valid variable fonts and the specs were just showing up. (Most of those variable fonts were showcases.) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------