I am having an issue with the 1 local font that is installed. I believe cron might be the culprit. The situation is that every about 12 hours (the same interval as when cron runs) my installed local font no longer works. It shows as installed, however the preview (and the text which uses the local font class) no longer uses the font and reverts back to a standard webfont. Furthermore, I checked the recent log entries, and sure enough right after cron has run, I get a page not found error referring to the imported local font.

Location [mydomain]/sites/default/files/fontyourface/local_fonts/HelveticaLight/helveticaneue_light-webfont.ttf
Referrer [mydomain]/sites/default/files/fontyourface/local_fonts/HelveticaLight/stylesheet.css?S

I tried using supercron by limiting to only invoke dblog, search, statistics and update, but the problem persists (did not see any fontyourface names in the invoke list). I have also temporarily disabled cron, and have not had the issue reappear since.

Any suggestions?

thanks!

CommentFileSizeAuthor
#17 fontyourface_localfonts.patch921 bytesherve

Comments

sreynen’s picture

Category: bug » support

You didn't see any fontyourface in the cron list because the module doesn't do anything on cron. If something is making changes on cron (rather than the timing being just a coincidence), it's another module.

Is that .ttf file still there and returning an incorrect not found error, or is the file actually deleted? I wonder if maybe there's something on your host deleting file types it doesn't recognize as a security precaution.

syntheticMedia’s picture

Thats a good question, Ill check with the host. Ill also check to see if cron is deleting the actual ttf file. While I realize its probably something else, I did see that on three occasions literally the second after cron had run the errors began, and since disabling cron I have not had the problem in several days. Very strange indeed, thanks for the reply

sreynen’s picture

Another thing you might try is changing the file owner and permissions on that file after it is created and then watching for a permissions error when cron runs. The error will tell you what's trying to delete the file.

shaneonabike’s picture

+1 I uploaded the files previously to my site and it seems that later they were missing again. I had to scp them up to the server for everything to work properly. I can only imagine that this was related to cron as no other process would have deleted the files.

sreynen’s picture

Status: Active » Postponed (maintainer needs more info)

ShareOnABike, please try #3 and see if that gives you any info on what specifically is deleting the files. I'm fairly certain it's not @font-your-face doing the deleting.

dsobon’s picture

Please see http://drupal.org/node/1016810

fontyourface/modules/local_fonts/local_fonts.module uses the function file_save_upload, which sets the status flag to FILE_STATUS_TEMPORARY (pressflow) or 0 (drupal) regardless of failure or success. the status flag is stored in the db when file_save(...) is called.

The site-wide cron hook will delete any marked temporarily files (entries marked as status=0 in the files table).

sreynen’s picture

Category: support » bug
Status: Postponed (maintainer needs more info) » Active

Thanks, dsobon. It looks like the upload code needs to use file_set_status() to change it to permanent after upload. I didn't realize how that worked.

sreynen’s picture

Version: 6.x-2.4 » 6.x-2.x-dev
Status: Active » Fixed

Fix committed to dev. I'll do a new stable release soon.

shiftymic’s picture

I am having the same problem --- for me it seems to maybe be something with the site's cache settings. Most times when I load a page the fonts in my menu show up as I have set them. If I refresh the page, though, they go away and so does the local file (I assume).

It's weird because the enabled font still comes up as selected in my list in the UI of font-your-face, however, it has lost its unique style and looks like plain text.

Is it possible to be something wrong with loading an .otf file into the .eot space? I figured this was the closest to an .eot ---- also, I tried font conversions from .otf to each of the available file types and none of them worked.

Finally -- I've come across half a dozen or so tutorials on how to install fonts manually regardless of what software you are building a website with, but I can't seem to wrap my head around how to place commands in the pages' < head > tag since there are no .html files generated by Drupal in cPanel.

Any support with this would be greatly appreciated.

sreynen’s picture

shiftymic, are you still having this problem with 6.x-2.5?

.otf and .eot are different formats, yes. That won't cause a problem until you're looking at it in a browser that only supports .eot, so older IE.

Adding fonts manually is more of a general Drupal question, better addressed at http://drupal.org/support

shiftymic’s picture

sreynen -- it only seems to be happening in Chrome -- I think I read somewhere you have to make chrome browser accept or recognize certain fonts or something rather odd in terms of what you would not expect from the Google team --- Anyways - the font does NOT go away in Firefox, so whatever it is about Chrome 5 must be the issue

also, I just noticed that they released @font-your-face 2.6, so maybe I will give that a try. reading up on the support page will probably help, too -- always hoping someone else has the quick-link though, as I'm sure you understand

sreynen’s picture

shiftymic, that sounds like a different problem. If you're still seeing it in 2.6, open a new issue.

Status: Fixed » Closed (fixed)

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

sreynen’s picture

Status: Closed (fixed) » Active

Apparently this is still happening. I marked #1183684: Cron still deleting local font. as a duplicate of this.

herve’s picture

Still happening on 6.x-2.6. Should we add a file_set_status calling after each file_save_upload calling?

Regards,

herve.

herve’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new921 bytes

I attach a patch. It just adds the file_set_status on fontyourface files, to avoid deletion on cron execution.

sreynen’s picture

Thanks, herve, patch looks great. I'll try to get that committed soon.

sreynen’s picture

Marked #1212042: Enabled fonts get overwritten by top font in list a duplicate of this. Pretty sure it's the same issue.

sreynen’s picture

Status: Patch (to be ported) » Fixed

#17 is committed. The whole local_fonts module still needs to be ported in #930066: Make it possible to include local installed fonts (local on the webserver), so there's no reason to leave this specific issue open waiting for a port.

juliavdw’s picture

Thank you for the patch, it solved my issue.

Status: Fixed » Closed (fixed)

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