EaselJSでWebフォントは使えるのか?

Webフォントの埋め込みに成功

by nekosmash

HTML

<script src="http://dl.dropbox.com/u/63305355/easeljs-0.4.2.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Audiowide' rel='stylesheet' type='text/css'>
<div id="wrapper">
<canvas></canvas>
</div>

CSS

html{
    min-height: 100%;
    overflow: auto;
    position:relative;
    z-index: 1;
}

body{
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow: auto;
    position: relative;
    z-index: 1;
}

#wrapper{
    height: auto;
    overflow: auto;
    position: fixed;
    z-index: 1;
    width: 100%;
    height:100%;
    min-height:100%;
}

canvas{
    position: fixed;
}

JavaScript

window.onload = function() {

    //canvasを拡げる
    $("canvas").attr({height:$("#wrapper").height()});
    $("canvas").attr({width:$("#wrapper").width()});

    //canvasにステージを用意
    var stage = new Stage($("canvas")[0]);

    //Textオブジェクトで読み込む    
    var text = new Text("Web Font Audiowide!","36px Audiowide", "#CCC");

    text.x = 0;
    text.y = $(window).height()/2;
    
    stage.addChild(text);

    
    stage.update();

}