gpt4 book ai didi

ionic2 - 使用Ionic2的自定义字体

转载 作者:行者123 更新时间:2023-12-03 13:16:23 25 4
gpt4 key购买 nike

在我的Ionic2项目中,我将字体(ttf格式)放在文件夹www / build / fonts中。
但是当我构建应用程序时,字体消失了。

我能怎么做 ?

最佳答案

不要将字体放在node_modules或build文件夹中。 node_modules文件夹在npm install或npm update上得到更新,并且通过每个build命令创建build文件夹。

我目前正与生产应用程序一起使用的最佳可能方式是将您的字体放在www / fonts文件夹中,并在您的/app/themes/app.core.scss中引用它们,如下所示。

@font-face {
font-family: 'gurbaniakharregular';
src: url('../../fonts/gurbaniakhar.ttf.eot');
src: url('../../fonts/gurbaniakhar.ttf.eot?#iefix') format('embedded-opentype'),
url('../../fonts/gurbaniakhar.ttf.woff2') format('woff2'),
url('../../fonts/gurbaniakhar.ttf.woff') format('woff'),
url('../../fonts/gurbaniakhar.ttf.ttf') format('truetype'),
url('../../fonts/gurbaniakhar.ttf.svg#gurbaniakharregular') format('svg');
font-weight: normal;
font-style: normal;
}

关于ionic2 - 使用Ionic2的自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36870847/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com