I got the same problem. And somehow i can't get Google webfont loader to work with ttf font (especially chinese fonts) or send a jquery response when font is loaded.
So I came up with this a more basic solution, useful when changing font dynamically after page is loaded. it shows when the font face is properly loaded.
First i create a dummy div and then fill it with 'abcd' and then give it a font size 40, record the width of the div. When the 'change font' event is invoked via a button or anything, it should track the dummy div width changes. Width changes would represent that the font has change.
HTML CODE
<style>
@font-face {
font-family: 'font1';
src:url('somefont.ttf') format('truetype');
}
</style>
<div id="dummy" style="border:1px solid #000; display:inline-block">abdc</div>
<!--simple button to invoke the fontchange-->
<input type="button" onclick="javascript:changefont('font1')" value="change the font"/>
JQuery
//create a variable to track initial width of default font
var trackwidth
//when change font is invoke
function changefont(newfont)
{
//reset dummy font style
$('#dummy').css('font-family','initial !important;');
$('#dummy').css({'font-size':'40px'});
$('#dummy').html('abcd');
//ensure that trackwidth is only recorded once of the default font
if(trackwidth==null)
{
trackwidth=( $('#dummy').width());
}
//apply new font
$('#dummy').css('font-family',newfont);
checkwidth()
}
function checkwidth()
{
//check if div width changed
if($('#dummy').width() == trackwidth)
{
//if div never change, detect again every 500 milisecs
setTimeout(checkwidth, 500);
}
else
{
//do something, font is loaded!
}
}