When I upgraded to 2.0, the font was not appearing. But, I figured that would be caught quickly. I have upgraded to 2.1 and the font still is not appearing. I have enable it and I am using my own CSS. See attached screen prints.

On another note, I think that it would make more sense for the button to read "Save" then to read "Edit" when we are enabling and configuring a font.

Comments

vegantriathlete’s picture

<FWIW: spelling error in my creation of the issue>
... it would make more sense for the button to read "Save" _than_ to read "Edit" ...

sreynen’s picture

Can you post what CSS is being included in the HTML <head> when that font is enabled? Looking at the live site, I'm not even seeing anything, but I'm not sure if you still have it enabled.

Also, why do you think "Save" would be better than "Edit"? It sounds a little more vague to me.

PaulchenPlump’s picture

Same problem here - can the problem be FontSquirrel?

sreynen’s picture

Priority: Normal » Major
StatusFileSize
new892 bytes

This is a bug that affects all Font Squirrel fonts. It was introduced in 2.0 alpha 2, specifically, in this commit. I'm surprised no one opened an issue earlier. It's just completely broken on Font Squirrel.

The attached patch should fix it. Please confirm and I'll get a 2.2 release out ASAP.

sreynen’s picture

Title: Font (BallparkWeiner) is not displaying » Font Squirrel fonts not loading
Status: Active » Needs review
Bèrto ëd Sèra’s picture

Version: 6.x-2.1 » 7.x-1.0-beta2

Same problem on 7, the patch won't fix it

carvalhar’s picture

it didn't fix

sreynen’s picture

Okay, that brings me back to my earlier question:

Can you post what CSS is being included in the HTML when that font is enabled?

carvalhar’s picture

This modules adds:

link href="http://matt-mcinerney.kernest.com/fonts/allerta.css" rel="stylesheet" type="text/css" />
link href="http://sursly.kernest.com/fonts/blackout-2am.css" rel="stylesheet" type="text/css" />
@import url("http://localhost/drupal7/sites/default/files/fontyourface/font.css?lfok04");

But Alerta and Blackout are from KERNEST (everything ok).

I have also 'AcknowledgementMedium' and 'ActionManRegular' from Squirrel and both aren't added.

sreynen’s picture

Status: Needs review » Postponed (maintainer needs more info)

Okay so the Font Squirrel fonts aren't getting CSS added and that's why they aren't working. Unfortunately, I have no idea why that would still be happening after applying the patch, and I think to figure it out someone will need to debug the code locally where it's not working. I'd be happy to do that, but someone would need to give me SSH access to their server. For now, I'm marking this as "postponed", as I've run out of ideas about what might be causing the problem.

If anyone's able to offer more information, please set it back to "active."

dougm’s picture

I don't have any insight into the problem other than I see two issues. The first it that it doesn't make the directory to unzip into. If done manually, it doesn't find the fonts.

Bèrto ëd Sèra’s picture

I can offer ssh access, as I have no time to debug it myself, you can find me on #gentoo-it on irc at basically any time (quasselcore is up 24/7) so just query me for details. Thanks and compliments, this thing really rocks

carvalhar’s picture

if you want me to test, i can do it by myself, just tell me what i need to debug and where.

sreynen’s picture

Status: Postponed (maintainer needs more info) » Active

@carvalhar, what I'd do is add some dpm() calls (using devel) to fontyourface_add_css_in_preprocess() and see what it's passing to drupal_add_css(), then check that there's actually a file at that path. I'm thinking it's getting an invalid path, so it's not adding it to the CSS list. The patch above tries to fix the path, but @dougm's comment suggests maybe the file isn't there.

@dougm do you get an error saying PHP isn't compiled with zip? Or are you talking about something different?

@Bèrto ëd Sèra, I'll catch you in IRC when I get a chance, thanks!

vegantriathlete’s picture

I think "save" makes more sense because I am just enabling the font. I don't see myself as actually editing anything. To me, clicking an edit button should take me to a page that allows me to, well, um, edit something. In this case, clicking the button saves the setting that the font is now enabled. I suppose you could argue that what you are "editing" is the CSS classes or IDs to which the font applies. But, in my case, I just put the font-family into my own CSS.

As far as the CSS that is included in the <head> section, what you see is what you get. I still have the font enabled. But, it seems you may already have more of a lead into the issue based on the above comments.

Unfortunately, at the moment I am way too swamped to try to debug this (or even to set you up with ssh on my shared hosting account). So, I am willing to accept the fact that this may not be addressed until I can contribute a bit of my time to help with the solution. Thanks for your willingness to dig into it, though.

carvalhar’s picture

function fontyourface_add_css_in_preprocess has an argument css_path.
with dpm($css_path) i got only kernest css. no squirel.

At function fontsquirrel_preprocess_page i did dpm($used_font); but nothing is returned.

At sites\default\files\fontyourface\fontsquirrel\ there are font zips and they are uncompressed correctly.

I don't know the point where the font get attached to drupal header, but i think it isn't being passed to drupal by fontsquirrel module. Because the font IS ok and at admin it's working.

Bèrto ëd Sèra’s picture

FYI I get this warning after switching to PHP5.3:
Strict warning: Only variables should be passed by reference in fontyourface_preprocess_page() (line 490 of /home/web/aegir/drupal-7.0/sites/all/modules/fontyourface/fontyourface.module).
It's probably not related, yet I'd say that function fontyourface_preprocess_page(&$vars) is not only the warning's target, but possibly the place where our problem takes place.

sreynen’s picture

Thanks @carvalhar, I think I know what the issue is now. I think the problem is that Font Squirrel isn't weighted right. fontsquirrel_preprocess_page() is supposed to run after fontyourface_preprocess_page() so fontyourface can say which fonts are enabled, and fontsquirrel can check if any of those fonts belong to it. But if fontsquirrel runs first, it sees no fonts enabled, so doesn't load anything.

If anyone wants to test this, the fix should be running this code:

db_query("UPDATE {system} SET weight = 1 WHERE name = 'fontsquirrel'");

I'll try to get this into a release soon.

sreynen’s picture

Version: 7.x-1.0-beta2 » 7.x-1.x-dev
Status: Active » Needs review

I've committed changed to both 7.x-1.x-dev and 6.x-2.x-dev that I hope fix this problem. Please test those releases and confirm whether or not this problem is fixed.

Note: after changing the code, you'll also need to disable and re-enable the Font Squirrel module for the fix to take effect (it happens in hook_enable).

sreynen’s picture

If you're not checking out code via CVS, you'll need to wait until the dev packages are updated to get the new code. I think that happens nightly, so it should be ready tomorrow.

Bèrto ëd Sèra’s picture

Fixed!!

sreynen’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta3
Status: Needs review » Fixed

This fix is now in both 7.x-1.0-beta3 and 6.x-2.2 releases.

vegantriathlete’s picture

@carvalhar: Thanks for the debug work!

As soon as I installed the latest release, the font showed up.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.