Hi everyone,
I have a problem with getting the font weights for Roboto (and other Google Fonts) to work on Ubuntu 14.04 (fontconfig 2.11.0).
Problem
We use Phantom.js on an Ubuntu 14.04 server for exporting pages that contain web fonts, which we've installed locally from https://github.com/google/fonts
A webpage containing all font weights (roman + italic) for Roboto outputs this PDF: https://www.dropbox.com/s/3q5eanoqaimc0jx/project.pdf?dl=0And the embedded fonts are as follows, based on running `strings file.pdf | grep "FontName"`:
/FontName /QNBAAA+Roboto-Thin
/FontName /QCCAAA+Roboto-Regular
/FontName /QSBAAA+Roboto-Bold
/FontName /QHCAAA+Roboto-Black
/FontName /QYAAAA+Roboto-LightItalic
/FontName /QDBAAA+Roboto-MediumItalic
/FontName /QXBAAA+Roboto-BoldItalic
/FontName /QIBAAA+Roboto-BlackItalic
/FontName /QNBAAA+Roboto-Thin
/FontName /QCCAAA+Roboto-Regular
/FontName /QSBAAA+Roboto-Bold
/FontName /QHCAAA+Roboto-Black
/FontName /QYAAAA+Roboto-LightItalic
/FontName /QDBAAA+Roboto-MediumItalic
/FontName /QXBAAA+Roboto-BoldItalic
/FontName /QIBAAA+Roboto-BlackItalic
What I've tried
I came across this repository https://github.com/andreasf/Roboto/ which states it's "A fontconfig-compatible version of the Roboto font family". It got me thinking "Of course, there must be something wrong with the metadata!" (although installing those versions of Roboto still did not fix the issue), and that led me through several hours of tinkering with the font medatata with the fonttools https://github.com/behdad/fonttools/ library -- which is amazing btw -- but that did not help, regardless of the various combinations of values in the naming table and OS/2 flags (usWidthClass / fsSelection / etc).
I then found this bug https://bugs.freedesktop.org/show_bug.cgi?id=81453 which suggests that fontconfig 2.11.91 has some fixes related with the improper mapping between weights and font files, but it seems the latest version released for Ubuntu is 2.11.0 (on our 14.04 version) or 2.11.1 (on later versions).
Questions
* Is there a way to get the font weight fixes up and running on Ubuntu 14.04?
* Alternatively, is there a way to make fonts with multiple weights work on the current setup? (fontconfig 2.11.0) -- It's still not clear for me what font metadata gets taken into consideration when deciding which font corresponds to each weight -- is there some source code I can take a look at?
* Is the limitation of not being able to have more than 4 font files sharing the same Font Family in the name table nameID = 1 still relevant? Does it fall back to nameID 16 & 17 (Typographic Family Name / Typographic Subfamily Name) if they are present?
~
~
Thank you very much! And sorry if I'm asking any stupid questions, I'm in way over my head with this :-)
Bests,
Dan B.
_______________________________________________ Fontconfig mailing list Fontconfig@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/fontconfig