You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Mohanraj N <Mo...@ramco.com> on 2014/05/19 08:33:40 UTC

Embed Font using @font-face in Flex SDK4.11

Hi,

I am trying to embed fonts using @font-face builds with Flex sdk4.11 which is not reflected in the application. But if I build application with Flex sdk 4.6, the embed font is getting reflected. 'font' folder is available in same directory of application.

I don't know whether I missed out anything in code or during compilation.

<?xml version="1.0"?>
<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">

  <fx:Style>
     @font-face {
        src:url("font/GOTHIC.ttf");
        fontFamily: myFont;
        embedAsCFF: true;
     }

     @font-face {
        src:url("font/GOTHICB.ttf");
        fontFamily: myFont1;
        fontWeight: bold;
        embedAsCFF: true;
     }

     @font-face {
        src:url("font/GOTHICI.ttf");
        fontFamily: myFont2;
        fontStyle: italic;
        embedAsCFF: true;
     }

     .myPlainStyle {
        fontSize: 20;
        fontFamily: myFont;
     }

     .myBoldStyle {
        fontSize: 20;
        fontFamily: myFont1;
        fontWeight: bold;
     }

     .myItalicStyle {
        fontSize: 20;
        fontFamily: myFont2;
        fontStyle: italic;
     }
  </fx:Style>


  <s:VGroup>
     <s:RichText text="Plain Label" styleName="myPlainStyle"/>
     <s:RichText text="Bold Label" styleName="myBoldStyle"/>
     <s:RichText text="Italic Label" styleName="myItalicStyle"/>
  </s:VGroup>
</s:Application>

Please let me know the idea's to solve this problem asap.

Regards,
Mohanraj N
DISCLAIMER: Information contained in and transmitted by this e-mail is proprietary to Ramco Systems Limited and/or its parents, subsidiaries and other affiliates, including Ramco Systems Corporation, (collectively "Ramco Systems"), is a confidential communication between Ramco Systems and the intended recipient(s) and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this e-mail may not have been sent with the authority of Ramco Systems. Any unauthorized disclosure, dissemination, forwarding, printing, copying or other use of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Ramco Systems shall not be liable or responsible to an unintended recipient of this email in any way for the contents of this email, or for the consequences of any such use or action. If you have received this communication in error, either directly or through forwarding, please notify Ramco Systems immediately at mailadmin@ramco.com and delete/destroy this email and any copies of this email. In the absence of a consistent formal hard copy or electronic contract or waiver or other instrument duly executed on behalf of Ramco Systems by duly authorized officer(s) or agent(s), Ramco Systems shall not be contractually bound by any email sent on its behalf. Emails will be used by Ramco Systems only for making proposals, conducting negotiations, providing information and positions on issues and for similar purposes.

Re: Embed Font using @font-face in Flex SDK4.11

Posted by Codefish <rs...@codefish.com>.
Try adding fontweight: normal. It did the trick for me.

>   @font-face {
>        src:url("font/GOTHICB.ttf");
>        fontFamily: myFont1;
>        fontWeight: normal;
>        embedAsCFF: true;
>     }

Sent from my iPhone

On May 19, 2014, at 10:06 AM, OmPrakash Muppirala <bi...@gmail.com> wrote:

>>   @font-face {
>>        src:url("font/GOTHICB.ttf");
>>        fontFamily: myFont1;
>>        fontWeight: bold;
>>        embedAsCFF: true;
>>     }

Re: Embed Font using @font-face in Flex SDK4.11

Posted by OmPrakash Muppirala <bi...@gmail.com>.
Do you see any compile errors?

How did you install the 4.11  SDK?  Did you select the FontSWF utility
during the install process?

Thanks,
Om


On Sun, May 18, 2014 at 11:33 PM, Mohanraj N <Mo...@ramco.com> wrote:

> Hi,
>
> I am trying to embed fonts using @font-face builds with Flex sdk4.11 which
> is not reflected in the application. But if I build application with Flex
> sdk 4.6, the embed font is getting reflected. 'font' folder is available in
> same directory of application.
>
> I don't know whether I missed out anything in code or during compilation.
>
> <?xml version="1.0"?>
> <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">
>
>   <fx:Style>
>      @font-face {
>         src:url("font/GOTHIC.ttf");
>         fontFamily: myFont;
>         embedAsCFF: true;
>      }
>
>      @font-face {
>         src:url("font/GOTHICB.ttf");
>         fontFamily: myFont1;
>         fontWeight: bold;
>         embedAsCFF: true;
>      }
>
>      @font-face {
>         src:url("font/GOTHICI.ttf");
>         fontFamily: myFont2;
>         fontStyle: italic;
>         embedAsCFF: true;
>      }
>
>      .myPlainStyle {
>         fontSize: 20;
>         fontFamily: myFont;
>      }
>
>      .myBoldStyle {
>         fontSize: 20;
>         fontFamily: myFont1;
>         fontWeight: bold;
>      }
>
>      .myItalicStyle {
>         fontSize: 20;
>         fontFamily: myFont2;
>         fontStyle: italic;
>      }
>   </fx:Style>
>
>
>   <s:VGroup>
>      <s:RichText text="Plain Label" styleName="myPlainStyle"/>
>      <s:RichText text="Bold Label" styleName="myBoldStyle"/>
>      <s:RichText text="Italic Label" styleName="myItalicStyle"/>
>   </s:VGroup>
> </s:Application>
>
> Please let me know the idea's to solve this problem asap.
>
> Regards,
> Mohanraj N
> DISCLAIMER: Information contained in and transmitted by this e-mail is
> proprietary to Ramco Systems Limited and/or its parents, subsidiaries and
> other affiliates, including Ramco Systems Corporation, (collectively "Ramco
> Systems"), is a confidential communication between Ramco Systems and the
> intended recipient(s) and is intended for use only by the individual or
> entity to which it is addressed, and may contain information that is
> privileged, confidential or exempt from disclosure under applicable law. If
> this is a forwarded message, the content of this e-mail may not have been
> sent with the authority of Ramco Systems. Any unauthorized disclosure,
> dissemination, forwarding, printing, copying or other use of this email,
> and/or any action taken in reliance on the contents of this e-mail is
> strictly prohibited and may be unlawful. Ramco Systems shall not be liable
> or responsible to an unintended recipient of this email in any way for the
> contents of this email, or for the consequences of any such use or action.
> If you have received this communication in error, either directly or
> through forwarding, please notify Ramco Systems immediately at
> mailadmin@ramco.com and delete/destroy this email and any copies of this
> email. In the absence of a consistent formal hard copy or electronic
> contract or waiver or other instrument duly executed on behalf of Ramco
> Systems by duly authorized officer(s) or agent(s), Ramco Systems shall not
> be contractually bound by any email sent on its behalf. Emails will be used
> by Ramco Systems only for making proposals, conducting negotiations,
> providing information and positions on issues and for similar purposes.
>