0

Please see the simplest of examples below, this is running as AIR Desktop on windows.

<?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:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";

        @font-face{
            src: url("C:/Windows/Fonts/AdobeGothicStd-Bold.otf");
            fontFamily: "AdobeGothic";
            fontWeight: bold;
            embedAsCFF: false;
        }

        s|Button{
            fontFamily: "AdobeGothic";
            fontSize: 20;
            color: #000000;
        }
    </fx:Style>
    <s:Button label="My Button" />

</s:WindowedApplication>

The font is not being used: Spark Button

What am I doing wrong?

zero323
  • 322,348
  • 103
  • 959
  • 935
Drahcir
  • 11,772
  • 24
  • 86
  • 128

2 Answers2

1

As stated in the docs:

If you set the value of embedAsCFF to false, then the embedded font does not support FTE, and works only with the MX text components.

Furthermore, you're trying to apply a bold font (fontWeight: bold;) to a non-bold label. I'm not exactly sure what effect that might have. You may have to do:

<s:Button label="My Button" fontWeight="bold"/>
RIAstar
  • 11,912
  • 20
  • 37
  • Thank you, I had previously tried toggling embedAsCFF but I did not think to set the fontWeight on the button. – Drahcir Apr 11 '13 at 13:02
0

one more option, use dot notation in your style declaration.

.mySparkButton
{
   fontFamily: "AdobeGothic";
   fontSize: 20;
   color: #000000;
}

then set your button's

 <s:Button label="My Button"  styleName = "mySparkButton" />
nadir.shpz
  • 124
  • 1
  • 13