Flex 4更改默认字体

时间:2011-05-04 12:39:23

标签: flex fonts flex4

如何为粗体和普通字体安装多种字体,我正在尝试更改默认字体。

<fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";
    @namespace mx "library://ns.adobe.com/flex/mx";
    @namespace assets "assets.*";
    @namespace comp "comp.*";

    @font-face {
        font-family: localVerdana;
        src: url("assets/verdana.ttf");
        src: url("assets/verdanab.ttf");
    }

    s|Label {
        font-family: localVerdana;
    }

    s|TextInput {
        font-family: localVerdana;
    }

    s|TextArea {
        font-family: localVerdana;
    }

</fx:Style>

1 个答案:

答案 0 :(得分:2)

您需要为每种样式使用一个@ font-face声明,使用的字体重量

@font-face
{
    src:                    url("assets/verdana.ttf");
    font-family:            localVerdana;
    font-style:             normal;
    font-weight:            normal;
    embed-as-cff:           true;
    advanced-anti-aliasing: true;

}

@font-face
{
    src:                    url("assets/verdanab.ttf");
    font-family:            localVerdana;
    font-style:             normal;
    font-weight:            bold;
    embed-as-cff:           true;
    advanced-anti-aliasing: true;

}