폰트 웨이트

Font weight

획의 두께를 나타내는 값. CSS는 100(Thin)부터 900(Black)까지 100 단위 숫자로 다룹니다.

다른 이름: 글자 굵기
···
html
<div class="stage" id="stage"></div>
css
#stage{display:grid;gap:3px;width:min(92%,380px)}
.step{display:flex;align-items:baseline;gap:10px;padding:3px 8px;border-radius:6px;transition:background .3s}
.step.active{background:color-mix(in srgb, var(--accent) 14%, transparent)}
.num{width:30px;flex:none;font:10px ui-monospace,Menlo,monospace;color:var(--muted);text-align:right}
.sample{font-family:system-ui,-apple-system,sans-serif;color:var(--fg);font-size:18px}
.name{font:10px ui-monospace,Menlo,monospace;color:var(--muted);margin-left:auto}
.step.active .sample{color:var(--accent)}
js
const weights = [[100,'Thin'],[200,'Extra Light'],[300,'Light'],[400,'Regular'],[500,'Medium'],[600,'SemiBold'],[700,'Bold'],[800,'Extra Bold'],[900,'Black']];
const stage = document.getElementById('stage');
weights.forEach(function(w){
  const row = document.createElement('div');
  row.className = 'step';
  const num = document.createElement('span');
  num.className = 'num';
  num.textContent = w[0];
  const sample = document.createElement('span');
  sample.className = 'sample';
  sample.style.fontWeight = w[0];
  sample.textContent = 'Weight';
  const name = document.createElement('span');
  name.className = 'name';
  name.textContent = w[1];
  row.appendChild(num);
  row.appendChild(sample);
  row.appendChild(name);
  stage.appendChild(row);
});
const rows = [...stage.children];
let idx = 0;
setInterval(function(){
  rows.forEach(function(r){ r.classList.remove('active'); });
  rows[idx].classList.add('active');
  idx = (idx + 1) % rows.length;
}, 500);

`normal`(400)과 `bold`(700) 키워드가 익숙하지만, 실제로는 100~900 사이 숫자 값입니다. 폰트가 특정 굵기의 실제 글리프를 갖고 있지 않으면 브라우저가 가장 가까운 굵기로 대체하거나(폰트 매칭), 최악의 경우 합성 볼드(가짜로 두껍게 렌더링)를 씁니다 — 합성 볼드는 획이 뭉개져 품질이 떨어지므로 피하는 게 좋습니다.

굵기는 정보 위계를 만드는 가장 저렴한 도구입니다. 크기를 키우지 않고도 제목·강조어를 구분할 수 있고, 특히 작은 UI 텍스트에서는 크기 차이보다 굵기 차이가 레이아웃을 덜 흔듭니다.

웹폰트를 쓸 때 굵기별로 별도 파일을 불러오면(Regular, Medium, Bold…) 그만큼 요청·용량이 늘어납니다. 실제 쓰는 굵기 수를 2~3개로 제한하거나, 가변 폰트 하나로 여러 굵기를 대체하는 것도 방법입니다.

언제 쓰나

프로젝트에서 실제로 쓸 굵기를 2~3개로 정해두고(예: 400/600/800), 그 외 값은 쓰지 않기로 규칙을 만들면 일관성이 유지됩니다.