Every repository with this icon (
Every repository with this icon (
| Description: | Fast text replacement with canvas and VML - no Flash or images required. edit |
-
0 comments Created 3 months ago by sorccuImprove rendering quality by rendering baseline and ascent to full pixel valuesMilestone-1.1xRendering baseline + ascent to full pixel values would improve rendering quality significantly, especially at smaller font sizes.
Comments
-
0 comments Created 3 months ago by sorccuLow line-height values (less than 1.2em) are not supportedMilestone-1.1xFigure out whether there's something that can be done about it, preferably without too much trouble.
Comments
-
0 comments Created 3 months ago by sorccuBaseline of Cufónized text doesn't match that of regular textMilestone-1.1xPeople are using negative margins to cope with the issue. Would be better to just make it behave correctly.
Comments
-
0 comments Created 3 months ago by sorccuFeature requestx:hover doesn't work with gradientsMilestone-1.1xThere has been a request for :hover-enabled gradients and I think it's a good idea.
Comments
-
1 comment Created 5 months ago by dakotadouglasAbility to flip text (feature request)Feature requestxI'm not sure if it is on the list or not, but as a feature request, it would be nice to be able to flip the text via the replace either horizontally or vertically. This way you can create mirrors of the text and such.
Comments
-
0 comments Created 7 months ago by sorccuCorexBetter domready for Internet ExplorerFeature requestxInvestigate whether script defer would eliminate the need for Cufon.now() (unless you've got external scripts)
Comments
-
1 comment Created 7 months ago by sorccuRight-to-left and bidirectional textFeature requestx -
4 comments Created 7 months ago by WolfrNo support for :active and :focusFeature requestxThere is currently no support for the :visited, :active and :focus pseudoclasses.
Comments
:active and :focus do not work, but are you sure that :visited fails as well?
I didn't check. Bad assumption from my side here: since :active and :focus do not work I assumed :visited does not work either.
-
A widow in a header is a single word that wraps to the next line and is generally undesirable in typesetting. It would be great if cufon had an option you could switch that would prevent them from happening.
The easiest solution (as proposed here: http://groups.google.com/group/cufon/browse_thread/thread/58a39e5f5f143897?hl=en) seems to be putting the last two words in the same cufon-canvas span and applying the white-space:nowrap attribute on it. This way it will bring both words down.
Comments
As suggested by Dan, this can be done with a separate server- or client-side script that inserts a non-breaking space between the last two words.
This feature will probably be integrated into cufón sooner or later, but it's not a high priority at the moment.
-
Is there a way to wrap rendered text like "VeryLong-Word" after the hyphen? In HTML these words wrap like expected. But as soon as I render this text with cufon it won't wrap anymore.
Comments
-
Using Cufon replacing a h4:
Cufon.replace('h4', { fontFamily: 'Garamond' });Works fine.
But elsewhere on the page is a "special" h4, unlike the other ones on the page, it uses an image instead of cufon rendered text (for typographical reasons e.g. mixing 2 fonts).
The designer decided to move it offscreen so it can still be read by screen readers using position: absolute;. For safety he also decides to give it a font size of 0 so it isn't displayed
Consider the following CSS:
#demoCta h4 { font-size: 0; position: absolute; left: -9000px; }This results in the following JS error:
An invalid or illegal string was specified" code: "12
[Break on this error] g.scale(scale, scale * roundingFactor); (cufon.js line 794)I guess taking 0 as the input for
g.scale(scale, scale * roundingFactor);
is causing problems.
Comments
The best way would be to somehow prevent Cufón from replacing the heading, perhaps by giving it a class name and using :not(). Another possibility is to use font-size: 1px instead of 0. The easiest fix on our side would result in the text getting removed completely, which would probably be unwanted in most cases. Otherwise it would require some refactoring. I'm just not sure whether it's worth the trouble for an edge-case like this. Opinions?
I didn’t know about :not(), I guess you can use all jQuery selectors.
Posted this bug because there might have been an easy fix, I don't think it's necessary to provide support for an edge case like this if it involves quite some refactoring, especially not if the change would make Cufon slower.
Possible include in the documentation that font sizes cannot be zero (so as a general rule be careful when combining some image replacement techniques with cufon)
-
Bug: VML: script injection causes IE to fail on if (!document.namespaces)
2 comments Created 6 months ago by maranomynetIf your page contains a few images that delay the
window.onloadevent slightly, the following code will trigger the error:<script> var script = document.createElement('script') script.src = '/cufon.js'; document.body.appendChild(script); </script>This seems to be a known bug, with a really ugly workaround (see:
http://groups.google.com/group/Google-Maps-API/browse_thread/thread/3c63eb14c45fad9c)I wonder if one could avoid having the error occur at load time - by delaying the execution of the function checking the document.namespaces until the first time the user calls Cufon.replace...
...or doing try-catch with a
window.onloadfallback......just a thought.
Comments
An even more serious problem is probably the use of document.write(). While it would be possible to make cufon.js work without it, I don't really see the point. One possible use case may be loading cufon only for browsers that do not support @font-face, but you'd almost certainly experience a delay if you loaded cufon.js that way.
maranomynet
Mon Jul 20 09:01:17 -0700 2009
| link
I've added the
xmlns:v="urn:schemas-microsoft-com:vml"namespace attribute and a strict doctype - and my dynamically loaded Cufon init script works beautifully in IE when I browse between pages - but the font replacement does not occur when I hit Ctrl-R or the Reload button.It has me stumped at the moment. ...Arrr!
-
11 comments Created 5 months ago by rvwoensTest case neededxjs error: text undefined on Cufon.refreshUnconfirmedxI am using lightboxes with fancybox ( http://fancy.klade.lv/ ) and when popping up a box i need to refresh the cufon state because the texts within the thing were not visible before that.
So i did this:
$(document).ready(function() {
$("a#boxee").fancybox( { "overlayShow": true, "frameWidth": 780, "frameHeight": 575, "hideOnContentClick": false, "callbackOnShow": Cufon.refresh <-- should do the trick } ); });But i get a javascript error (firefox 3.0): text undefined in cufon, here:
textTransform: function(text, style) { return text[{ uppercase: 'toUpperCase', lowercase: 'toLowerCase' }[style.get('textTransform')] || 'toString'](); <--- text undefinedI've tested the callbackonshow using a simple alert and it IS firing after the popup is shown, so the moment is ok, but maybe there are some scoping issues here so i tried:
"callbackOnShow": function() { setTimeout(function() { Cufon.refresh(); },100); }instead. No success: same cufon error.
What's wrong here?
Comments
Hard to say without seeing the HTML. Do you have it online somewhere?
One possibility is that you're using a class name with the word "cufon" in it. If so, you're going to have to change the name.
I've made an example page for you. You can find it at:
http://www.makelaarsbasis.nl/cufontest/
After some more investigation, i found out that with IE7 it works correctly! It seems to be a firefox problem. Firefox on OSX (3.0.11) gives an error and the page hangs. Firefox on windows (latest update) does not give an error, but the page hangs here as well.
and no.. i have no other class named 'cufon'
Ok, I think I know what's going on:
There's a hidden (display: none) fancybox template (#popid7) on the page. This doesn't prevent it from being replaced however. Fancybox then retrieves the HTML of the template with jQuery's .html() and fills the "real" fancybox with it (not a very wise thing to do in my opinion). The problem is that Cufón injects an expando property to some of the elements it creates. These properties cannot be retrieved with .html() in all browsers, so they are simply lost and the internal structure breaks, causing the error.
I've never been too happy about the expando approach, I'll see if there's an easy way around it.
Sorccu, thanks for your quick response.
I've done some tests myself and found out that if I cufon.replace the text instead of cufon.refresh it, it works, but only for the first time the box is shown. If I start the popup for the second time cufon "magically" knows it did the replacement already and tries to do the refresh to no effect.So there seems to be some kind of cache or info-copy inside of cufon that keeps track of replaced elements. The best workaround would be if you could clear this cache somehow, or make cufon more robust so it can handle situations where the expando property is not there when the cache says it should be there and the other way around.
Another thing I noticed is that this can really crash firefox! After this error, I've seen firefox OSX crash several times. The windows version seems a bit more stable but strange things are happening under the hood.
Instead of adding expando properties you might consider adding a special "CufonReplaced" class to the object, the same way as Sifr does.
The issue isn't how to detect already replaced elements, but rather that the structure is broken. Expando properties are used by many, many scripts (including jQuery, MooTools and presumably most other frameworks as well), which is why it would be better to use DOM methods than .innerHTML. I don't really understand why they chose to go with .innerHTML.
I understand and i don't like the innerHTML method neither, but it is something that cufon should be able to handle somehow. You can't forbid other libs to use innerhtml. But a workaround with good documentation should be enough. If i have some spare time i'll take a look at the cufon code myself.
jasonseney
Wed Jun 24 12:52:07 -0700 2009
| link
Was able to get this working with simple modal by putting all the Cufon.replace calls after it is shown. Looks like the alt attribute in the DOM isn't being carried through between show/hide of the dialog box?
Example:
$("#results").modal({ opacity: 70, containerId: "dialogContainer", overlayId: "dialogOverlay", onShow: applyDialogFontRender }); function applyDialogFontRender() { if (typeof (Cufon) != "undefined" && Cufon != null) { Cufon.replace('#results h3', { fontFamily: fontFamily }); Cufon.replace('#results p', { fontFamily: fontFamily }); Cufon.replace('#results strong', { fontFamily: fontFamily }); } }Hope this helps someone!
@jasonseney Yep this works as I stated earlier. But when the user hides the popup and shows it AGAIN, the font is not visible any more. And the replace call in that case does not work any more. So this is not a solution.
jasonseney
Wed Jun 24 14:06:45 -0700 2009
| link
@rvwoens , sorry my solution was for simpleModal, which is probably a little different from fancybox? This works for me (will render on subsequent dialog popups). Maybe you'll need to write an un-render function that undoes cufon and then call the cufon.replace after that? Wish I could help more, might try to look at fancy box source when I have a chance.
@jasonseney well, an un-render or cufon-clear or cufon-reset function might come in handy here. As I said, a simple workaround would be sufficient. There is a large amount of js code out there and sometimes you just need to tweak things a bit. A few extra cufon calls might do the trick.
Make no mistake: I like cufon a lot, and it is already a much more reliable method than Sifr.
-
Support for common ligatures such as "fi" would be nice. Limited to those with their own unicode code points.
Comments
-
1 comment Created 4 months ago by jml26Cufón text doesn't change size if the user manually adjusts browser font sizeFeature requestxLooking at Cameron Moll's Cufón test page, I notice that in browsers such as Firefox and IE, if the user manually adjusts the font size in the browser, the line height increases but the font size of Cufón-rendered titles does not. In Safari and Chrome, the text doesn't change size but the line height and word spacing increases proportionally.
For accessibility and consistency, it would be nice if Cufón-rendered text could be resized along with the rest of the page.
Comments
Cameron's probably still using a rather old version of Cufón, which would explain the word-spacing issue. Other than that, I'm not sure how much of an issue it is - Firefox 3, Safari 4, Opera 9.5 and IE 7 use full-page zoom anyway which means that the text scales with the page (although it gets blurry in non-IE browsers because is in essence just an image).
-
2 comments Created 4 months ago by mummybotDifferent height across different browsersUnconfirmedxI have noticed a difference in height of the rendering of fonts in different browsers. I experimented with both Arial and Serena MTC.
The CSS settings are as follows:
font-size:9px (specified in ems)
line-height:1;The original computed height without Cufon is 20px;
After applying Cufon
1. Computed height 22px:
Firefox 3.5, Opera 9.6- Computed height 24px:
Internet Explorer 6,7,8, Safari 4, Chrome 2.0
When placing a background colour on the Cufon rendered span elements, there is a 1px bottom margin on the first list of browsers, and 2px bottom margin on the second list. This is causing slight layout discrepancies which when with two line text and small font sizes is quite noticable. Not such a problem for large single line headings.
Cheers,
mummybotComments
- Computed height 24px:
-
:hover state doesn't go away on menus with submenus
1 comment Created 4 months ago by koesbongI have a drop down menu with the main menu text cufon-ed, and then a :hover state of color change. the problem is that when hovering over a menu item, submenu drops down and if you move your mouse down the list and off the drop down, the :hover state on the cufon-ed text remains.
example can be seen here: http://koesbong.com/tcabc/
steps to reproduce:
1. mouse over "about"
2. move mouse to "our story"
3. move mouse further down out of the dropdown box
4. the menu item will still be yellow even though it's no longer on :hover
5. if you mouse over "about" again and then move the mouse up, it clears the :hover stateany thoughts?
thanks!
-koes
Comments
-
2 comments Created 7 months ago by sorccuCSS.ready() doesn't fire in Opera if an empty style sheet is usedCorexIf a completely empty style sheet (file size must be 0 bytes) is included with a LINK element, CSS.ready() will not recognize that it has loaded. Same goes for style sheets that return 404.
Comments
-
1 comment Created 4 months ago by sbeesoncufon in table, cell height is too tall?UnconfirmedxIn my table, without the h1 tag, everything looks fine. The cell and table height are correct. As soon as I add the h1 tag and it renders the text, it looks great, except that there is now a large white area above and below. I have tried setting CSS heights for the table, row, cell and h1 tag.
The text is an ASP:LABEL if this matters.
Comments
-
I'm experiencing the following issue: I do a Cufon.replace('h1'); and everything works fine. However, on one page I have a radio button which when clicked does a few things. Once I added Cufon, I started to get a series of javascript errors on this radio button click. I did a little debugging and tracked it down to the following code, which gets triggered on click:
function setDefaultSeasonSelected() {
var radioBtns = $(".seasonListing :radio"); alert("setDefaultSeasonSelected"); if ( radioBtns.filter(":checked").length == 0 ){ radioBtns.filter(":enabled").eq(0).attr("checked", "checked"); } alert("setDefaultSeasonSelected2");}
I put those alerts in there for testing, and what I see is this -- I get a javascript error, "Failed," then the first alert, then "undefined is null or not an object," then my script terminates, never popping the second alert.
Note that the radio buttons the above code is looking for are added dynamically to the DOM prior to the above code being executed.
If I remove Cufon from my page, everything works fine. When Cufon is added, the above code breaks. It looks like jquery can no longer find the $(".seasonListing :radio") when Cufon is included. This code works fine in Firefox 3 but fails in IE6 and 7. Any ideas?
Comments
Update -- changing
var radioBtns = $(".seasonListing :radio");
to
var radioBtns = $(".seasonListing input:radio");
seems to have fixed the problem.
Hi,
This may be related to issue #1, but it should have been fixed a long time ago. Are you sure that you're using at least a fairly recent version of Cufón? Newer versions are fully backwards compatible, so you should be able to upgrade to 1.02 without any issues.
By the way, did you use gradients or text shadows?
Simo
I ran into a similar issue using a very recent version of Cufon. I found this with IE6 and just wound up disabling Cufon in IE6. I didn't wind up tracing the issue down in the JS, so I'm not sure if it's the exact same issue, but I did have conflicts.
Real IE6 or MultipleIE? Did you use text shadows or gradients?
I can't do it now, but I can try to get more information for you in a few days time.
Sorccu, I'm not sure which version I have but I grabbed it off of the Cufon website 2 or 3 weeks ago, so it is very recent. In my debugging, I thought perhaps it was something to do with the YUI compressed version (perhaps there were function name conflicts with other YUI compressed scripts I had), so I tried the uncompressed version here on GitHub just yesterday and still saw the problem. I see it in IE6 (MultipleIEs) and IE7.
A test case would really help.. do you think you could PM me the url?
-
If cufon is used to style an element that has child elements a spacer is created between the elements. This only occurs when there is text between the elements in the source code.
For example:
This renders correctly.
<ul><li>First Item</li><li>Second Item</li></ul>
This renders incorrectly.
<ul>
<li>First Item</li>
<li>Second Item</li>
</ul>
Possible solution is to test the element type before replacing the child within the replaceElement() function.
612c612
< if (anchor) {
> if (anchor && type != 1) {
Comments
-
3 comments Created 3 months ago by pixelburpIssue: Cufon.js blocked by firewall (Sonicwall)UnconfirmedxCufon doesn't work behind certain firewalls (our design agency uses Sonicwall, can't confirm other firewall software).
Opening the .js file directly in the browser, it loads some of the file but then the connection is interrupted / file loading is cancelled. I suspect it might be the firewall flagging a suspicious routine / function & black-listing the .js file. An issue with the calls?
Comments
Is it cufon(-yui).js or the .font.js that's causing trouble? If it's the font file, did you use the domain restriction feature? Where does the loading stop?
The .font.js opens fine & there's no problem there; the cufon(-yui).js is the one causing trouble.
It appears to stop loading in the function "renderText" & around the code block:
g.beginPath();
if (glyph.code) interpret(glyph.code, g);
else glyph.code = generateFromVML('m' + glyph.d, g);
g.fill();( Sorry, I can't be more specific than that as I have to manually cancel the .js loading before the browser throws up a "Connection Interrupted" page. )
This is probably wishful thinking but do you by any chance have access to SonicWall's logs? If not, could you perhaps click through the following links and let me know which ones do not load? Each file contains 50 rows of the latest cufon.js:
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-aa.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ab.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ac.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ad.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ae.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-af.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ag.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ah.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ai.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-aj.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ak.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-al.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-am.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-an.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ao.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ap.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-aq.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ar.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-as.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-at.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-au.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-av.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-aw.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ax.js
http://cufon.shoqolate.com/tests/sonicwall/split-50/cufon-ay.jsThanks.
-
When applied to a span inside a button element (sliding doors button) Firefox somehow ignores the hover attribute. It works in both Safari and IE but not with Firefox.
Comments
-
Cufon renders blurry in IE 6,7,8. Works fine in FF & Safari.
2 comments Created 2 months ago by jannisgFor some reason Cufon seems to render blurry in Internet Explorer.
The same site & code renders perfectly sharp in Firefox and Safari.Here are some screenshots:
Firefox rendering: http://img41.imageshack.us/img41/1552/cufonff.png
Internet Explorer 8.0 rendering: http://img5.imageshack.us/img5/2007/cufonie.pngNot sure what's going on here.
For code and such have a look at the site at: http://supply.demand.co.nz/_areyouexcited_site/Thanks.
JannisComments
questioneer
Sun Nov 29 08:04:42 -0800 2009
| link
Can't access the site.
the dev link has been taken down. please visit the live site that still is experiencing this issue at: www.areyouexcited.com
Thanks for taking a look,
J, -
I've discovered a weird bug with the hover option on safari.
Comments
Hmm.. do you think you could send the URL to me in a private message?
Yeah GitHub ate your youtube link but what I meant was the URL of your site :) If possible, I'd like to test it myself.
-
Add support for combining characters
0 comments Created about 1 month ago by WolfgangHGCombining characters like 0x035C (Combining double breve below) and
0x361 (combining double inverted breve) is not supported.See here for more details: http://groups.google.com/group/cufon/browse_thread/thread/87d48b7e924590e7
Comments
-
Better graphic rendering in smaller font sizes
0 comments Created about 1 month ago by webb-widEven with rounded up/down pixels in the inline attributes to the canvas tag, the font still renders a bit fuzzy in when you get to smaller fonts (ie... even at 14 px, the font appears to be a bit fuzzy)
Comments
-
1 comment Created 15 days ago by adoroHTML Entity Pound Symbol / Character does not show in replaced textUnconfirmedx -
Zoom hover problem with Cufon text in Safari and Chrome
0 comments Created 15 days ago by RosieIn Safari (4.0.3) and Chrome (3.0.195.33), on zooming in, hovering over cufon text enlarges (doubles?) the font size of the text. The text remains enlarged even after zooming out, and the text size is only restored if the page is reloaded. Any clues?
Comments
-
Comment Elements gets replaced as empty cufon elements.
0 comments Created 14 days ago by furusystemsFor some weird reason sometimes a comment element in a targeted replace element
get's replaced with an empty cufon canvas.See the picture in the left element it has an comment element at the start of the div.
And the title in the left starts a bit lower, cause there is an empty cufon element there.

Attached is a zip of the example link
Comments
-
Cufón is inaccessible with Voiceover (built-in Mac screenreader)
0 comments Created 12 days ago by bramdIt seems that Cufón rendered text is not accessible for the Voiceover screenreader in the Safari webbrowser. Check the headings at http://www.jijmaaktgeschiedenis.nu/ for an inaccessible example. The headings are represented by Voiceover as "image text, image text" etc.
With the Jaws for windows screenreader, this is accessible, so it seems a browser/screenreader specific issue.Comments
-
When using multiple lists and hover states the 'parent' Cufon style replaces the child. In the following example, when you hover the Second Level link it will be replaced by a different weight.
Is there an option I can set so that the nested style stays the same or is this a bug/limitation within Cufon?
<ul> <li><a href="#">Top Level</a></li> <li><a href="#">Top Level</a></li> <li><a href="#">Top Level</a><ul> <li><a href="#">Second Level</a></li> <li><a href="#">Second Level</a></li> <li><a href="#">Second Level</a></li> </ul> <li><a href="#">Top Level</a></li> <li><a href="#">Top Level</a></li> </ul> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="http://github.com/sorccu/cufon/raw/master/js/cufon.js"></script> <script type="text/javascript" src="http://github.com/sorccu/cufon/raw/master/fonts/Vegur.font.js"></script> <script type="text/javascript"> Cufon.replace('ul li a',{hover: true, fontWeight: 200}); Cufon.replace('ul li ul a',{hover: true, fontWeight: 700}); </script>Thanks,
Comments
deplorableword
Tue Dec 01 05:14:02 -0800 2009
| link
Issue was with the selectors here is the fix:
//selects only 1st level links Cufon.replace('ul:has(ul) > li a', { hover: true, fontWeight: 200}); //selects only 2nd level links Cufon.replace('ul:not(:has(ul)) a', { hover: true, fontWeight: 700});
- 3rd-party▾
- Canvas▾
- Core▾
- Duplicate▾
- Feature request▾
- Generator▾
- Gotcha▾
- Invalid▾
- Milestone-1.1▾
- Milestone-1.2▾
- Old version▾
- Test case needed▾
- Unable to reproduce▾
- Unconfirmed▾
- VML▾
- Works as expected▾
- Apply to Selection
-
Change Color…
Preview:preview
- Rename…
- Delete











