Good morning,
I face a curious bug as I try to set a fontstyle in a mx:Panel object in Flex.
<?xml version="1.0" encoding="utf-8"?>
<mx:Panel xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
layout="absolute" title="Test"
titleStyleName="titleAssumed" >
<mx:Label x="0" y="-5" styleName="othersAssumed" />
<mx:Label x="0" y="16" styleName="othersAssumed"/>
The associated CSS file contains the following relevant styles:
/* CSS file */
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
@font-face{
src: url("ttf\\ControlSign Bold.ttf");
fontFamily: ControlSign;
fontWeight: bold;
}
@font-face{
src: url("ttf\\ControlMono Regular.ttf");
fontFamily: ControlMono;
}
.titleAssumed
{
fontFamily: ControlSign;
font-weight: bold;
font-size: 12;
color: #FFFFFF;
}
.othersAssumed
{
fontFamily: ControlMono;
font-size: 15;
color: #ADADAD;
}
With this configuration, and once I have set the compiler properties in Eclipse for the compiler to use the Flash text engine for MX components, I can see the two labels of the Panel in the correct font and style ; but the Panel’s title will not show up. Even if I add the “embedAsCff: false” line to my style .titleAssumed, the title refuses to show up.
Any idea about what could be causing the trouble? Thanks !
EDIT: syntax error fixed.
You need to set embedAsCFF: true in your font. Also you have a syntax error where you are not closing your curly brackets on the fonts. Below is an example and here are some more.