You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Deepak MS (JIRA)" <ji...@apache.org> on 2015/08/26 13:34:46 UTC

[jira] [Commented] (FLEX-34909) Embedded fonts not working on charts

    [ https://issues.apache.org/jira/browse/FLEX-34909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14712970#comment-14712970 ] 

Deepak MS commented on FLEX-34909:
----------------------------------

Hi Alex,
That example worked fine for english characters. But I have multilingual application which has Japanese characters to be shown.

I tried following example, which doesn't show up Japanese characters in x axis if embedded fonts are used. If I remove embedded font, it works fine. Any idea if any kind of tweaking is required to make it work for Japanese characters?

<?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("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: 14;
		}
		
		.axisStyles
		{
			labelClass: ClassReference("mx.controls.Label");
		}
		
	</fx:Style>
	
	<fx:Script>
		<![CDATA[
			import mx.collections.ArrayCollection;
			[Bindable]
			private var medalsAC:ArrayCollection = new ArrayCollection( [
				{ Country: "愛甲郡愛川町", Gold: 35, Silver:39, Bronze: 29 },
				{ Country: "綾瀬市", Gold: 32, Silver:17, Bronze: 14 },
				{ Country: "横浜市旭区", Gold: 32, Silver:17, Bronze: 14 },
				{ Country: "横浜市磯子区", Gold: 32, Silver:17, Bronze: 14 },
				{ Country: "横浜市栄区", Gold: 32, Silver:17, Bronze: 14 },
				{ Country: "横浜市戸塚区", 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> 

> Embedded fonts not working on charts
> ------------------------------------
>
>                 Key: FLEX-34909
>                 URL: https://issues.apache.org/jira/browse/FLEX-34909
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Charts
>    Affects Versions: Apache Flex 4.14.0
>         Environment: Windows 7, 64 bit. 
>            Reporter: Deepak MS
>         Attachments: SampleChart.mxml, SampleChart.zip
>
>
> I'm try to use my own font for the charts. But if I do so, all labels for X and Y axes shows up as blank.
> This is what I am trying:
> @font-face
> {
>     src: url("assets/fonts/CALIBRIL.TTF");
>     fontFamily: myFont;
>     fontStyle: normal;
>     fontWeight: normal;
>     embedAsCFF: true;
>     advancedAntiAliasing: true;
> }
> <mx:ColumnChart id="column" fontFamily='myFont' click="column_clickHandler(event)"
>                         height="100%" showDataTips="true"
>                         width="50%"
>                         seriesFilters="{[]}"
>                         >  
> But if I use system fonts like  Arial, Times etc, they all seem to work fine.
> Version: Flex 4.14 AIR 16, FP 16      
> More Details and work around can be found here:
> http://apache-flex-users.2333346.n4.nabble.com/Embedded-font-for-Charts-td10793.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)