Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reinstate embedded fonts (we need them for the rotated text, d'oh) bu…

…t move to a separate SWF so that they will hopefully be cached by the browser
  • Loading branch information...
commit b7fb5dccb0f17ee174e7ec11062ee8b5ba44c301 1 parent d503a1f
@systemed authored
Showing with 25 additions and 9 deletions.
  1. +9 −0 fonts/FontLibrary.as
  2. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSans-Bold.ttf
  3. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSans-BoldOblique.ttf
  4. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSans-ExtraLight.ttf
  5. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSans-Oblique.ttf
  6. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSans.ttf
  7. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSansCondensed-Bold.ttf
  8. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSansCondensed-BoldOblique.ttf
  9. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSansCondensed-Oblique.ttf
  10. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSansCondensed.ttf
  11. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSansMono-Bold.ttf
  12. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSansMono-BoldOblique.ttf
  13. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSansMono-Oblique.ttf
  14. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSansMono.ttf
  15. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSerif-Bold.ttf
  16. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSerif-BoldItalic.ttf
  17. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSerif-Italic.ttf
  18. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSerif.ttf
  19. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSerifCondensed-Bold.ttf
  20. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSerifCondensed-BoldItalic.ttf
  21. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSerifCondensed-Italic.ttf
  22. 0  {net/systemeD/halcyon → fonts}/fonts/DejaVuSerifCondensed.ttf
  23. +1 −1  halcyon_viewer.as
  24. +11 −2 net/systemeD/halcyon/Map.as
  25. +1 −1  net/systemeD/halcyon/POI.as
  26. +1 −3 net/systemeD/halcyon/WayUI.as
  27. +2 −2 net/systemeD/halcyon/styleparser/TextStyle.as
  28. BIN  resources/FontLibrary.swf
View
9 fonts/FontLibrary.as
@@ -0,0 +1,9 @@
+package {
+ import flash.display.Sprite;
+ public class FontLibrary extends Sprite {
+ [Embed(source="fonts/DejaVuSans.ttf", fontFamily="DejaVu", fontWeight="normal", mimeType="application/x-font-truetype")]
+ public static var DejaVu:Class;
+
+ }
+
+}
View
0  net/systemeD/halcyon/fonts/DejaVuSans-Bold.ttf → fonts/fonts/DejaVuSans-Bold.ttf
File renamed without changes
View
0  ...systemeD/halcyon/fonts/DejaVuSans-BoldOblique.ttf → fonts/fonts/DejaVuSans-BoldOblique.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSans-ExtraLight.ttf → fonts/fonts/DejaVuSans-ExtraLight.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSans-Oblique.ttf → fonts/fonts/DejaVuSans-Oblique.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSans.ttf → fonts/fonts/DejaVuSans.ttf
File renamed without changes
View
0  ...stemeD/halcyon/fonts/DejaVuSansCondensed-Bold.ttf → fonts/fonts/DejaVuSansCondensed-Bold.ttf
File renamed without changes
View
0  ...halcyon/fonts/DejaVuSansCondensed-BoldOblique.ttf → fonts/fonts/DejaVuSansCondensed-BoldOblique.ttf
File renamed without changes
View
0  ...meD/halcyon/fonts/DejaVuSansCondensed-Oblique.ttf → fonts/fonts/DejaVuSansCondensed-Oblique.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSansCondensed.ttf → fonts/fonts/DejaVuSansCondensed.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSansMono-Bold.ttf → fonts/fonts/DejaVuSansMono-Bold.ttf
File renamed without changes
View
0  ...emeD/halcyon/fonts/DejaVuSansMono-BoldOblique.ttf → fonts/fonts/DejaVuSansMono-BoldOblique.ttf
File renamed without changes
View
0  ...systemeD/halcyon/fonts/DejaVuSansMono-Oblique.ttf → fonts/fonts/DejaVuSansMono-Oblique.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSansMono.ttf → fonts/fonts/DejaVuSansMono.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSerif-Bold.ttf → fonts/fonts/DejaVuSerif-Bold.ttf
File renamed without changes
View
0  ...systemeD/halcyon/fonts/DejaVuSerif-BoldItalic.ttf → fonts/fonts/DejaVuSerif-BoldItalic.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSerif-Italic.ttf → fonts/fonts/DejaVuSerif-Italic.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSerif.ttf → fonts/fonts/DejaVuSerif.ttf
File renamed without changes
View
0  ...temeD/halcyon/fonts/DejaVuSerifCondensed-Bold.ttf → fonts/fonts/DejaVuSerifCondensed-Bold.ttf
File renamed without changes
View
0  ...halcyon/fonts/DejaVuSerifCondensed-BoldItalic.ttf → fonts/fonts/DejaVuSerifCondensed-BoldItalic.ttf
File renamed without changes
View
0  ...meD/halcyon/fonts/DejaVuSerifCondensed-Italic.ttf → fonts/fonts/DejaVuSerifCondensed-Italic.ttf
File renamed without changes
View
0  net/systemeD/halcyon/fonts/DejaVuSerifCondensed.ttf → fonts/fonts/DejaVuSerifCondensed.ttf
File renamed without changes
View
2  halcyon_viewer.as
@@ -27,7 +27,7 @@ package {
t.multiline=true;
addChild(t);
Globals.vars.debug=t;
- t.visible = true;
+ t.visible = false;
theMap = new Map(this.loaderInfo.parameters);
theMap.updateSize(stage.stageWidth, stage.stageHeight);
View
13 net/systemeD/halcyon/Map.as
@@ -2,11 +2,13 @@ package net.systemeD.halcyon {
import flash.text.TextField;
import flash.display.DisplayObjectContainer;
+ import flash.display.Loader;
import flash.display.Sprite;
import flash.display.Shape;
import flash.display.Stage;
import flash.display.BitmapData;
import flash.display.LoaderInfo;
+ import flash.text.Font;
import flash.utils.ByteArray;
import flash.events.*;
import flash.net.*;
@@ -99,7 +101,6 @@ package net.systemeD.halcyon {
connection.addEventListener(Connection.NEW_WAY, newWayCreated);
connection.addEventListener(Connection.NEW_POI, newPOICreated);
connection.getEnvironment(new Responder(gotEnvironment,connectionError));
-
}
private function getPaintSprite():Sprite {
@@ -109,6 +110,15 @@ package net.systemeD.halcyon {
}
public function gotEnvironment(r:Object):void {
+ var loader:Loader = new Loader();
+ loader.contentLoaderInfo.addEventListener(Event.COMPLETE, gotFont);
+ loader.load(new URLRequest("FontLibrary.swf"));
+ }
+
+ public function gotFont(r:Event):void {
+ var FontLibrary:Class = r.target.applicationDomain.getDefinition("FontLibrary") as Class;
+ Font.registerFont(FontLibrary.DejaVu);
+
if (initparams.hasOwnProperty('lat')) {
// parameters sent from HTML
init(initparams['lat'],
@@ -311,7 +321,6 @@ package net.systemeD.halcyon {
}
public function mouseUpHandler(event:MouseEvent):void {
-addDebug("up");
if (!dragging) { return; }
dragging=false;
updateCoords(x,y);
View
2  net/systemeD/halcyon/POI.as
@@ -18,7 +18,7 @@ package net.systemeD.halcyon {
private var iconname:String=''; // name of icon
public static const DEFAULT_TEXTFIELD_PARAMS:Object = {
- embedFonts: true,
+// embedFonts: true,
antiAliasType: AntiAliasType.ADVANCED,
gridFitType: GridFitType.NONE
};
View
4 net/systemeD/halcyon/WayUI.as
@@ -29,8 +29,6 @@ package net.systemeD.halcyon {
antiAliasType: AntiAliasType.ADVANCED,
gridFitType: GridFitType.NONE
};
-// [Embed(source="fonts/DejaVuSans.ttf", fontFamily="DejaVu", fontWeight="normal", mimeType="application/x-font-truetype")]
-// public static var DejaVu:Class;
public var nameformat:TextFormat;
@@ -316,10 +314,10 @@ package net.systemeD.halcyon {
private function rotatedLetter(char:String, t:Number, w:Number, h:Number, a:Number, o:Number):TextField {
var tf:TextField = new TextField();
- tf.embedFonts = true;
tf.mouseEnabled = false;
tf.mouseWheelEnabled = false;
tf.defaultTextFormat = nameformat;
+ tf.embedFonts = true;
tf.text = char;
tf.width = tf.textWidth+4;
tf.height = tf.textHeight+4;
View
4 net/systemeD/halcyon/styleparser/TextStyle.as
@@ -23,7 +23,7 @@ package net.systemeD.halcyon.styleparser {
public var sublayer:uint=0;
public function getTextFormat():TextFormat {
- return new TextFormat(font_name ? font_name : "_sans",
+ return new TextFormat(font_name ? font_name : "DejaVu",
text_size ? text_size : 8,
text_colour ? text_colour: 0,
font_bold ? font_bold : false,
@@ -41,7 +41,7 @@ package net.systemeD.halcyon.styleparser {
var tf:TextField = new TextField();
var n:TextFormat = getTextFormat();
n.align = "center";
-// tf.embedFonts = true;
+ tf.embedFonts = true;
tf.defaultTextFormat = n;
tf.text = a;
if (text_width) {
View
BIN  resources/FontLibrary.swf
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.