Embed Font : Font « Graphics « Flex






Embed Font

Embed Font
          

<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->



    <!-- behaviors\EmbedFont.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"
    width="650">
    <s:layout>
        <s:HorizontalLayout />
    </s:layout>
    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";
        @font-face {
            src:url("a.ttf");
            font-family: myMyriadWebPro;
            embedAsCFF: true;
        }
        @font-face {
            src:url("a.ttf");
            font-family: myMyriadWebProMX;
            embedAsCFF: false;
        } 
</fx:Style>
    <fx:Declarations>
        <s:Rotate id="rotateForward" angleFrom="0" angleTo="45" />
        <s:Rotate id="rotateBack" angleFrom="45" angleTo="0" />
    </fx:Declarations>
    <s:VGroup>
        <s:Button label="Rotate Forward"
            click="rotateForward.end();rotateForward.play([l1]);" />
        <s:Button label="Rotate Backward" click="rotateBack.end();rotateBack.play([l1]);" />
        <s:TextArea id="l1" height="75" fontFamily="myMyriadWebPro"
            text="FTE supported. This text will rotate." />
    </s:VGroup>
    <s:VGroup>
        <s:Button label="Rotate Forward"
            click="rotateForward.end();rotateForward.play([l2]);" />
        <s:Button label="Rotate Backward" click="rotateBack.end();rotateBack.play([l2]);" />
        <mx:TextArea id="l2" height="75" fontFamily="myMyriadWebProMX"
            text="Embedded font. This text will rotate." />
    </s:VGroup>
    <s:VGroup>
        <s:Button label="Rotate Forward"
            click="rotateForward.end();rotateForward.play([l3]);" />
        <s:Button label="Rotate Backward" click="rotateBack.end();rotateBack.play([l3]);" />
        <mx:TextArea id="l3" height="75"
            text="System font. This text will not rotate." />
    </s:VGroup>
</s:Application>

   
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Point to defined ranges with unicodeRange attribute of @font-face declaration
2.Set device fontSet device font
3.Embed a.ttf font file
4.Apply embedded font inlineApply embedded font inline
5.Change font size with CSSChange font size with CSS
6.Embedding a font by specifying a filenameEmbedding a font by specifying a filename
7.Reuse the embedded font inside other style definitionsReuse the embedded font inside other style definitions
8.Set fontFamily style property in MXMLSet fontFamily style property in MXML
9.Use tagUse <font> tag
10.define the fontSize property with a value of 20 pixelsdefine the fontSize property with a value of 20 pixels
11.Sub Component Inheritance for font size styleSub Component Inheritance for font size style
12.Define fontSize, an inheritable property, to the global selectorDefine fontSize, an inheritable property, to the global selector
13.Fonts are inheritable style propertiesFonts are inheritable style properties
14.Embed fonts by location by using the [Embed] tag syntaxEmbed fonts by location by using the [Embed] tag syntax
15.Embed same font for different character ranges
16.Setting ranges in font-face declarationsSetting ranges in font-face declarations
17.List embedded fonts
18.Specify fontWeight and fontStyle in the @font-face and selector blocksSpecify fontWeight and fontStyle in the @font-face and selector blocks
19.Load font from ttf file and use it in style
20.Add font weight to embedded font
21.Define and use font faceDefine and use font face
22.Set unicode range for font faceSet unicode range for font face
23.Font face and font familyFont face and font family
24.Make maxFontSize and minFontSize properties that you defined as variables usableMake maxFontSize and minFontSize properties that you defined as variables usable
25.Use embedded fonts for your axis titlesUse embedded fonts for your axis titles
26.Embed Font with ActionScript
27.Use Embedded FontsUse Embedded Fonts
28.Determine All Fonts Installed on a User's ComputerDetermine All Fonts Installed on a User's Computer
29.Style for embedded fontStyle for embedded font
30.The use of the tagThe use of the <font>tag
31.Set the fontSize to 15 and the color to 0x9933FFSet the fontSize to 15 and the color to 0x9933FF
32.selector defines the fontSize as x-smallselector defines the fontSize as x-small
33.Device FontDevice Font
34.Use myFontFamily, the value of the fontFamily property, as the font in the VGroup type selectorUse myFontFamily, the value of the fontFamily property, as the font in the VGroup type selector
35.Embedded Font Face InlineEmbedded Font Face Inline
36.Embedded Font Face with ActionScript By Location
37.Detecting Embedded FontsDetecting Embedded Fonts
38.Enumerate FontsEnumerate Fonts
39.Embedded Font Character RangeEmbedded Font Character Range
40.Embed same font twice, each time restricting the font to different character ranges.Embed same font twice, each time restricting the font to different character ranges.
41.Emebedded font familiesEmebedded font families
42.Embed both a non-CFF version and a CFF version of the fontEmbed both a non-CFF version and a CFF version of the font
43.Apply boldface or oblique type to controls inline
44.Multiple FacesMultiple Faces
45.Apply Multiple Faces InlineApply Multiple Faces Inline