(AS3) Different fonts for each language in the text field
Copy link to clipboard
Copied
I have a textfield with about 100000 characters.
Is there a way to display different fonts for each language in this field?
(For example) English=>"Arial", Hangul=>"Malkun Gothic"
If possible, please provide sample code.
Copy link to clipboard
Copied
Hi.
You can create a new TextFormat instance, change the font property and apply this TextFormat instance to the target text field using the defaultTextFormat property.
Regards,
JC
Copy link to clipboard
Copied
I think my question is wrong.
The text field contains a mixture of English and Korean.
In this case I am asking how to apply different fonts for each language.
Copy link to clipboard
Copied
you can mix different fonts in the same textfield, but it would be easier and cleaner to use different textfields for different languages if both languages are to be displayed concurrently.
Copy link to clipboard
Copied
I think applying multiple fonts to the same field is very complicated.
Thank you both for your advice.
Copy link to clipboard
Copied
If that's the case, you need to use the htmlText property. Among other things, it makes possible to use more than one font face in the same text field.
Example:
yourTextField.htmlText = '<p><font face="Times New Roman">Lorem ipsum</font></p>\n<font face="Arial">Lorem ipsum</font></p>';
Regards,
JC
Copy link to clipboard
Copied
you can use as3 and non-html text via the setTextFormat method

