<div dir="ltr"><div>Hi everyone, <br><br></div><div>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). <br><br></div><div><b>Problem</b><br></div><div><br></div><div>We use Phantom.js on an Ubuntu 14.04 server for exporting pages that contain web fonts, which we've installed locally from <a href="https://github.com/google/fonts">https://github.com/google/fonts</a> <br><br></div>A webpage containing all font weights (roman + italic) for Roboto outputs this PDF: <a href="https://www.dropbox.com/s/3q5eanoqaimc0jx/project.pdf?dl=0">https://www.dropbox.com/s/3q5eanoqaimc0jx/project.pdf?dl=0</a><br><div><br></div><div>And the embedded fonts are as follows, based on running `strings file.pdf | grep "FontName"`:<br><br>/FontName /QNBAAA+Roboto-Thin<br>/FontName /QCCAAA+Roboto-Regular<br>/FontName /QSBAAA+Roboto-Bold<br>/FontName /QHCAAA+Roboto-Black<br>/FontName /QYAAAA+Roboto-LightItalic<br>/FontName /QDBAAA+Roboto-MediumItalic<br>/FontName /QXBAAA+Roboto-BoldItalic<br>/FontName /QIBAAA+Roboto-BlackItalic<br><br></div><div><b>What I've tried<br><br></b></div><div>I came across this repository <a href="https://github.com/andreasf/Roboto/">https://github.com/andreasf/Roboto/</a> which states it's <i>"<span class="">A fontconfig-compatible version of the Roboto font family</span>"</i>. 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 <i>fonttools</i> <a href="https://github.com/behdad/fonttools/">https://github.com/behdad/fonttools/</a> 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).<br><br></div><div>I then found this bug <a href="https://bugs.freedesktop.org/show_bug.cgi?id=81453">https://bugs.freedesktop.org/show_bug.cgi?id=81453</a> which suggests that <b>fontconfig 2.11.91</b> 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).</div><div><br></div><div><b>Questions<br><br></b></div><div>* Is there a way to get the font weight fixes up and running on Ubuntu 14.04? <br></div><div>* 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?<br></div><div>* 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?<br><br>~ <br><br></div><div>Thank you very much! And sorry if I'm asking any stupid questions, I'm in way over my head with this :-) <br><br></div><div>Bests,<br></div><div>Dan B.<br></div><div><br></div></div>