본문 바로가기

퍼블리싱

[CSS] Unicode-range로 언어별 폰트 다르게 설정하는 꿀팁 !

[CSS]  Unicode-range로 언어별 폰트 다르게 설정하는 꿀팁 !

unicode-range: U+0-10FFFF;    // 기본값, 모든 글자
unicode-range: U+0020-007E;    // 영문, 숫자, 특수문자
unicode-range: U+0041-005A;    // 영문 대문자
unicode-range: U+0061-007A;    // 영문 소문자
unicode-range: U+0020-002F, U+003A-0040, U+005B-0060, U+007B-007E;    // 특수문자
unicode-range: U+0030-0039;    // 숫자
unicode-range: U+AC00-D7A3;    // 한글
unicode-range: U+3000-30FF;    // 일본 문자
unicode-range: U+3000-30FF, U+FF61-FFEF;  // 일본 문자 적용(반각 가타가나 포함)
unicode-range: U+4E00-9FAF;    // 한중일 통합 한자
@font-face {
  font-family: 'Pretendard-Regular';
  src: url('https://cdn.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff') format('woff');
  font-weight: 200;
  font-style: normal;
  unicode-range: U+AC00-D7A3, U+0030-0039;  /* 한글 , 숫자*/
}

 

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400..800&display=swap');

@font-face {
  font-family: 'Syne';
  font-weight: 400;
  font-style: normal;
  unicode-range: U+0041-005A, U+0061-007A    /* 영문 대소문자 */
}