Css ํฐํธ ์ ์ฉ ๋ฐฉ๋ฒ๊ณผ ์ข ๋ฅ
๐ ํฐํธ์ ์ข ๋ฅ
1. TTF (Ture Type Font )
- ๊ฐ์ฅ ์ผ๋ฐ์ ์ธ ๊ธ๊ผด ํ์, ๋๋ถ๋ถ์ ๋ถ๋ผ์ฐ์ ๊ฐ ์ง์.
2. OTF (Open Type Font)
- TTF ๊ธฐ๋ฐ์ผ๋ก ์ ์๋ ๊ธ๊ผด ํ์
- ์คํ ํ์
์ผ๋ก ๋ก์ปฌ์ ์ง์ ์ ์ฉํ๋ ๋ฐฉ๋ฒ
- ํฐํธ ํฌ๊ธฐ๊ฐ ํฌ๋ฉด ๋ก๋ฉ ์๊ฐ์ด ์ค๋ ๊ฑธ๋ฆฐ๋ค.
3. WOTF (Web Open Type Font)
- OTF์ TTF๋ก ์ด๋ฃจ์ด์ง ์์ถ๋ ๊ธ๊ผด ํ์์ด๋ฉฐ W3C ๊ถ์ฅ.
- ์ค๋ฅ๊ฐ ์ ๊ณ ํ์ผ์ ๋ถ๋ฌ์ค๋๋ฐ ์๊ฐ์ด ์ ๊ฒ ์์๋๋ค.
- ํฐํธ ๊ตต๊ธฐ๋ง๋ค ์ง์ ์ค์ ํด์ผํ๋ค.
4. WOTF 2.0 (Web Open Type Font)
- WOFF๋ณด๋ค ๋ ํฅ์๋ ์์ถ์ ์ ๊ณตํ๋ ์ง์ํ์ง์๋ ๋ธ๋ผ์ฐ์ ๊ฐ ์๋ค.
๐ ์ ์ฉ ๋ฐฉ๋ฒ
css๋ก ํฐํธ๋ฅผ ์ ์ฉํ ๋ ํฌ๊ฒ 2๊ฐ์ง๋ก ๋๋๋ค. ์ฒซ๋ฒ์งธ๋ ์๋ฒ(Sever)๋ก ๋ถํฐ ๋ถ๋ฌ์ค๋ ๋ฐฉ๋ฒ, ๋๋ฒ์งธ๋ ๋ก์ปฌ(Local)์ ์๋ ํฐํธ๋ฅผ ๋ถ๋ฌ์ค๋ ๋ฐฉ๋ฒ์ด๋ค.
1. CDN (Content Delivery Network)
- ์ฝํ ์ธ ์ ์ก ๋คํธ์ํฌ๋ผ๋ ์๋ฏธ๋ก, ํ์ผ์ด ์ ๋ก๋๋ ์๋ฒ์์ ๋ถ๋ฌ์ค๋ ๋ฐฉ๋ฒ์ด๋ค.
- ์ฝ๋ ๋ช ์ค์ ์ถ๊ฐํ๋ ๋ฐฉ์์ผ๋ก ๊ฐ๋จํ๋ค.
- ๋จ, ์๋ฒ์ ์์กด์ ํ๊ธฐ๋๋ฌธ์ ์๋ฒ ์ค๋ฅ ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ฉฐ ๋ถ๋ฌ์ค๋๋ฐ ๋ง์ ์๊ฐ์ด ์์๋๋ค.
๊ฐ์ฅ ๋ง์ด ์ฌ์ฉํ๋ ๊ตฌ๊ธ ํฐํธ๋ฅผ ์๋ก ์ฌ์ฉ๋ฐฉ๋ฒ์ ์์๋ณด์.
์๋ ๋งํฌ๋ฅผ ๋ฐฉ๋ฌธํ์ฌ ์ํ๋ ํฐํธ๋ฅผ ์ ํํ๋ค.
Browse Fonts - Google Fonts
Making the web more beautiful, fast, and open through great typography
fonts.google.com
๊ฒ์ ์ฐฝ ์์ View Selected families ๋ฒํผ์ ํด๋ฆญ
ํด๋ฆญ ํ ์ฌ์ด๋ ์ฐฝ์ด ์ด๋ฆฌ๋ฉฐ ํด๋น ํฐํธ์ ๋ํ ์์ธ ์ ๋ณด๊ฐ ๋์จ๋ค.
Review
์ํ๋ ํฐํธ ์คํ์ผ์ ์ถ๊ฐํ๊ฑฐ๋ ์ญ์ ํ ์ ์๋ค.
<link>
<head>์์ ์ถ๊ฐํ ์ฝ๋๋ฅผ ๋ณด์ฌ์ค๋ค.
@import
์คํ์ผ ์ํธ ์์ ์ถ๊ฐํ ์ฝ๋๋ฅผ ๋ณด์ฌ์ค๋ค.
์์ ์ฝ๋ - link ์ฌ์ฉ
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Cssํฐํธ ์ ์ฉ ์์ - link </title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet">
<style>
body {font-family: 'Noto Sans KR', sans-serif;}
</style>
</head>
<body>
</body>
</html>
์์ ์ฝ๋ - link ์ฌ์ฉ
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;200;300;400;500;600;700;800;900&display=swap');
body {@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@100;200;300;400;500;600;700;800;900&display=swap');}
2. Local
์ค์ ํ์ผ์ ์ค๋นํ์ฌ Css์์ ๋ถ๋ฌ์ค๋ ๋ฐฉ์์ผ๋ก ์ ์ฉํ๋ค.
@font-face {
font-family : 'Noto Sans KR';
font-style : normal;
font-weight : 100;
src: url(../fonts/NotoSansKR-Thin.woff2) format('woff2'),
url(../fonts/NotoSansKR-Thin.woff) format('woff'),
url(../fonts/NotoSansKR-Thin.otf) format('opentype');
}
@font-face {
font-family : 'Noto Sans KR';
font-style : normal;
font-weight : 200; /*๊ฐ ๊ตต๊ธฐ๋ง๋ค ๋ถ๋ฌ์์ผ ํ๋ค*/
src: url(../fonts/NotoSansKR-Thin.woff2) format('woff2'),
url(../fonts/NotoSansKR-Thin.woff) format('woff'),
url(../fonts/NotoSansKR-Thin.otf) format('opentype');
}