callback function for Cufon?

419 views
Skip to first unread message

Ian

unread,
Jun 18, 2010, 4:07:25 AM6/18/10
to cufón
Hi all. Is there a way to excecute a function right after Cufon has
finish replacing all fonts?

Simo Kinnunen

unread,
Jun 18, 2010, 9:17:27 AM6/18/10
to cu...@googlegroups.com
Hi,

Sort of. If you put Cufon.CSS.ready(function() { .. }) right after all
the .replace() calls you have, the function will be called immediately
after everything's been replaced (for the first time).

Simo

On Fri, Jun 18, 2010 at 11:07 AM, Ian <ian....@gmail.com> wrote:
> Hi all. Is there a way to excecute a function right after Cufon has
> finish replacing all fonts?
>

> --
> 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.
>
>

Ian

unread,
Jun 18, 2010, 9:59:47 AM6/18/10
to cufón
Thank you! I see.

Zimmen

unread,
Jun 21, 2010, 5:40:25 AM6/21/10
to cufón
Hmm, for some reason the Cufon.CSS.ready callback is called before
replacement is done in webkit-based browsers (Safari and Chrome).
I am using this callback to resize an iFrame (yeah ...i know) after
replacement has been done because replacing text alters the height of
the document. When i place an alert in this resize function that is
called when Cufon.CSS.ready occurs, i can see that the replacement has
not been done until i dismiss the alert.

Is there no other way to be 100% sure replacement is done? is there a
better "ready" callback or a public status property in the API that i
can check against using a timer?



On Jun 18, 3:17 pm, Simo Kinnunen <sor...@gmail.com> wrote:
> Hi,
>
> Sort of. If you put Cufon.CSS.ready(function() { .. }) right after all
> the .replace() calls you have, the function will be called immediately
> after everything's been replaced (for the first time).
>
> Simo
>

Simo Kinnunen

unread,
Jun 21, 2010, 3:32:45 PM6/21/10
to cu...@googlegroups.com
Hi,

They should fire in correct order in all browsers as long as the replace calls are made first.

Do you have an example?

Simo

Reply all
Reply to author
Forward
0 new messages