Here's an example:

I'm using the Kanone font, provided by Google Fonts. The URL looks like this:

http://fonts.googleapis.com/css?family=Yanone%2BKaffeesatz:300,400,700&s...

If you go to that URL, you'll get a 404. Because the "+" that should be in that URL has been encoded into a "%2B". If you make it a "+", it works:

http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:300,400,700&sub...

My "solution" was to decode the URL before calling drupal_add_css() in fontyourface_add_css_in_preprocess() .. This probably has some security implications, but better than no font for now. Here's attaching a patch to get the ball rolling..

Comments

fakingfantastic’s picture

StatusFileSize
new625 bytes

Patch

fakingfantastic’s picture

StatusFileSize
new1.11 KB

That inadvertently threw an error about css_fallback not being a valid property. Instead of checking if($obj->val), better to do if(isset($obj-val))

Patch is patch #1, with this isset() patch as well..

sreynen’s picture

Status: Active » Closed (duplicate)

This sounds like a duplicate of #1613760: Calling css from fonts.googleapis.com broken in 2.3, which was resolved by re-importing the Google fonts. Please try that and re-open that issue if it doesn't work so we can have all related discusion in one place.

fakingfantastic’s picture

Status: Closed (duplicate) » Active

Just an update: enabling the new font had no effect for me, still needed to apply my patch. IMO, the Font objects should have a valid URL and should not be encoded.

Drave Robber’s picture

For me, the URL is just fine:
<link type="text/css" rel="stylesheet" href="http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:regular,300,700&amp;subset=latin,latin-ext" media="all" />

Did you go to Configuration > @font-your-face settings and click Update Google fonts?

sreynen’s picture

Status: Active » Postponed (maintainer needs more info)

fakingfantastic, did you re-import after updating?

It's not really a question of whether fonts should have valid URLs. They clearly should. The question is whether this problem has already been solved.

Drave Robber’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

This hasn't been possible to reproduce for some time now.

Feel free to reopen if you can provide steps to reproduce with the latest release.