You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2015/07/28 20:40:41 UTC

[15/36] git commit: [flex-asjs] [refs/heads/develop] - add font files to build scripts

add font files to build scripts


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/44ebb493
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/44ebb493
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/44ebb493

Branch: refs/heads/develop
Commit: 44ebb493b497a6f745838978b7112b00f1abac33
Parents: a2c39e7
Author: Alex Harui <ah...@apache.org>
Authored: Fri Jul 17 13:00:51 2015 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Fri Jul 17 13:00:51 2015 -0700

----------------------------------------------------------------------
 examples/build_example.xml               |  5 ++
 frameworks/build.xml                     |  7 ++-
 frameworks/downloads.xml                 | 44 ++++++++++++-
 frameworks/fontsrc/FlatUIIcons.as        | 24 +++++++
 frameworks/fontsrc/build.xml             | 91 +++++++++++++++++++++++++++
 frameworks/projects/HTML/as/defaults.css |  4 +-
 6 files changed, 170 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/examples/build_example.xml
----------------------------------------------------------------------
diff --git a/examples/build_example.xml b/examples/build_example.xml
index c3ab330..a8a5973 100644
--- a/examples/build_example.xml
+++ b/examples/build_example.xml
@@ -61,6 +61,11 @@
                 <include name="**/*.jpg" />
             </fileset>
         </copy>
+        <copy todir="${basedir}/bin-debug/fonts">
+            <fileset dir="${FLEX_HOME}/frameworks/fonts">
+                <include name="**/*.swf" />
+            </fileset>
+        </copy>
     </target>
     
     <target name="compileair" description="Compiles ${example}">

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index 70ffa3e..0dafc4e 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -60,7 +60,7 @@
     <property file="${FLEXJS_HOME}/build.properties"/>
     <property name="FLEX_HOME" value="${FLEXJS_HOME}" />
  
-    <target name="main" depends="check-compile-env,clean,prepare,compile" 
+    <target name="main" depends="check-compile-env,clean,prepare,compile,fonts"
         description="Clean build of all SWCs"/>
 
     <target name="check-compile-env" description="Check for the required environment variables">
@@ -150,6 +150,10 @@
 
     <target name="js" depends="compile-asjs, lint-js" />
     
+    <target name="fonts">
+        <ant dir="${basedir}/fontsrc" target="main"/>
+    </target>
+    
     <target name="other.locales" description ="Builds resource SWCs for all locales">
         <!--<ant dir="${basedir}/projects/FlexJSUI" target="other.locales"/>-->
     </target>
@@ -185,6 +189,7 @@
         <ant dir="${basedir}/projects/JQuery" target="clean"/>
         <ant dir="${basedir}/projects/Mobile" target="clean"/>
         <ant dir="${basedir}/projects/Network" target="clean"/>
+        <ant dir="${basedir}/fontsrc" target="clean"/>
 
         <!-- delete the FlashBuilder executable directories -->
         <delete includeemptydirs="true" failonerror="false">

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/downloads.xml
----------------------------------------------------------------------
diff --git a/frameworks/downloads.xml b/frameworks/downloads.xml
index 77b99b2..0a3ee07 100644
--- a/frameworks/downloads.xml
+++ b/frameworks/downloads.xml
@@ -32,12 +32,12 @@
        clean does not remove these since they don't change often and the downloads take time.
     -->
     <target name="main" 
-        depends="swfobject-download" 
+        depends="swfobject-download,flat-ui-download"
         description="Copies third-party software into place for build">
         <echo message="Use thirdparty-clean or super-clean to remove these."/> 
     </target>
     
-    <target name="clean" depends="swfobject-clean" 
+    <target name="clean" depends="swfobject-clean,flat-ui-clean"
         description="Cleans thirdparty downloaded files.">
      </target>
     
@@ -77,4 +77,44 @@
         </delete>
     </target>
         
+    <!-- swfobject.js (Version 2.2) -->
+    <!-- Because this requires a network connection it downloads SWFObject only if it doesn't already exist. -->
+    <target name="flat-ui-check" description="Checks if SWFObject has been downloaded.">
+        <available file="${FLEXJS_HOME}/frameworks/fonts/flat-ui-icons-regular.ttf" property="flat-ui.present"/>
+    </target>
+    
+    <target name="flat-ui-download" depends="flat-ui-check" unless="flat-ui.present"
+        description="Copies FlatUI from github">
+        
+        <mkdir dir="${download.dir}"/>
+        <get src="https://github.com/designmodo/Flat-UI/archive/2.2.2.zip"
+        dest="${download.dir}/flat-ui_2_2.zip"
+        verbose="false"/>
+        
+        <mkdir dir="${FLEXJS_HOME}/frameworks/fonts"/>
+        <unzip src="${download.dir}/flat-ui_2_2.zip" dest="${FLEXJS_HOME}/frameworks/fonts">
+            <patternset>
+                <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.eot"/>
+                <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.ttf"/>
+                <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.svg"/>
+                <include name="Flat-UI-2.2.2/fonts/glyphicons/flat-ui-icons-regular.woff"/>
+            </patternset>
+            <flattenmapper />
+        </unzip>
+        <unzip src="${download.dir}/flat-ui_2_2.zip" dest="${FLEXJS_HOME}/frameworks/fonts">
+            <patternset>
+                <include name="Flat-UI-2.2.2/README.md"/>
+            </patternset>
+            <flattenmapper />
+        </unzip>
+    </target>
+    
+    <target name="flat-ui-clean" description="Deletes flat-ui fonts.">
+        <delete failonerror="false">
+            <fileset dir="${FLEXJS_HOME}/frameworks/fonts">
+                <include name="**"/>
+            </fileset>
+        </delete>
+    </target>
+        
 </project>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/fontsrc/FlatUIIcons.as
