Reinstate embedded fonts (we need them for the rotated text, d'oh) but move to a...
authorRichard Fairhurst <richard@systemed.net>
Thu, 16 Jul 2009 15:30:05 +0000 (15:30 +0000)
committerRichard Fairhurst <richard@systemed.net>
Thu, 16 Jul 2009 15:30:05 +0000 (15:30 +0000)
28 files changed:
fonts/FontLibrary.as [new file with mode: 0644]
fonts/fonts/DejaVuSans-Bold.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSans-Bold.ttf with 100% similarity]
fonts/fonts/DejaVuSans-BoldOblique.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSans-BoldOblique.ttf with 100% similarity]
fonts/fonts/DejaVuSans-ExtraLight.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSans-ExtraLight.ttf with 100% similarity]
fonts/fonts/DejaVuSans-Oblique.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSans-Oblique.ttf with 100% similarity]
fonts/fonts/DejaVuSans.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSans.ttf with 100% similarity]
fonts/fonts/DejaVuSansCondensed-Bold.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSansCondensed-Bold.ttf with 100% similarity]
fonts/fonts/DejaVuSansCondensed-BoldOblique.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSansCondensed-BoldOblique.ttf with 100% similarity]
fonts/fonts/DejaVuSansCondensed-Oblique.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSansCondensed-Oblique.ttf with 100% similarity]
fonts/fonts/DejaVuSansCondensed.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSansCondensed.ttf with 100% similarity]
fonts/fonts/DejaVuSansMono-Bold.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSansMono-Bold.ttf with 100% similarity]
fonts/fonts/DejaVuSansMono-BoldOblique.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSansMono-BoldOblique.ttf with 100% similarity]
fonts/fonts/DejaVuSansMono-Oblique.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSansMono-Oblique.ttf with 100% similarity]
fonts/fonts/DejaVuSansMono.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSansMono.ttf with 100% similarity]
fonts/fonts/DejaVuSerif-Bold.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSerif-Bold.ttf with 100% similarity]
fonts/fonts/DejaVuSerif-BoldItalic.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSerif-BoldItalic.ttf with 100% similarity]
fonts/fonts/DejaVuSerif-Italic.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSerif-Italic.ttf with 100% similarity]
fonts/fonts/DejaVuSerif.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSerif.ttf with 100% similarity]
fonts/fonts/DejaVuSerifCondensed-Bold.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSerifCondensed-Bold.ttf with 100% similarity]
fonts/fonts/DejaVuSerifCondensed-BoldItalic.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSerifCondensed-BoldItalic.ttf with 100% similarity]
fonts/fonts/DejaVuSerifCondensed-Italic.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSerifCondensed-Italic.ttf with 100% similarity]
fonts/fonts/DejaVuSerifCondensed.ttf [moved from net/systemeD/halcyon/fonts/DejaVuSerifCondensed.ttf with 100% similarity]
halcyon_viewer.as
net/systemeD/halcyon/Map.as
net/systemeD/halcyon/POI.as
net/systemeD/halcyon/WayUI.as
net/systemeD/halcyon/styleparser/TextStyle.as
resources/FontLibrary.swf [new file with mode: 0644]

diff --git a/fonts/FontLibrary.as b/fonts/FontLibrary.as
new file mode 100644 (file)
index 0000000..7985ab5
--- /dev/null
@@ -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;
+
+       }
+
+}
index 36f7c50..df1a13a 100755 (executable)
@@ -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);
index 02229ff..09346c0 100755 (executable)
@@ -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);
index f1e6a50..ad0b40c 100644 (file)
@@ -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
                };
index 48a0efc..fe0527a 100755 (executable)
@@ -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;
index 056e87c..eb2b2a5 100644 (file)
@@ -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) {
diff --git a/resources/FontLibrary.swf b/resources/FontLibrary.swf
new file mode 100644 (file)
index 0000000..104c8c9
Binary files /dev/null and b/resources/FontLibrary.swf differ