小编lol*_*elo的帖子

无法在 NativeScript 中使用字体图标

我已经从 fontello 下载了一个 tff 图标 - 我discard将其重命名为- 并将其放置在vanilla ts nativescript 项目fonts文件夹内的app文件夹中:

在此处输入图片说明

在我的 xml 我有这个标签:

<Label id="label" text="1U+F1F8" class="discard" />
Run Code Online (Sandbox Code Playgroud)

app.css像这样:

.btn {
    font-size: 18;
}

.discard {
    font-family: "discard";
    font-weight: bold;
}
Run Code Online (Sandbox Code Playgroud)

标签显示文本时应该显示图标?

在此处输入图片说明

文本是tff 文件的unicode,我认为这是文档中所见的要求- 从 Mac 上的字体手册中获取:

在此处输入图片说明

到目前为止,我也只在 android 上尝试过 - 因为我只需要正确设置文件名。

可能是什么问题?

我在我的原始项目中使用 react-nativescript - 但希望首先让它在 vanilla ts 中工作。最好有一种方法可以在后面代码中做到这一点,然后我可以在 react-nativescript 中使用它。

css fonts nativescript

3
推荐指数
1
解决办法
555
查看次数

标签 统计

css ×1

fonts ×1

nativescript ×1