I found an issue for Font Squirrel, but this seems to be an issue for Google Fonts, too.
I added "Lato 300" and when I select "-- add selector in theme CSS --" it tells me the font-family is "Lato". Then I enable Lato 900 and when I select "-- add selector in theme CSS --", I am also told the font-family is "Lato". How do I use more than one font from a family?
See screenshot for my quandary!
Comments
Comment #1
Drave Robber commentedThis is completely different from the Font Squirrel issue. There, you could import only one font from each family; here, you can import all of them, but 'add selector in theme CSS' instructions are incomplete.
edit: and this issue is not limited to Google Fonts either.
Patch coming.
Comment #2
Drave Robber commentedPatch attached.
Comment #3
Drave Robber commented(review can be done by anyone but the author :)
Comment #4
sreynen commentedSome font records have empty values for css_style and/or css_weight, which will output invalid CSS with the current patch. Changing
if (fontStyle != 'normal')toif (fontStyle != 'normal' && fontStyle != '')(and same for fontWeight) is probably enough, though we could also cut down on page size a bit by removing the empty data-* attributes from the HTML as well.Comment #5
Drave Robber commentedGood point. And if we're not displaying 'normal', there's no point in passing it at all.
And while we're on this, instructions on the edit page need fixing, too.
Patch attached.
Comment #6
Drave Robber commentedUpdated the patch to take care of #1961418: "Add selector in theme" help text for Typekit fonts suggests wrong syntax as well, using the approach sort of agreed on in #1678292-7: Syntax error on referenced fonts with multiple font-family items.
Comment #7
sreynen commentedLooks good. Committed.