엑스하이트

x-height

소문자 x처럼 어센더·디센더가 없는 글자의 높이. 같은 폰트 크기여도 서체마다 이 비율이 달라 체감 크기가 달라집니다.

다른 이름: 엑스 높이소문자 높이
···
html
<div class="stage">
  <div class="frame">
    <div class="band" id="band"></div>
    <span class="word" id="word">exercise</span>
  </div>
  <div class="readout"><span id="font">Georgia</span> · x-height ≈ <span id="ratio">0.47</span>em</div>
</div>
css
.frame{position:relative;display:inline-block;font-size:20vmin;line-height:1}
.word{color:var(--fg);font-weight:700;position:relative;z-index:2;letter-spacing:.005em}
.band{position:absolute;left:-.05em;right:-.05em;bottom:.18em;height:.47em;background:color-mix(in srgb, var(--accent) 20%, transparent);border-top:1px solid var(--accent);border-bottom:1px solid var(--accent);transition:height .6s ease;z-index:1}
.readout{margin-top:16px;font:12px ui-monospace,Menlo,monospace;color:var(--muted);text-align:center}
#font{color:var(--fg);font-weight:600}
#ratio{color:var(--accent)}
js
const word = document.getElementById('word');
const band = document.getElementById('band');
const fontEl = document.getElementById('font');
const ratioEl = document.getElementById('ratio');
const fonts = [
  { name: 'Georgia (serif)', stack: "Georgia,'Times New Roman',serif", xh: 0.47 },
  { name: 'system-ui (sans)', stack: 'system-ui,-apple-system,sans-serif', xh: 0.54 },
];
let i = 0;
function apply(){
  const f = fonts[i];
  word.style.fontFamily = f.stack;
  band.style.height = f.xh + 'em';
  fontEl.textContent = f.name;
  ratioEl.textContent = f.xh.toFixed(2);
  i = (i + 1) % fonts.length;
}
apply();
setInterval(apply, 1800);

엑스하이트가 큰 서체(대부분의 산세리프)는 작은 크기에서도 또렷하게 읽혀서 화면·UI용 폰트에 많이 쓰입니다. 엑스하이트가 작은 서체(고전적인 세리프)는 어센더·디센더가 상대적으로 길어져 우아하고 본문스러운 인상을 줍니다.

같은 `font-size: 16px`를 줘도 폰트를 바꾸면 실제 글자가 커 보이거나 작아 보이는 이유가 바로 이것입니다. 폰트를 교체할 때 엑스하이트 차이를 고려해 크기를 미세 조정하지 않으면 디자인이 "왜 갑자기 작아 보이지?" 하는 일이 생깁니다.

데모는 같은 `font-size`에서 세리프(작은 x-height)와 산세리프(큰 x-height)를 오가며 소문자 영역의 높이 차이를 보여줍니다.

언제 쓰나

폰트를 교체할 때는 엑스하이트가 비슷한 대체 서체를 고르거나, `font-size`를 보정해서 체감 크기를 맞추세요.