简体   繁体   English

CSS 字体外观声明

[英]CSS Font Face declarations

I am working on legacy code base that has these and more @font-face declarations我正在研究具有这些和更多@font-face 声明的遗留代码库

@font-face {
    font-family: 'Lato';
    font-weight: $font-weight-thin;
    font-style: $font-style-normal;
      text-rendering: optimizeLegibility;

      src: url('#{$lato-path}Lato-Thin-webfont.eot');
      src: url('#{$lato-path}Lato-Thin-webfont.eot?#iefix') format('embedded-opentype'),
          url('#{$lato-path}Lato-Thin-webfont.woff2') format('woff2'),
          url('#{$lato-path}Lato-Thin-webfont.woff') format('woff'),
          url('#{$lato-path}Lato-Thin-webfont.ttf') format('truetype'),
          url('#{$lato-path}Lato-Thin-webfont.svg#latothin') format('svg');
  }

  @font-face {
    font-family: 'Lato';
    font-weight: $font-weight-thin;
    font-style: $font-style-italic;
      text-rendering: optimizeLegibility;

      src: url('#{$lato-path}Lato-ThinItalic-webfont.eot');
      src: url('#{$lato-path}Lato-ThinItalic-webfont.eot?#iefix') format('embedded-opentype'),
          url('#{$lato-path}Lato-ThinItalic-webfont.woff2') format('woff2'),
          url('#{$lato-path}Lato-ThinItalic-webfont.woff') format('woff'),
          url('#{$lato-path}Lato-ThinItalic-webfont.ttf') format('truetype'),
          url('#{$lato-path}Lato-ThinItalic-webfont.svg#latothin_italic') format('svg');
  }

Clearly these are referencing 2 separate font files, but will the other versions ever get reached if they all have the same font family name?显然,这些引用了 2 个单独的字体文件,但如果它们都具有相同的字体系列名称,是否会达到其他版本?

font-family: 'Lato';

Yes.是的。 Note that the font-style differs, so the fonts will be applied to their respective font styles (first to normal, second to italic)请注意字体样式不同,因此 fonts 将应用于各自的字体 styles (第一个为正常,第二个为斜体)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM