Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 如何使用FlashDevelop在as3中嵌入字体?_Actionscript 3_Flash_Flashdevelop_Font Embedding - Fatal编程技术网

Actionscript 3 如何使用FlashDevelop在as3中嵌入字体?

Actionscript 3 如何使用FlashDevelop在as3中嵌入字体?,actionscript-3,flash,flashdevelop,font-embedding,Actionscript 3,Flash,Flashdevelop,Font Embedding,如何使用FlashDevelop在as3中嵌入字体?我已经读了很多关于这个问题的帖子,但是没有一篇帮助我解决这个问题。 当我使用以下代码时,不会显示任何内容(这是所有代码): “andbasr”只是我找到的一个随机ttf文件。知道我做错了什么吗?它工作正常,我刚下载了您正在测试的字体。我认为字体没有DemiBoldweight,同样在您的情况下,由于您不使用TLF文本字段,请通过embedAsCFF=“false” 令人惊叹的!embedAsCFF=“false”是解决方案。我不明白为什么。我将

如何使用FlashDevelop在as3中嵌入字体?我已经读了很多关于这个问题的帖子,但是没有一篇帮助我解决这个问题。 当我使用以下代码时,不会显示任何内容(这是所有代码):


“andbasr”只是我找到的一个随机ttf文件。知道我做错了什么吗?

它工作正常,我刚下载了您正在测试的字体。我认为字体没有
DemiBold
weight,同样在您的情况下,由于您不使用TLF文本字段,请通过
embedAsCFF=“false”

令人惊叹的!embedAsCFF=“false”是解决方案。我不明白为什么。我将收集一些关于TLF文本字段和DF4格式的信息。。。谢谢!
package  
{
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFormat;

    public class Main extends Sprite 
    {
        [Embed(source="/../resources/fonts/andbasr.ttf", fontName = "andbasr", fontWeight = "Demibold", mimeType="application/x-font")]
        private var andbasr:Class;

        public function Main() 
        {
            var textField:TextField = new TextField();
            textField.embedFonts = true;
            var format:TextFormat = new TextFormat("andbasr", 16, 0x000000);
            textField.defaultTextFormat = format;
            textField.text = "Test";
            stage.addChild(textField);
        }

    }

}
[Embed(source="AndBasR.ttf",
        fontName = "myFont",
        mimeType = "application/x-font",
        advancedAntiAliasing="true",
        embedAsCFF="false")]
private var myEmbeddedFont:Class;

//Testing 
var textField: TextField = new TextField();
textField.defaultTextFormat = new TextFormat("myFont", 20);
textField.embedFonts = true;
textField.text = "Test Embedded Font";

addChild(textField);