flash on 2010-4-14
/**
* Copyright uwi ( http://wonderfl.net/user/uwi )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/4hLG
*/
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.utils.getTimer;
import flash.text.TextFormat;
import org.papervision3d.typography.*;
import org.papervision3d.typography.fonts.*;
public class Test extends Sprite {
private var _tf : TextField;
public function Test() {
_tf = new TextField();
addChild(_tf);
var s : int = getTimer();
var motif : Array = new HelveticaBold().motifs["m"];
graphics.lineStyle(2, 0);
for each(var m : Array in motif){
switch (m[0])
{
case "M":
graphics.moveTo(m[1][0], m[1][1]);
break;
case "L":
graphics.lineTo(m[1][0], m[1][1]);
break;
case "C":
graphics.curveTo(m[1][0], m[1][1], m[1][2], m[1][3]);
break;
}
}
/*
var vl : VectorLetter3D = new VectorLetter3D("a", new Letter3DMaterial(0x000000), new HelveticaLight());
vl.width = 100;
vl.height = 100;
for each(var v : Vertex3D in vl.geometry.vertices){
v.vertex3DInstance.visible = true;
}
graphics.lineStyle(2, 0);
for each(var gc : IVectorShape in vl.graphicsCommands){
gc.draw(graphics, true);
}
tr(vl.graphicsCommands);
*/
var g : int = getTimer();
tr((g - s) + " ms");
}
private function tr(...o : Array) : void
{
_tf.appendText(o + "\n");
}
}
}