humble david
29.03.2010, 16:29
Конструкция примерно такая:
<mx:Style source="style.css"/>
<mx:ViewStack backgroundColor="#FFFFFF" id = "tn" backgroundAlpha="0.9" top="21" left="0.5" right="12" horizontalScrollPolicy="off" >
<mx:Canvas label="Pricing" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:List x="85" y="30" width="376.5" height="224" alpha="0.0" color="#000000" id="pl" dataProvider="{pricesArray}" itemRenderer="textpricepoint" textAlign="left" horizontalScrollPolicy="off" focusAlpha="0"></mx:List>
</mx:Canvas>
</mx:ViewStack>
<mx:TabBar id="tb" dataProvider="tn" height="22" y="0" mouseDown="mouseDownHandler();" mouseUp="stopDrag();" buttonMode="true" width="313" x="0" barColor="#6EA5D5" fontWeight="normal">
</mx:TabBar>
textpricepoint (itemRenderer для List):
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Style source="style.css"/>
<mx:Label x="10" y="0" width="423" color="#000000" text="{data}" height="24"/>
</mx:Canvas>
style.css:
/* CSS file */
@font-face {
src: url("assets/Euphemia UCAS Regular 2.6.6.ttf");
fontFamily: euphemiaReguliar;
fontWeight: normal;
}
@font-face {
src: url("assets/AvenirLTStd-Medium.otf");
fontFamily: avenirMedium;
}
.myCustomTabStyleName {
cornerRadius: 0;
rollOverColor: "0x6EA5D5";
backgroundColor: "0x6EA5D5";
fillColors: "0x6EA5D5", "0x6EA5D5";
fillAlphas: 1.0, 1.0;
textRollOverColor: "0xffffff";
textSelectedColor: "0xf4ffab";
fontFamily: avenirMedium;
fontWeight: normal;
}
Label {
fontFamily: euphemiaReguliar;
fontSize: 60;
fontWeight: normal;
color: "0x6ea5d5";
}
Text {
fontFamily: euphemiaReguliar;
color: "0x000000";
fontSize: 12;
fontWeight: normal;
}
TabBar {
fontFamily: euphemiaReguliar;
color:"0xffffff";
tabStyleName: myCustomTabStyleName;
fontWeight: normal;
}
В результате в textpricepoint в List текст не отображается, когда по умолчанию стоит мой шрифт euphemiaReguliar. Когда указываю один из стандартных шрифтов, например Times New Roman - все показывается нормально.
В чем проблема?
<mx:Style source="style.css"/>
<mx:ViewStack backgroundColor="#FFFFFF" id = "tn" backgroundAlpha="0.9" top="21" left="0.5" right="12" horizontalScrollPolicy="off" >
<mx:Canvas label="Pricing" width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:List x="85" y="30" width="376.5" height="224" alpha="0.0" color="#000000" id="pl" dataProvider="{pricesArray}" itemRenderer="textpricepoint" textAlign="left" horizontalScrollPolicy="off" focusAlpha="0"></mx:List>
</mx:Canvas>
</mx:ViewStack>
<mx:TabBar id="tb" dataProvider="tn" height="22" y="0" mouseDown="mouseDownHandler();" mouseUp="stopDrag();" buttonMode="true" width="313" x="0" barColor="#6EA5D5" fontWeight="normal">
</mx:TabBar>
textpricepoint (itemRenderer для List):
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Style source="style.css"/>
<mx:Label x="10" y="0" width="423" color="#000000" text="{data}" height="24"/>
</mx:Canvas>
style.css:
/* CSS file */
@font-face {
src: url("assets/Euphemia UCAS Regular 2.6.6.ttf");
fontFamily: euphemiaReguliar;
fontWeight: normal;
}
@font-face {
src: url("assets/AvenirLTStd-Medium.otf");
fontFamily: avenirMedium;
}
.myCustomTabStyleName {
cornerRadius: 0;
rollOverColor: "0x6EA5D5";
backgroundColor: "0x6EA5D5";
fillColors: "0x6EA5D5", "0x6EA5D5";
fillAlphas: 1.0, 1.0;
textRollOverColor: "0xffffff";
textSelectedColor: "0xf4ffab";
fontFamily: avenirMedium;
fontWeight: normal;
}
Label {
fontFamily: euphemiaReguliar;
fontSize: 60;
fontWeight: normal;
color: "0x6ea5d5";
}
Text {
fontFamily: euphemiaReguliar;
color: "0x000000";
fontSize: 12;
fontWeight: normal;
}
TabBar {
fontFamily: euphemiaReguliar;
color:"0xffffff";
tabStyleName: myCustomTabStyleName;
fontWeight: normal;
}
В результате в textpricepoint в List текст не отображается, когда по умолчанию стоит мой шрифт euphemiaReguliar. Когда указываю один из стандартных шрифтов, например Times New Roman - все показывается нормально.
В чем проблема?