flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <jus...@classsoftware.com>
Subject Re: [Flex JS] Font support
Date Sat, 18 Feb 2017 01:00:51 GMT
Hi,

So I’ve come up with a way that works but not sure it it’s ideal or not. It's certainly
not an obvious way to add font support.

Here’s the main application:
<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic" xmlns:fonts="fonts.*">
   <js:valuesImpl>
       <js:SimpleCSSValuesImpl />
   </js:valuesImpl>

    <js:beads>
        <fonts:Pangolin />
    </js:beads>
    
   <js:initialView>
       <js:View>
           <js:VContainer>
                <js:Container>
                    <js:Label text="The quick brown fox jumped over the lazy dog.">
                        <js:style>
                            <js:SimpleCSSStyles fontFamily="Pangolin" />
                        </js:style>
                    </js:Label>
                </js:Container>
                <js:Container>
                    <js:Label text="The quick brown fox jumped over the lazy dog." />
                </js:Container>
           </js:VContainer>
       </js:View>
   </js:initialView>
</js:Application>

And Pangolin.as used <inject_html> like so:

package fonts {
import org.apache.flex.core.BeadViewBase;

public class Pangolin extends BeadViewBase {
 /**
  *  <inject_html>
  *  <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Pangolin">
  *  </inject_html>
  */
 public function Pangolin() {
    super();
    }
 }
 }

Is BeadViewBase the correct class to extend?

Thanks,
Justin



Mime
View raw message