# Embed fonts, alpha and special letters

**URL:** <https://forum.kirupa.com/t/embed-fonts-alpha-and-special-letters/270128>\
**Category:** Uncategorized\
**Created:** [September 5, 2008, 11:50am UTC](https://forum.kirupa.com/t/embed-fonts-alpha-and-special-letters/270128 "2008-09-05T11:50:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aneta](https://avatars.discourse-cdn.com/v4/letter/a/edb3f5/32.png) [@aneta](https://forum.kirupa.com/u/aneta)\
**Post date:** [September 5, 2008, 11:50am UTC](https://forum.kirupa.com/t/embed-fonts-alpha-and-special-letters/270128/1 "2008-09-05T11:50:38Z")

</div>

[FONT=Times New Roman][SIZE=3]Hi all,[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]I’m pretty new to Flash, but form the start I have a big struggle with coding. Hope some smart, experienced flash coder can help me with that.[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]I want to create an empty text box in the actionScript. Then I want to pass a variable to it, and set up its alpha to 50% (I embedded the Verdana font and linkage it to actionScript).[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]This is my code:[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Courier New]var myTxt:String=“Łódź, Poznań; Moscow:Москва; Minsk: Мінск”;[/FONT][/SIZE]  
[FONT=Courier New][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Courier New]var txt\_fmt:TextFormat = new TextFormat();[/FONT][/SIZE]  
[SIZE=3][FONT=Courier New]txt\_fmt.font = “myFont”;[/FONT][/SIZE]  
[SIZE=3][FONT=Courier New]txt\_fmt.size = 24;[/FONT][/SIZE]  
[SIZE=3][FONT=Courier New]txt\_fmt.color = 0xBF0000;[/FONT][/SIZE]  
[FONT=Courier New][SIZE=3] [/SIZE][/FONT]  
[SIZE=3][FONT=Courier New]this.createTextField(“city\_txt”, this.getNextHighestDepth(), 25, 5, 200, 40);[/FONT][/SIZE]  
[SIZE=3][FONT=Courier New]city\_txt.type = “dynamic”;[/FONT][/SIZE]  
[SIZE=3][FONT=Courier New]city\_txt.embedFonts=true;[/FONT][/SIZE]  
[SIZE=3][FONT=Courier New]city\_txt.setNewTextFormat(txt\_fmt);[/FONT][/SIZE]  
[SIZE=3][FONT=Courier New]city\_txt.text = myTxt;[/FONT][/SIZE]  
[FONT=Courier New][SIZE=3] [/SIZE][/FONT]  
[FONT=Courier New][SIZE=3]city\_txt.\_alpha=50;[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]My problem is that it doesn’t want to display special characters like Polish or Russian letters. I know, that it is possible to embed characters, but I guess it is only possible to the text elements placed on the stage, and I need to create this text box dynamically in the code.[/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3]I tried to change the font into: Arial CYR, but still nothing. What I managed to discover so far is, if the line: “city\_txt.embedFonts=true;” is removed, than everything is displayed correctly but than I can’t see my alpha. [/SIZE][/FONT]  
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
