I've followed the setup procedure; added cufon-yui.js to the cufon/js dir, created my .font.js and put in theme dir. settings/cufon shows my font in the pulldown menu. However if I create a selector it never changes my font. e.g <h1 class="title"> my title</h1> is not altered when h1.title as the selector. I don't see any of the cufon specific markup I've seen on sites where cufon is working (except for the page beginning <html class="js cufon-active". Any tips on getting this going? Drupal 6.12, php 5.2.6.

CommentFileSizeAuthor
#5 Zapfino_italic_400.font_.js.txt152.06 KBransomweaver
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

davideads’s picture

Pretty hard to say without more careful debugging. Feel free to contact me privately and I can take a look at your site.

luco’s picture

not good with me as well. I've uploaded the .font.js file in my theme's folder, but it won't even show up in the dropdown. any ideas?

luco’s picture

I got it.... installed the .font.js to sites/all/libraries . it's not the same in the readme and the project page, that got me confused.

paucku’s picture

I installed the .font.js in the sites/all/libraries and it shows up in the drop down in Cufon settings page. I select it and put these selectors there:

#node-4
#node-8

But the font didn't render for these specific pages. Do I write the selectors OK?

ransomweaver’s picture

Status: Active » Closed (fixed)
FileSize
152.06 KB

Update:

Turns out that the font I was using wasn't working. It successfully output a .font.js from the cufon generator, but it would just fail silently for that font. I had converted the font from .dfont to ttf using fondu, the cli font utility. I had success with a different font (not converted). BTW font.js that I put in sites/alll/libraries didn't appear for me in cufon settings.... Attached is the faulty font.js for anyone who is interested.

luco’s picture

@ransomweaver,

I've noticed that you can solve that in http://cufon.shoqolate.com/generate/ by scrolling down to "performance & file size" and unchecking "No thanks, use the font's own value" and supplying your own value (I left at 360 units/em).

hope this helps.

cheers,
Luciano

luco’s picture

nah, scratch that. it's actually a lot simpler. don't rename the .font.js file. worked for me.

newbstah’s picture

Unchecking the "No thanks, use the font's own value" worked for me!

smscotten’s picture

Version: 6.x-1.0-beta3 » 6.x-1.0-beta4
Status: Closed (fixed) » Active

I've got nothing happening here, too. It would be great if the instructions include what to put in the selector box. Do we need to include square brackets, or [style=xxxx] or any of that stuff? Or, as above, is it sufficient to put in "h1.title"? (without the quotes, of course)

After not getting results with two custom-generated fonts I fell back on using Vegur, the test font.

I'm not getting javascript errors or even notices. My fonts show up in the font-family select box. The only permissions I see to change are whether I can administer cufon.

Is there manual editing I'm supposed to do to my theme css files? Am I supposed to manually add the font javascript statements to my theme files?

markwittens’s picture

Version: 7.x-2.1 » 6.x-1.0-beta4
Status: Closed (fixed) » Active

I had the same problem Ransomweaver had but with 1 slight difference: I did not rename the font file.

The file that was generated was named Limerick-DemiBold_500.font.js and the name of the font-family on the settings page was "Limerick". This way Cufon can't find the font and won't replace anything.

I solved this by changing the font-family value in the generated js file to "limerick" but I think this is an issue in de Cufon module that should be resolved by loading the name of the font from the generated js file instead of deriving it from the file name.

alfonso100’s picture

Cufon module wasn't recognizing my .font.js file.
2 things solved my problem

1 - The cufon font files must be located at: sites/all/libraries/cufon-fonts
I've found this tip here: http://quinnsupplee.com/blog/quinn/02-04-2010/using-custom-fonts-cufon-a...

2 - as markwittens says: the .font.js filename must match the font-face statement inside the .js. If you open the font.js file you'll see:

Cufon.registerFont({"w":1217,"face":{"font-family":"Arial MT Bold".....
if the font file is called Arial_MT_Bold_400.font.js, it won't work, you have to make both names identical except for spaces (spaces are replaced by _ )

renenee’s picture

#11, comment 2 worked for me. Thank you.

Anonymous’s picture

#11 comment 2 worked for me too. Do people feel this is a bug or a new feature? I'd like to help try and resolve this but if it is a new feature and the new module maintainer is looking to do something along the lines of a rewrite for version 2 I wonder if it is worth trying to fix in the short term?

My thoughts for a quick fix are to stop it reading the filename to derive the font and pull the face object's font-family, font-weight and font-style (if there) to cover bold and italic/oblique. This should allow multiple font style/weight definitions per file which doesn't seem to be the case at present, but Cufon can cope with (E.G. font-name-bold, font-name-oblique). Is there anything else people think we would need?

Dave
*edited to clarify meaning of multiple font style definitions*

hacmx’s picture

thanks this work for me, ;)

boreg’s picture

Also make sure u have correct order of the javastripts. I spend hours finding why cuofn doesn't work on my Drupal site. Tried this module and custom scripts adding also. Nothing worked for me until i noticed, that there is wrong order of the scripts.
Suma sumarum: Make sure, that first is loaded cufon-yui.js, then YOURS.font.js and only afther these two u can define selectors with cufon.replace naturally.

quinns’s picture

Thanks for the blog post mention, #11!

I've found I can also put the cufon-fonts folder inside a specific theme folder. That way, the font will only be used by that theme and not by others (such as your admin theme). However, I've heard sometimes this might not work across all browsers.

paskainos’s picture

I solved this by changing the font-familiy value in the generated js file...

This worked for me too. Changing the generated js file to reflect name continuity - or in this case, font-inuity (I couldn't help it) - fixed the problem. Thanks @markwittens.

MohammadMoussa-Lebanon’s picture

Hi every body , i searched a lot but my problem is :
i have a website using cufon for English side and its working well , but when i propagate to the Arabic side all words disappear ,???
any solution

alfonso100’s picture

Hi che_viva,

probably you should check that the font you are using suppors Arabic characters.

murpheus’s picture

Can someone state precisely how the name were given for the file and the font-family. I've been battling with Novento font here and it doesn't seem to work.

The file name is Novecento_wide.font.js and the font-family within the file is Novecento_wide

markwittens’s picture

Have you tried removing the underscore from both the filename and the fontname?

Road Kill’s picture

Here are some selectors help anybody who has no idea what the selectors are.

h1

h2

h3

#admin-menu-wrapper

node-1p

If you are using superfish menu then you will want to use this selector for your menu #superfish-1 > li > a

"Cheers to all the vampires in the issue cue."

troky’s picture

Status: Active » Fixed

Font detection routine changed in 6.x-1.x-dev.

Re-open issue if problem persists.

Status: Fixed » Closed (fixed)

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

sander-martijn’s picture

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

comment #10 fixed it for me after hours of trying to figure out why my font wasn't applying. This should probably move into the documentation if it's not going to be fixed by code. Such an easy fix but no idea that it was causing the problem. I'm in 7 btw and it still exists, because of the way cufon generator names the fonts.

troky’s picture

7.x version doesn't extract font names from filenames but from font file contents. That logic is also ported to 6.x-1.0rc1

If something doesn't work please open new issue with exact problem (and fix if you have it).

Status: Active » Closed (fixed)