Skip to content

Instantly share code, notes, and snippets.

@larsiusprime
Last active August 29, 2015 14:18
Show Gist options
  • Save larsiusprime/558e081f0e651ed1319e to your computer and use it in GitHub Desktop.
Save larsiusprime/558e081f0e651ed1319e to your computer and use it in GitHub Desktop.
OpenFL Text issues reproduction case.
package;
import openfl.text.TextField;
import openfl.display.Bitmap;
import openfl.display.BitmapData;
import openfl.display.Sprite;
import openfl.Assets;
import openfl.text.TextFormat;
class Main extends Sprite {
public function new () {
super ();
var t:TextField = new TextField();
t.defaultTextFormat = new TextFormat("papyrus.ttf",24);
t.text = "Good morning starshine, the earth says hello!";
t.width = 600;
t.x = 10;
t.y = 10;
t.autoSize = openfl.text.TextFieldAutoSize.LEFT;
t.multiline = false;
t.border = true;
trace("width = " + t.width);
trace("height = " + t.height);
trace("textWidth = " + t.textWidth);
trace("textHeight = " + t.textHeight);
t.textColor = 0xFFFF0000;
addChild(t);
}
}
<?xml version="1.0" encoding="utf-8"?>
<project>
<meta title="Displaying a Bitmap" package="org.openfl.samples.displayingabitmap" version="1.0.0" company="OpenFL" />
<app main="Main" path="Export" file="DisplayingABitmap" />
<!--toggle on/off as necessary-->
<set name="openfl-legacy" value="true"/>
<source path="Source" />
<haxelib name="openfl" />
<assets path="Assets" rename="assets" exclude="*.svg" />
<icon path="Assets/openfl.svg" />
</project>
@larsiusprime
Copy link
Author

Also, assets folder includes TIMES.TTF and PAPYRUS.TTF copied directly from windows font directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment