如果您的主字体不支持某种语言,则可以在自定义FontManagement类中实现一个开关,然后恢复为非嵌入字体。为了达到这个目的,你可以使用这个FontManagement类作为格式化TextField的集中点。这可以通过创建一个公共静态函数来实现,该函数将返回具有相关格式的TextField。
//where you need to format a TextField
var params:Object = {color:0xffffff , size:12, supported:false , etc...};
var tf:Texfield = FontManagement.formatTextField(tf , params);
public class FontManagement
{
//A basic example
public static function formatTextField(tf:TextField , params:Object):TextField
{
//since this is a static function , the Boolean is passed as an argument
//but there are other ways to set it, depending on where in your app
//the language is identified
if(params.supported)
tf.embedFonts = true;
else
tf.embedFonts = false;
//here the rest of your formatting code
return tf;
}
}
我需要所有我的嵌入字体不支持字符(中国,日本等)的备用字体。 – destroytoday 2010-09-12 17:01:07