How to reproduce: 1. emerge -av media-fonts/roboto (Happens on both 20111129 and 20120823 versions.) 2. google-chrome http://play.google.com/ (If needed, open the description page of any item from that site.) What happens: The text is all bold. Why it happens? The font files are incorrectly describing themselves. The full details including a workaround are explained here: http://nileshgr.com/2013/02/24/configuring-roboto-font-in-linux http://www.mail-archive.com/gentoo-user@lists.gentoo.org/msg135623.html What should we do? 1. Deploy a fontconfig workaround in Gentoo's ebuild. 2. Contact upstream and ask them to fix it.
This issue was already discussed in bug 423727, but in the meantime I can now confirm this. I don't think either of the solutions is completely satisfactory, and really this should be fixed upstream. Somebody needs to give these fonts their proper weight. As it is I don't know which stop-gap solution is to be preferred: either not installing Medium and Black, or disabling them with a fontconfig file.
This may have been quietly resolved by upstream, at least partially. I'm one of the people who brought this up in bug 423727, and I was doing a little research to see if anything had changed recently. The link from Google's typography design page has changed, it's now http://developer.android.com/downloads/design/roboto-1.100141.zip and the timestamps are July 31, 2013. A cursory look at the Roboto Black and Black Italic from that zip correctly shows the OS/2 weight as Black (900). I believe the erroneous selection of the Medium fonts by default is still the same, but they were always declaring the right weight, at least according to their names. The problem there seems to be more of a fontconfig situation, for deciding between Book and Medium as the "normal" weight.
I experimented with the files from that new zip just now, and as I suspected, the issue with mis-selection of the Black weight is gone, but the issue with Medium being chosen by default remains. I think I was also able to confirm that the Medium problem comes from fontconfig. Running fc-pattern reveals that fontconfig defaults to a weight of 100 (medium weight), if no weight is specified in the pattern. (For comparison, "book" weight is 75, and both "regular" and "normal" are 80). $ fc-pattern -d -c "" weight Pattern has 1 elts (size 16) weight: 100(i)(s) $ fc-pattern -d -c Roboto weight Pattern has 1 elts (size 16) weight: 100(i)(s) $ fc-pattern -d -c Roboto:regular weight Pattern has 1 elts (size 16) weight: 80(i)(s) The best way I can come up with, barring some change to fontconfig, which seems unlikely, is to modify patterns requesting Roboto: <match target="pattern"> <test name="family" compare="eq"><string>Roboto</string></test> <edit name="weight" mode="append"><const>regular</const></edit> </match> By just appending the "regular" weight, any weight specifically requested takes precedence, and it effectively just makes "regular" the fallback weight, as well as the default one when none is selected. In contrast to the previous linked workaround, this doesn't block off the Medium weight, it just effectively alters the default selection. The effects seem pretty good. Various weights return as you'd expect: $ fc-match Roboto Roboto-Regular.ttf: "Roboto" "Regular" $ fc-match Roboto:medium Roboto-Medium.ttf: "Roboto" "Medium" $ fc-match Roboto:black Roboto-Black.ttf: "Roboto" "Black" As do explicit styles: $ fc-match Roboto:style=Regular Roboto-Regular.ttf: "Roboto" "Regular" $ fc-match Roboto:style=Medium Roboto-Medium.ttf: "Roboto" "Medium" $ fc-match Roboto:style=Black Roboto-Black.ttf: "Roboto" "Black" As far as I can tell, this just restores the default selection that "should" be happening, and doesn't block out selection of any of the styles (though I've just tested it with fontconfig's direct tools so far).
Thanks for that! I'm sorry I've left this issue open for so long. I hope to have time in a couple of days to finally address this.
This should be fixed in the new version now.
*** Bug 491186 has been marked as a duplicate of this bug. ***
I'm temporarily working around the renewed Black problem in the latest version by just manually editing the weight class with Fontforge and replacing the Black font with the edited version. Alternatively, it should be possible to add another rule to the fontconfig file that's currently shipping with the package to override the weight data as read by fontconfig. Of course, just having a correct font to start with would be best. Strangely, the font in the googlefontdirectory hg repo seems to have the right weight data. As far as I can tell, they just dump the ttfs in there and make subsets from them; there's no source files for Roboto in that repo.
As another workaround, Roboto from dev-texlive/texlive-fontsextra-2014 works fine
(In reply to John Flatness from comment #7) > Of course, just having a correct font to start with would be best. > Strangely, the font in the googlefontdirectory hg repo seems to have the > right weight data. As far as I can tell, they just dump the ttfs in there > and make subsets from them; there's no source files for Roboto in that repo. I have just repackaged the roboto fonts as they are currently found in the hg repo. Let me know if this issue is fixed in the new version, or if there still are problems.
(In reply to Ben de Groot from comment #9) > I have just repackaged the roboto fonts as they are currently found in the > hg repo. Let me know if this issue is fixed in the new version, or if there > still are problems. Selecting Roboto regular still forces Roboto medium. The KDE font selection dialog makes no distinction between regular and medium, and medium is always selected in the font settings. The fonts from the hg repo appear to be the same Roboto fonts listed on the Material design page[1]. You might want to use the provided archive (no versioning) instead of packaging it yourself. The ebuild homepage url should probably be updated as well. [1] http://www.google.com/design/spec/style/typography.html
media-fonts/roboto-2015.03 appears to resolve this problem (the part with the Black weights, anyway). The Black and BlackItalic variants both correctly have weights of 900, so fontconfig doesn't mistakenly select them. As for issues with the Medium weight, fontconfig 2.11.1 incorporated the fix I mentioned in a previous comment: https://bugs.gentoo.org/show_bug.cgi?id=491186#c1 On Gnome3/GTK, the font selection works fine with these and all weights are selectable, including Regular, Medium, and Black, and Regular is correctly the "normal" weight. fc-match also behaves correctly: Roboto, Roboto:medium, and Roboto:black queries each select the right font.
For some reason the Roboto Condensed was not condensed at all, in the roboto 2015.03 package, so I had to mask it.
Should this bug still be open? No surprises/issues for me with =media-fonts/roboto-2.138. In particular, selecting Roboto with XeLaTeX+fontspec sets Roboto-Regular.
My distant recollection here is that this was 2 issues: 1 in fontconfig that would prefer "Medium" over "Regular", and 1 in Roboto itself where the weights were specified wrong in the font files. I believe both are long since fixed, but I don't currently have a graphical Gentoo environment at the moment to check for sure.
fc-match "Roboto" prints out now Roboto-Regular.otf: "Roboto" "Regular"