Answered
Line breaks ignored when using HTML text CSS and embedded fonts
Anyone come accross this.
When using a StyleSheet with html text in a dynamic textfield with embedded fonts line breaks are ignored. It is as if TextField.condenseWhite is being set to true. Essentially the <p> tags are being treated as a <br/> tag.
If I dont embed fonts it works fine. Another weird thing is if i add an empty paragraph <p></p> between the first two paragraphs it makes any subsequent paragraph behave correctly. e.g.
<p>first paragraph text here</p>
<p>second paragraph text here</p>
<p>third paragraph text here</p>
displays as if there are <br/> between each one.
But
<p>first paragraph text here</p>
<p></p>
<p>second paragraph text here</p>
<p>third paragraph text here</p>
behaves correctly even for the third paragraph.
Here is the code i am working with (using XML as i am dynamically populating the textfield from XML)
any help much appreciated
UPDATE:
After reading http://www.kirupa.com/forum/showthread.php?t=307326
i tried the same experiment using a TF drawn in the IDE, the results for each, even though the TextFields are essentially the same are totally different.
updated CODE accordingly - just need a TF on stage, called "ideTextField" with font 'Arial'
When using a StyleSheet with html text in a dynamic textfield with embedded fonts line breaks are ignored. It is as if TextField.condenseWhite is being set to true. Essentially the <p> tags are being treated as a <br/> tag.
If I dont embed fonts it works fine. Another weird thing is if i add an empty paragraph <p></p> between the first two paragraphs it makes any subsequent paragraph behave correctly. e.g.
<p>first paragraph text here</p>
<p>second paragraph text here</p>
<p>third paragraph text here</p>
displays as if there are <br/> between each one.
But
<p>first paragraph text here</p>
<p></p>
<p>second paragraph text here</p>
<p>third paragraph text here</p>
behaves correctly even for the third paragraph.
Here is the code i am working with (using XML as i am dynamically populating the textfield from XML)
any help much appreciated
UPDATE:
After reading http://www.kirupa.com/forum/showthread.php?t=307326
i tried the same experiment using a TF drawn in the IDE, the results for each, even though the TextFields are essentially the same are totally different.
updated CODE accordingly - just need a TF on stage, called "ideTextField" with font 'Arial'
