离子变化默认字体 [英] ionic change default font
问题描述
我知道之前在下面的链接中提出并回答了这个问题。我想更改默认字体而不必添加到每个CSS。
I know this question is asked and answered before in the links below. I want to change the default font without having to add to every css.
我尝试过的事情:
- 更改.tff,.eot, .woff,.svg文件直接合并我的字体和离子
- 试图通过在html和css文件中指定它来实现字体(它可以工作,但我希望它是默认的)
- 用open-sans字体覆盖www / lib / ionic / fonts(离子消失)
- 当我使用第一个链接时(所有格式都是走了,只留下了文字和按钮)我也尝试将字体面放在scss / ionic.app.scss的顶部和底部
- Changing the .tff, .eot, .woff, .svg file directly to merge my fonts and ionicons
- Tried to implement the font by specifying it in html and css file (it works, but i want it to be default)
- Overwrite the www/lib/ionic/fonts with open-sans font (the ionicons disappear)
- When i use the first link (all formatting is gone, only left with text and buttons) I also tried placing the font-face on top and bottom in scss/ionic.app.scss
<请帮忙!我看到的答案是说明,但没有解释它是如何工作的。我不知道离子设置sass是如何工作的/它的作用。 gulp如何参与其中。
Please help! The answers i have seen are instructions but no explanation how it works. I don't know how "ionic setup sass" works/what it does. How gulp plays a part in this.
https://forum.ionicframework.com/t/how-to-change-the-font-of-all-texts-in-ionic/ 30459
https://forum.ionicframework.com/t/change-font-family-and-use-ionicons-icons/26729
推荐答案
将所有 字体文件
导入您的应用。
Import all the font files
in to your app.
示例:
@font-face {
font-family: 'Lato-Light';
src: url('../fonts/Lato-Light.eot') format('embedded-opentype'), url('../fonts/Lato-Light.woff') format('woff'), url('../fonts/Lato-Light.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
如果你想在整个应用中使用这个字体,那么就这样给出
If you want this font in entire app ,Just give like this
* {
font-family: 'Lato-Light' !important;
}
如果您有任何疑问,请告诉我。谢谢
If you have any doubt.Please let me know.Thanks
这篇关于离子变化默认字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!