我在 Angular 应用程序中使用了两种自定义字体,一种用于普通文本,一种用于粗体文本。我想转向 Angular Material,但我不知道如何在其中设置粗体字体。
这就是我设置自定义字体的方式styles.scss
:
@font-face {
font-family: CustomFont;
src: url(assets/font.ttf) format("truetype");
}
@font-face {
font-family: CustomBoldFont;
src: url(assets/font-bold.ttf) format("truetype");
}
@import '~@angular/material/theming';
$custom-typography: mat-typography-config(
$font-family: 'CustomFont, sans-serif'
);
@include mat-base-typography($custom-typography);
我如何告诉 Angular MaterialCustomBoldFont
在例如 h1-h6、b、th 等中使用?我尝试设置自己的规则,但它们被覆盖了。