I may have to create templates that use different types of fonts (example: regular and bold) in the same line of dynamic text (example: first name in regular, last name in bold).
I have to stick with Flash (no time or sufficient experience and knowledge to move to HTML5 at short notice).
The only solution that I can think of, with the knowledge I have, is to split the name in different text objects, one for the first name, one for the last name, etc. Each text object uses the proper font required. I calculate the actual length of the text with AS3 and using this information I move the objects horizontally in order to center them on the graphics (or align them as required).
Something similar I do to colorized part of text I think it should also work with different font the same way color_start and color_end is integer that specify in which part of the text to change attributes.
Of cource you must manipulate each text string, I do it form Visual Basic and send the values(color_start , color_end) to AS3 as element
This is a template in which text
antil-alias property has been set to device font
named as xf0
while setting data it should be like "<p>This is <b>some</b> content to <i>test</i>"
as3 file contains following code.
package
{
import se.svt.caspar.template.CasparTemplate;
public class mixweight extends CasparTemplate
{
override public function SetData(xmlData:XML):void
{
super.SetData(xmlData);
for each (var element:XML in xmlData.elements())
{
if (element. @ id == "xf0")
{
xf0.htmlText=element.data. @ value;
}
}
}
}
}