[ 
https://issues.apache.org/jira/browse/FLEX-34197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13957424#comment-13957424
 ] 

Dudda edited comment on FLEX-34197 at 4/2/14 7:22 AM:
------------------------------------------------------

just moved to Apache Flex!! :-)


was (Author: diblasid):
just moved to Apache Flex!! ^_^

> Text Layout Framework: change embedded fontFamily works in AIR doesn't work 
> in FLEX(WEB)
> ----------------------------------------------------------------------------------------
>
>                 Key: FLEX-34197
>                 URL: https://issues.apache.org/jira/browse/FLEX-34197
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Embedded Fonts
>    Affects Versions: Adobe Flex SDK 4.6 (Release)
>         Environment: every platform (linux not tested)
>            Reporter: Dudda
>            Assignee: Maurice Amsellem
>              Labels: easytest, embedded-fonts, flex, tlf
>             Fix For: Apache Flex 4.12.0
>
>
> i have a sample code, if you run it as an AIR windowedApplication it works, 
> if you run it as a web page (s:Application) it doesn't.
> I have AIR 3.8 and flex 4.6.0
> The problem is the embedded font: in desktop application i can see the text 
> changes in the textarea using TLF, in web it falls in the default font, but 
> the font is there, since the other textarea displays it, so the problem seems 
> to be the TLF.... but i can't understand what is wrong in the code.
>  
> the following is the code for AIR desktop application, to test the problem 
> just create a  web application for flashplayer and replace 
> windowedApplication with Application in the code
> (you'll need also to have TopSecret.ttf, or another ttf font changing the 
> referenced name accordingly in the code, in the main folder):
> <?xml version="1.0" encoding="utf-8"?>
> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"; 
>                                                      
> xmlns:s="library://ns.adobe.com/flex/spark" 
>                                                      
> xmlns:mx="library://ns.adobe.com/flex/mx">
>           <fx:Script>
>                     <![CDATA[
>                               import 
> flashx.textLayout.formats.TextLayoutFormat;
>                               import mx.events.FlexEvent;
>                               import spark.events.IndexChangeEvent;
>                               protected function 
> fontDDL_changeHandler(event:IndexChangeEvent):void
>                               {
>                                         var txtLayFmt:TextLayoutFormat = 
> dynamicArea.getFormatOfRange(null,
>                                                   
> dynamicArea.selectionAnchorPosition,
>                                                   
> dynamicArea.selectionActivePosition);
>                                         txtLayFmt.fontFamily = 
> fontDDL.selectedItem;
>                                         
> dynamicArea.setFormatOfRange(txtLayFmt,
>                                                   
> dynamicArea.selectionAnchorPosition,
>                                                   
> dynamicArea.selectionActivePosition);
>                               }
>                     ]]>
>           </fx:Script>
>           <fx:Style>
>                     @namespace s library://ns.adobe.com/flex/spark;
>                     @namespace mx library://ns.adobe.com/flex/mx;
>                     @font-face {
>                               src: url(TopSecret.ttf);
>                               fontFamily: TopSecret;
>                               embedAsCFF:true;
>                     }
>           </fx:Style>
>           <s:VGroup>
>                     <s:TextArea text="this is a font Arial Text" 
> fontFamily="Arial"/>
>                     <s:TextArea text="this is a font TopSecret" 
> fontFamily="TopSecret"/>
>                     <s:TextArea id="dynamicArea" text="select this text and 
> change font"/>
>                     <s:DropDownList id="fontDDL" width="150" 
> change="fontDDL_changeHandler(event);">
>                               <s:dataProvider>
>                                         <s:ArrayList id="fontList" 
> source="[TopSecret, Arial, Courier New, Times, Verdana]" />
>                               </s:dataProvider>
>                     </s:DropDownList>
>           </s:VGroup>
> </s:WindowedApplication>



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to