當我啟動我的應用程序時,我在我的控制臺得到這個警告。(當我嘗試將fontFamily添加到style = { { font family:' poppinsmile ' } })時會出現這種情況)。當我使用index.css時,所有的字體都會中斷(只使用默認的無襯線字體)
Failed to decode downloaded font: http://localhost:3000/cards/static/media/AnyConv.com__Poppins-Medium.9bf6eb6e76457e197444.woff2
這是我的代碼:
@font-face {
font-family: 'PoppinsMedium';
src: url('common/fonts/AnyConv.com__Poppins-Medium.woff2') format('woff2'),
url('common/fonts/AnyConv.com__Poppins-Medium.woff') format('woff'),
url('common/fonts/AnyConv.com__Poppins-Medium.eot') format('embedded-opentype'),
url('common/fonts/Poppins-Medium.ttf') format('truetype');
font-weight: normal;
font-style: normal;
font-display: swap;
body {
margin: 0;
font-family: 'PoppinsMedium', sans-serif;
}
}```
fonts based on this way: src/common/fonts/
(p.s using "baseUrl": "src",)
When i adding fonts like this i getting warninig in my console. How to repair?
下一篇c語言json解析數組