Hi People,
I'm trying to make an application, where the user chooses a font name from a combo box and it changes their input text to the chosen font. I can make it work using formatText, but if the user doesn't have the font on their computer, it will substitute. Does anyone know a way of loading the fonts from the server instead of the user's computer?
This is the method i'm using at the moment:
//sets listener for lineOne text font
objComboListener = new Object();
objComboListener.change = function(eventObj){
//sets the swith function for lineOne font
var nIndex = Number(fontBox.selectedIndex);
switch (nIndex){
case 0: break;
case 1: lineOne_fmt = new TextFormat();
lineOne_fmt.font = "annifont";
lineOne_txt.setNewTextFormat(lineOne_fmt);break;
case 2: lineOne_fmt = new TextFormat();
lineOne_fmt.font = "arial";
lineOne_txt.setNewTextFormat(lineOne_fmt);break;
case 3: lineOne_fmt = new TextFormat();
lineOne_fmt.font = "air conditioner";
lineOne_txt.setNewTextFormat(lineOne_fmt);break;
}
}
//applies changes
fontBox.addEventListener("change", objComboListener);
while i'm here.... i'm also going to want the individual labels of the combo box to appear in their relevant font - I haven't tried this myself yet, so don't stress about it, but if anyone knows off the top of their heads......
Thanks,
DrGonzo
[/code]