我有一个mui主题,定义如下:
export default createMuiTheme({
typography: {
fontFamily: '"Nunito Sans", "Helvetica", "Arial", sans-serif',
fontWeightLight: 300,
fontWeightMedium: 600,
fontWeightRegular: 400
}
}
});
我已经使用 App.css
文件从本地文件中加载字体。从网络请求中可以看到这些文件是可以找到的。
/* latin */
@font-face {
font-family: 'Nunito Sans';
font-style: normal;
font-weight: 300;
src: local('Nunito Sans Light'), local('NunitoSans-Light'),
url(../assets/font/pe03MImSLYBIv1o4X1M8cc8WAc5tU1E.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Nunito Sans';
font-style: normal;
font-weight: 400;
src: local('Nunito Sans Regular'), local('NunitoSans-Regular'), url(../assets/font/pe0qMImSLYBIv1o4X1M8cce9I9s.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin */
@font-face {
font-family: 'Nunito Sans';
font-style: normal;
font-weight: 600;
src: local('Nunito Sans SemiBold'), local('NunitoSans-SemiBold'),
url(../assets/font/pe03MImSLYBIv1o4X1M8cc9iB85tU1E.woff2) format('woff2');
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
问题在于UI正在回滚到“Helvetica”字体。我无法看出为什么MUI没有使用“Nunito Sans”,很烦人的是这个设置之前是好的现在却失败了。是否有人知道为什么会出现这种情况?谢谢!