Closed (fixed)
Project:
@font-your-face
Version:
7.x-1.0-beta3
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2011 at 19:45 UTC
Updated:
14 Feb 2011 at 22:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
vegantriathlete<FWIW: spelling error in my creation of the issue>
... it would make more sense for the button to read "Save" _than_ to read "Edit" ...
Comment #2
sreynen commentedCan 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.
Comment #3
PaulchenPlump commentedSame problem here - can the problem be FontSquirrel?
Comment #4
sreynen commentedThis 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.
Comment #5
sreynen commentedComment #6
Bèrto ëd Sèra commentedSame problem on 7, the patch won't fix it
Comment #7
carvalhar commentedit didn't fix
Comment #8
sreynen commentedOkay, that brings me back to my earlier question:
Comment #9
carvalhar commentedThis 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.
Comment #10
sreynen commentedOkay 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."
Comment #11
dougm commentedI 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.
Comment #12
Bèrto ëd Sèra commentedI 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
Comment #13
carvalhar commentedif you want me to test, i can do it by myself, just tell me what i need to debug and where.
Comment #14
sreynen commented@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!
Comment #15
vegantriathleteI 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.
Comment #16
carvalhar commentedfunction 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.
Comment #17
Bèrto ëd Sèra commentedFYI 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.
Comment #18
sreynen commentedThanks @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.
Comment #19
sreynen commentedI'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).
Comment #20
sreynen commentedIf 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.
Comment #21
Bèrto ëd Sèra commentedFixed!!
Comment #22
sreynen commentedThis fix is now in both 7.x-1.0-beta3 and 6.x-2.2 releases.
Comment #23
vegantriathlete@carvalhar: Thanks for the debug work!
As soon as I installed the latest release, the font showed up.