# embedFonts and TextLineMetrics.width problem

**URL:** <https://forum.kirupa.com/t/embedfonts-and-textlinemetrics-width-problem/317847>\
**Category:** flash\
**Created:** [January 4, 2011, 4:31pm UTC](https://forum.kirupa.com/t/embedfonts-and-textlinemetrics-width-problem/317847 "2011-01-04T16:31:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bftawfik](https://avatars.discourse-cdn.com/v4/letter/b/e19b73/32.png) [@bftawfik](https://forum.kirupa.com/u/bftawfik)\
**Post date:** [January 4, 2011, 4:31pm UTC](https://forum.kirupa.com/t/embedfonts-and-textlinemetrics-width-problem/317847/1 "2011-01-04T16:31:23Z")

</div>

i have this problem when i use the “embedFonts = true”  
i get the “TextLineMetrics.width =0”  
while i’m sure i have text in the TextField  
any one knew why and how can i fix this ??  
this is the code :  
var metrics:TextLineMetrics;  
var tempTextField:TextField = new TextField();  
var tempTextFormat:TextFormat = new TextFormat();  
tempTextFormat.font=“Arial”;  
tempTextField.width = 500;  
tempTextField.height = 500;  
tempTextField.embedFonts = true;  
tempTextField.appendText(“Hello World”);  
tempTextField.defaultTextFormat = tempTextFormat;  
//  
trace(tempTextField.text);  
metrics = tempTextField.getLineMetrics(0);  
trace(metrics.width);
