That worked great. Thanks Alex. I have filed it here: https://issues.apache.org/jira/browse/FLEX-34909
On Fri, Jul 17, 2015 at 10:37 PM, Alex Harui <[email protected]> wrote: > Hmm. > > I would say there is a bug in Charts when working with embedded fonts. > Please file a bug with your test case at > https://issues.apache.org/jira/browse/FLEX. It appears that Charts tries > to use Spark Label for the axis, but is still using UITextFields to > measure labels. > > I think I got it to work by forcing Axis to use MX Labels. See below. > > HTH, > -Alex > > <?xml version="1.0" encoding="utf-8"?> > <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" > xmlns:s="library://ns.adobe.com/flex/spark" > xmlns:mx="library://ns.adobe.com/flex/mx" > minWidth="955" > minHeight="600"> > > <fx:Style> > @namespace s "library://ns.adobe.com/flex/spark"; > @namespace mx "library://ns.adobe.com/flex/mx"; > > @font-face > { > src: url("assets/fonts/TAHOMA.TTF"); /* tried all > fonts in the assets > folder, they all are normal fonts(non bold or non italic) */ > fontFamily: myFont; > fontStyle: normal; > fontWeight: normal; > embedAsCFF: false; > advancedAntiAliasing: true; > } > > .chartFonts > { > fontFamily: myFont; > fontWeight: normal; > fontSize: 26; > } > > .axisStyles > { > labelClass: ClassReference("mx.controls.Label"); > } > > </fx:Style> > > <fx:Script> > <![CDATA[ > import mx.collections.ArrayCollection; > [Bindable] > private var medalsAC:ArrayCollection = new > ArrayCollection( [ > { Country: "USA", Gold: 35, Silver:39, > Bronze: 29 }, > { Country: "China", Gold: 32, Silver:17, > Bronze: 14 }, > { Country: "Russia", Gold: 27, Silver:27, > Bronze: 38 } ]); > ]]> > </fx:Script> > <mx:ColumnChart id="column" styleName="chartFonts" > height="100%" showDataTips="true" > width="50%" > dataProvider="{medalsAC}" > seriesFilters="{[]}" > > > <mx:horizontalAxis> > <mx:CategoryAxis id="ca" categoryField="Country"/> > </mx:horizontalAxis> > <mx:horizontalAxisRenderers> > <mx:AxisRenderer axis="{ca}" styleName="axisStyles"/> > </mx:horizontalAxisRenderers> > <mx:verticalAxis> > <mx:LinearAxis id="la" /> > </mx:verticalAxis> > <mx:verticalAxisRenderers> > <mx:AxisRenderer axis="{la}" styleName="axisStyles"/> > > </mx:verticalAxisRenderers> > <mx:series> > <mx:ColumnSeries > xField="Country" > yField="Gold" > displayName="Gold" > > > > </mx:ColumnSeries> > > </mx:series> > </mx:ColumnChart> > </s:Application> > > > > > On 7/16/15, 11:34 PM, "megharajdeepak" <[email protected]> wrote: > > >SampleChart.zip > >< > http://apache-flex-users.2333346.n4.nabble.com/file/n10800/SampleChart.zi > >p> > > > >I'm using Flex 4.14 AIR 16, FP 16. > > > >I have attached sample fxp project with all the fonts as well. > > > > > > > >-- > >View this message in context: > > > http://apache-flex-users.2333346.n4.nabble.com/Embedded-font-for-Charts-tp > >10793p10800.html > >Sent from the Apache Flex Users mailing list archive at Nabble.com. > >
