• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Can't render Hindi (Devangari) text.

New Here ,
Dec 09, 2009 Dec 09, 2009

Copy link to clipboard

Copied

Any idea why the old text class can render Devangari, but the FTE cannot, even when the font is embedded as follows?

package {

import flash.display.Sprite;

import flash.text.TextField;

import flashx.textLayout.container.ContainerController;

import flashx.textLayout.elements.ParagraphElement;

import flashx.textLayout.elements.SpanElement;

import flashx.textLayout.elements.TextFlow;

    import flash.text.Font;

    import flash.text.TextField;

public class DevnagriScriptTest extends Sprite

{

[Embed(source='DevanagariMT.ttf',fontName='_HindiFont',cff='true')]

public static var _HindiFont:Class;

public const FONT_NAME:String = '_HindiFont';

public function DevnagriScriptTest()

{

flash.text.Font.registerFont(_HindiFont);

var textFlow:TextFlow  = new TextFlow();

textFlow.paddingLeft="5";

textFlow.paddingRight = "5";

textFlow.paddingTop = "25";

var controller = new ContainerController(this, 300, 90);

textFlow.flowComposer.addController(controller);

var paragraph = new ParagraphElement();

paragraph.fontFamily = 'Arial';

paragraph.textAlign = 'center';

paragraph.paddingLeft='10';

paragraph.paddingTop ='30';

var _span= new SpanElement();

_span.color=0xFFFFFF;

_span.text = "This is the FTE Text Field?   تعليق من قبل < aracbic |  hindi > اुमने कुछ चीजें";

paragraph.addChild(_span);

textFlow.addChild(paragraph);

textFlow.flowComposer.updateAllControllers();

// Ofcourse this font works with the old TextField class.

var oldTextField:TextField = new TextField();

oldTextField.text = "This is an old text field.  कुछ चीजें जैसे की बीं्स्वी सदी के क";

oldTextField.height = 90;

oldTextField.width = 390;

oldTextField.multiline=true;

oldTextField.x = 30;

oldTextField.y = 100;

addChild(oldTextField);

}

}

}

TOPICS
Text layout framework

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Dec 09, 2009 Dec 09, 2009

Copy link to clipboard

Copied

TLF (and the underlying flash.text.engine classes) support OpenType layout only. The font you are using, DevanagariMT is an AAT font.

Incidentally, while TextField seems to support DevanagariMT on Mac, it most certainly doesn't on Windows, and an embedding of DevanagariMT for TextField does not work on any platform.

You may want to try the Lohit fonts which are available at https://fedorahosted.org/lohit/ (they are under GPL). There are of course other OpenType Indic fonts out there, free or commercial.

Eric.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 10, 2009 Dec 10, 2009

Copy link to clipboard

Copied

LATEST

Hi Eric,

Thanks for your help.  Forum users, for future refernce, this font works perfectly, and installs out of the box on OS X.  It's called Chandas.ttf  and it is OpenType

http://www.sanskritweb.net/cakram/

Peder

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines