Hi, I know, it’s kind of the same old problem, but I studied books, googled for it, search the forums… Nada. So, please, help me or tell me some good, definitive tutorial about these kind of troubles…
So, my problem:
- I embed both and regular and bold fonts in my library (a Century Old Style Std)
- I set it in textFormat and assign it to a dynamic textField
- embedFonts = true
- htmlText = parsed xml
Well, still <b> and <p> tags don’t work at all. Here’s the code:
private function buildTexts(){
var century:Font = new Century17();
var centuryBold:Font = new Century17bold();
titleFormat = new TextFormat();
titleFormat.font = centuryBold.fontName;
titleFormat.size = 17;
titleFormat.bold = true;
titleFormat.color = 0x3c3c3c;
titleFormat.align = TextFormatAlign.LEFT;
abstractFormat = new TextFormat();
abstractFormat.font = century.fontName;
abstractFormat.size = 13;
abstractFormat.color = 0x808080;
abstractFormat.align = TextFormatAlign.LEFT;
titleTF = buildTextField(title,titleFormat);
titleTF.x = 0;
titleTF.y = 0;
addChild(titleTF);
abstractTF = buildTextField(abstract,abstractFormat);
abstractTF.x = itemWidth-abstractTF.width;
abstractTF.y = paddingTop;
addChild(abstractTF);
}
private function buildTextField(text,tFormat){
var t = new TextField();
t.multiline = true;
t.wordWrap = true;
t.autoSize = TextFieldAutoSize.RIGHT;
t.width = tWidth;
t.defaultTextFormat = tFormat;
//t.antiAliasType = AntiAliasType.ADVANCED;
//t.sharpness = 100;
t.embedFonts = true;
t.condenseWhite = true;
t.htmlText = text;
return t;
}
and a sample of xml:
<news>
<title><![CDATA[Peserico presenta la nuova collezione Primavera Estate 2010]]></title>
<abstract><![CDATA[
<p>L’attenzione rivolta alla <b>qualità dei tessuti</b>, unita a precise conoscenze sartoriali,
consente all’azienda di proporre capi caratterizzati da una cura artigianale verso i dettagli. In breve tempo l’azienda si espande, trasformandosi da piccolo laboratorio a marchio riconosciuto dal mercato.</p>
<p>Il marchio Peserico diventa rapidamente sinonimo di pantaloni e gonne di qualità, pensati per una donna che apprezza un’eleganza ricercata ma equilibrata.</p>
]]></abstract>
<image src="news-fake2.jpg" />
</news>
Any idea?