2016-11-11 57 views

回答

3

角度材质是材质设计的实现,材质设计与Roboto字体紧密相关,正如您所提到的,文档中没有关于它的内容,所以我认为通过框架无法做到这一点。

但是,您可以轻松更改CSS文件中的字体系列,这需要在角度材质依赖关系后包含在您的构建中。这里有一个例子:

body { 
    font-family: "Comic Sans MS"; 
} 

input, 
button, 
select, 
textarea { 
font-family: inherit; 
font-size: inherit; 
line-height: inherit; 
} 

和演示:http://codepen.io/mattdanna/pen/pgwVzX

从这里借:https://github.com/angular/material/issues/6561#issuecomment-170837189

+0

漫画无敌......你的怪物! upvoted虽然;) – Keno

2

这是关于这个问题的正式文件,但它并没有规定如何提供备份家庭类字体无法加载: https://material.angular.io/guide/typography

@import '[email protected]/material/theming'; 

// Define a custom typography config that overrides the font-family as well as the 
// `headlines` and `body-1` levels. 
$custom-typography: mat-typography-config(
     $font-family: monospace, 
     $headline: mat-typography-level(32px, 48px, 700), 
     $body-1: mat-typography-level(16px, 24px, 500) 
); 
// Override typography for all Angular Material, including mat-base-typography and all components. 
@include angular-material-typography($custom-typography); 

编辑;备份字体家族(注意引用):

$font-family: '"Sintony", Arial, sans-serif'