# Embeddind fonts and html tags

**URL:** <https://forum.kirupa.com/t/embeddind-fonts-and-html-tags/295703>\
**Category:** Uncategorized\
**Created:** [September 3, 2009, 6:10am UTC](https://forum.kirupa.com/t/embeddind-fonts-and-html-tags/295703 "2009-09-03T06:10:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stratboy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/stratboy/32/3054_2.png) [@Stratboy](https://forum.kirupa.com/u/Stratboy)\
**Post date:** [September 3, 2009, 6:10am UTC](https://forum.kirupa.com/t/embeddind-fonts-and-html-tags/295703/1 "2009-09-03T06:10:11Z")

</div>

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:

```auto

		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:

```auto

	<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? ☹
