我已经使用this video正确安装了 Lato-Regular.ttf
字体,它在浏览器上工作得很好 . 但是当我使用下面的CLI将它部署到Android设备时,它没有显示正确的字体 . 你能告诉我该怎么办?
ionic cordova run android --prod --device
variables.scss
$font-path: "../assets/fonts";
@import "roboto";
@import "noto-sans";
@font-face {
font-family: Lato-Regular;
src: url($font-path+'/Lato-Regular.ttf');
}
@font-face {
font-family: Trench;
src: url($font-path+'/trench300tt.ttf');
}
* {
font-family: Lato-Regular;
}
.menu-font {
font-family: Trench;
}
我在调试时在设备上显示以下消息:
And Errors:
无法加载资源:net :: ERR_FILE_NOT_FOUND Lato-Regular.ttf无法加载资源:net :: ERR_FILE_NOT_FOUND Trench300.ttf
fonts文件夹如下所示: