Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | Zapfino_italic_400.font_.js.txt | 152.06 KB | ransomweaver |
Comments
Comment #1
davideads CreditAttribution: davideads commentedPretty hard to say without more careful debugging. Feel free to contact me privately and I can take a look at your site.
Comment #2
luco CreditAttribution: luco commentednot 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?
Comment #3
luco CreditAttribution: luco commentedI 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.
Comment #4
paucku CreditAttribution: paucku commentedI 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?
Comment #5
ransomweaver CreditAttribution: ransomweaver commentedUpdate:
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.
Comment #6
luco CreditAttribution: luco commented@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
Comment #7
luco CreditAttribution: luco commentednah, scratch that. it's actually a lot simpler. don't rename the .font.js file. worked for me.
Comment #8
newbstah CreditAttribution: newbstah commentedUnchecking the "No thanks, use the font's own value" worked for me!
Comment #9
smscotten CreditAttribution: smscotten commentedI'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?
Comment #10
markwittens CreditAttribution: markwittens commentedI 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.
Comment #11
alfonso100 CreditAttribution: alfonso100 commentedCufon 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 _ )
Comment #12
renenee CreditAttribution: renenee commented#11, comment 2 worked for me. Thank you.
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commented#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*
Comment #14
hacmx CreditAttribution: hacmx commentedthanks this work for me, ;)
Comment #15
boreg CreditAttribution: boreg commentedAlso 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.
Comment #16
quinns CreditAttribution: quinns commentedThanks 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.
Comment #17
paskainos CreditAttribution: paskainos commentedThis 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.
Comment #18
MohammadMoussa-Lebanon CreditAttribution: MohammadMoussa-Lebanon commentedHi 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
Comment #19
alfonso100 CreditAttribution: alfonso100 commentedHi che_viva,
probably you should check that the font you are using suppors Arabic characters.
Comment #20
murpheus CreditAttribution: murpheus commentedCan 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 isNovecento_wide
Comment #21
markwittens CreditAttribution: markwittens commentedHave you tried removing the underscore from both the filename and the fontname?
Comment #22
Road Kill CreditAttribution: Road Kill commentedHere 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."
Comment #23
troky CreditAttribution: troky commentedFont detection routine changed in 6.x-1.x-dev.
Re-open issue if problem persists.
Comment #25
sander-martijn CreditAttribution: sander-martijn commentedcomment #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.
Comment #26
troky CreditAttribution: troky commented7.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).