----------------------------------------------------------------------
diff --git a/frameworks/fontsrc/FlatUIIcons.as b/frameworks/fontsrc/FlatUIIcons.as
new file mode 100644
index 0000000..014899e
--- /dev/null
+++ b/frameworks/fontsrc/FlatUIIcons.as
@@ -0,0 +1,24 @@
+package
+{
+import flash.display.Sprite;
+import flash.text.Font;
+
+public class FlatUIIcons extends Sprite
+{
+	 /* 
+      * Embed a font with bold typeface by location. 
+      */
+     [Embed(source='../fonts/flat-ui-icons-regular.ttf', 
+        fontWeight='normal', 
+        fontName='Flat-UI-Icons', 
+        mimeType='application/x-font', 
+        embedAsCFF='false'
+     )] 
+     private var font2:Class;
+
+	public function FlatUIIcons()
+	{
+		Font.registerFont(font2);
+	}
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/fontsrc/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/fontsrc/build.xml b/frameworks/fontsrc/build.xml
new file mode 100644
index 0000000..149021f
--- /dev/null
+++ b/frameworks/fontsrc/build.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+<!--
+
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+-->
+
+<!-- Note:
+    If you modify this file you may have to make the same change in build_framework.xml.
+    build_framework.xml is renamed to build.xml when it is packaged.
+    It is used to build the frameworks directory from the zip file. 
+-->
+<project name="fonts" default="main" basedir=".">
+
+    <property name="FLEXJS_HOME" location="../.."/>
+
+    <!-- Required for OSX 10.6 / Snow Leopard Performance. -->
+    <!-- Java 7 on Mac requires OSX 10.7.3 or higher and is 64-bit only -->
+    <!-- local.d32 is set/used in build.properties so this needs to be done first. -->
+    <condition property="local.d32" value="-d32">
+        <and>
+            <os family="mac"/>
+            <matches pattern="1.6.*" string="${java.version}"/>
+            <equals arg1="${sun.arch.data.model}" arg2="64"/>
+            <equals arg1="${os.arch}" arg2="x86_64"/>
+        </and>
+    </condition>
+
+    <!-- Property for the platform.  -->
+    <condition property="isMac">
+        <os family="mac"/>
+    </condition>
+    <condition property="isWindows">
+        <os family="windows" />
+    </condition>   
+    <condition property="isLinux">
+        <and>
+          <os family="unix"/>    
+          <not>
+            <os family="mac"/>    
+          </not>
+        </and>
+    </condition>  
+
+    <property file="${FLEXJS_HOME}/env.properties"/>
+    <property environment="env"/>
+    <property file="${FLEXJS_HOME}/build.properties"/>
+ 
+    <target name="main" depends="check-compile-env,compile"
+        description="Create font swfs"/>
+
+    <target name="check-compile-env" description="Check for the required environment variables">
+        <ant antfile="${FLEXJS_HOME}/build.xml" target="check-compile-env" dir="${FLEXJS_HOME}"/>
+    </target>
+    
+    <target name="compile" depends="prepare" description="Builds all font swfs">
+        <!-- order may matter due to dependencies -->
+        <antcall target="flat-ui-icons"/>
+    </target>
+    
+    <target name="flat-ui-icons" description="build flat-ui-icons-regular.swf">
+        <java fork="true"
+            jar="${FLEX_SDK_HOME}/lib/mxmlc.jar">
+            <jvmarg line="${mxmlc.jvm.args}"/>
+            <arg value="+flexlib=${FLEX_SDK_HOME}/frameworks" />
+            <arg value="-output=${basedir}/../fonts/flat-ui-icons-regular.swf" />
+            <arg value="${basedir}/FlatUIIcons.as" />
+        </java>
+    </target>
+
+    <target name="prepare">
+        <property name="FLEX_SDK_HOME" value="${env.FLEX_HOME}" />
+    </target>
+    
+    <target name="clean">
+        <delete file="${basedir}/../fonts/flat-ui-icons-regular.swf" />
+    </target>
+</project>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44ebb493/frameworks/projects/HTML/as/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/defaults.css b/frameworks/projects/HTML/as/defaults.css
index cd9389c..c34fea3 100644
--- a/frameworks/projects/HTML/as/defaults.css
+++ b/frameworks/projects/HTML/as/defaults.css
@@ -23,8 +23,8 @@
 @font-face {
   font-family: 'Flat-UI-Icons';
 
-  src: url('../fonts/glyphicons/flat-ui-icons-regular.eot');
-  src: url('../fonts/glyphicons/flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons/flat-ui-icons-regular.woff') format('woff'), url('../fonts/glyphicons/flat-ui-icons-regular.ttf') format('truetype'), url('../fonts/glyphicons/flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
+  src: url('fonts/flat-ui-icons-regular.eot');
+  src: url('fonts/flat-ui-icons-regular.eot?#iefix') format('embedded-opentype'), url('fonts/flat-ui-icons-regular.woff') format('woff'), url('fonts/flat-ui-icons-regular.ttf') format('truetype'), url('fonts/flat-ui-icons-regular.svg#flat-ui-icons-regular') format('svg');
 }
 
 /* Global style declaration */