【发布时间】:2019-07-10 02:17:35
【问题描述】:
我正在使用 Nativescript 开发一个跨平台应用程序,并且我开始使用 Font Awesome Free 作为图标。 为此,我将 ttf 文件包含在字体文件夹中,并在主 css 文件中定义了以下类:
.far {
font-family: "Font Awesome 5 Free", fa-regular-400;
font-weight: 400;
}
.fab {
font-family: "Font Awesome 5 Brands", fa-brands-400;
font-weight: 400;
}
.fas {
font-family: "Font Awesome 5 Free", fa-solid-900;
font-weight: 900;
}
到目前为止一切正常,我可以通过它们的 Unicode 在文本字段中插入免费图标,并将类 far、fab 或 fas 分配给小部件。
这是一个例子:
<Button value="4" row="1" col="4" text="" class="fas navbar-item" tap="onMenuItemTap"></Button>
我尝试与 Fontawesome Pro 相同,在 Fonts 文件夹中添加 otf 文件并定义以下类,但它不起作用。
.far {
font-family: "Font Awesome 5 Pro", fa-regular-400;
font-weight: 400;
}
.fab {
font-family: "Font Awesome 5 Brands", fa-brands-400;
font-weight: 400;
}
.fas {
font-family: "Font Awesome 5 Pro", fa-solid-900;
font-weight: 900;
}
.fal {
font-family: "Font Awesome 5 Pro", fa-light-300;
font-weight: 300;
}
你能帮我解决这个问题吗?我联系了 FA 支持人员,但到目前为止,他们无法帮助我。
【问题讨论】:
-
如果免费版而不是专业版,则很难提供帮助,因为我们无法测试或访问文件
-
我明白了,有什么我可以做的吗?
标签: css nativescript