self hosting fonts
1.0.0
| 퍼머 링크 |
|---|
/index.html |
웹 사이트 (GIT 페이지)
우리 중 많은 사람들이 CDN을 통해 Google 글꼴을 사용합니다. 그러나 독일은 이것이 GDPR을 위반하여 사이트 소유자가 소송에 열려 있다고 결정했습니다.
우리는 여전히 Google 글꼴을 표시 할 수 있습니다.
참고 :이 페이지는 Google 글꼴에 중점을 두지 만 다른 종류의 웹 글꼴에는 동일한 원칙이 적용됩니다.
글꼴 다람쥐 이것은 "로봇"에서 효과가 있었지만 "Lato"및 "Open Sans"의 정적 글꼴 버전으로 실패했습니다.
Creative Fabrica 나는 이것을 "Lato"및 "Open Sans"정적 파일에 사용했습니다. 한 번에 하나씩 각 변형을 업로드해야했습니다.
HTML 페이지의 헤드에 글꼴을 사전로드하는 것이 좋습니다. 이는 글꼴의 전달 속도를 높이고 Google의 CWV (Core Web Vitals) 성능을 향상시켜야합니다. 그러나이 작업을 수행 한 후 경고를 보았습니다 (아래 테스트/Firefox 및 Firefox Developer Edition 참조).
< head >
< link
rel =" preload "
href =" roboto-light-webfont.woff2 "
as =" font "
type =" font/woff2 "
crossorigin =" anonymous "
/>
< link
rel =" preload "
href =" roboto-regular-webfont.woff2 "
as =" font "
type =" font/woff2 "
crossorigin =" anonymous "
/>
< link
rel =" preload "
href =" roboto-medium-webfont.woff2 "
as =" font "
type =" font/woff2 "
crossorigin =" anonymous "
/>
...
<!-- CSS file comes after preload -->
</ head > @font-face {
font-family : "Roboto" ;
font-weight : 300 ;
src : url ( "roboto-light-webfont.woff2" ) format ( "woff2" ) , url ( "roboto-light-webfont.woff" )
format ( "woff" );
}
/** Regular: 400 **/
@font-face {
font-family : "Roboto" ;
font-weight : 400 ;
src : url ( "roboto-regular-webfont.woff2" ) format ( "woff2" ) , url ( "roboto-regular-webfont.woff" )
format ( "woff" );
}
/** Medium: 500 **/
@font-face {
font-family : "Roboto" ;
font-weight : 500 ;
src : url ( "roboto-medium-webfont.woff2" ) format ( "woff2" ) , url ( "roboto-medium-webfont.woff" )
format ( "woff" );
}대부분의 정보는 자체 호스팅 글꼴 (Google Fonts 포함) // @font-face 튜토리얼 (YouTube)에서 나왔습니다. 사전로드/CWV 및 비 GDPR 준수에 대한 정보는 같은 페이지의 주석 스레드에서 나왔습니다.