how to use 2 cufon fonts at the same time?

129 views
Skip to first unread message

mish r

unread,
May 10, 2012, 12:01:20 PM5/10/12
to cufón
i have 2 language website, and cufon works great for h1 h2 h3... for
an english version.
so, the problem is for a 2nd language it wont show me h1 h2 h3 cause
there is no font for this language.
how can i disable cufon for a 2nd language, or maybe use another font
instead...

PS. 2 bad i can use only 1 template for both versions of the site.

Simo Kinnunen

unread,
May 19, 2012, 4:29:13 AM5/19/12
to cu...@googlegroups.com
Hi,

If you have a lang attribute in the <html> tag, you can target specific languages by changing the replace call's selector. If you had something like this:

Cufon.replace('h1')

it would become:

Cufon.replace('html[lang=en] h1')

which would only replace the element on the English version.

The best way however would be to not include Cufón at all for the other language. Even if you only have one template, maybe you can do something like this (using PHP as an example):

<?php if (get_template_language() === 'en'): ?>
<script src="cufon-yui.js"></script>
<script src="my.font.js"></script>
<script src="replace-calls.js"></script>
<?php endif; ?>

Of course, you would need to figure out how to access the information. For the example I simply made up the get_template_language() function.

Simo
> --
> You received this message because you are subscribed to the Google Groups "cufón" group.
> To post to this group, send email to cu...@googlegroups.com.
> To unsubscribe from this group, send email to cufon+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/cufon?hl=en.
>

Reply all
Reply to author
Forward
0 new messages