【问题标题】:Text goes invisible on embeddedFont = true文本在 embeddedFont = true 上不可见
【发布时间】:2011-08-01 23:50:46
【问题描述】:

我在加载字体后注册我的字体。在我的脑海中,一旦它们出现,我应该能够使用它们。但我不是,所以我调整了我的代码,在这里,但它仍然使文本不可见。一旦我做 embedFonts = false,它就会再次开始工作。

        trace(Font.enumerateFonts()); // Returns an array and does show my Fonts embedded.


        var format:TextFormat = new TextFormat();
        var fontClass:Class = _model.getFont("HappyHell"); // Does return the Class
        var myFont:Font = new fontClass(); // Works
        format.font = myFont.fontName;
        format.size = 15;
        format.letterSpacing = 0.8;

        var test:TextField = new TextField();
        test.embedFonts = true;
        test.defaultTextFormat = format;

        test.text = "TESTING everything 13216";
        test.x = 30;
        test.y = 30;
        addChild(test);

【问题讨论】:

    标签: actionscript-3


    【解决方案1】:

    如果您使用的是embededFonts = true 属性,那么您的库中需要有该字体。

    链接:

    更新

    trace ( myFont.fontName ) 输出什么?

    尝试:

    var myFont:Font = new HappyHell();
    

    var myFont:Font = new fontClass() as Font;
    

    【讨论】:

    • 输出为:“Happy Hell” Font.enumerateFonts 的输出为 [HappyHell][Joint][...] 和 Font.enumerateFonts()[0].fontName 的结果为“Happy Hell "
    • 我得到了它的工作,我在项目中嵌入了一个 swc。此 SWC 有一个使用该字体的文本字段。不知何故,flash 不明白这一点。
    猜你喜欢
    • 2011-12-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-02
    相关资源
    最近更新 更多