font-feature-settings

폰트 기능 설정

A low-level CSS property that turns OpenType feature tags on or off by string, for features that have no dedicated named property — stylistic sets, character variants, and the like.

Also known as: 저수준 OpenType 속성
···
html
<div class="stage">
  <div class="tagrow" id="tagrow"></div>
  <div class="readout" id="readout">측정 중…</div>
</div>
css
.stage{display:grid;gap:12px;justify-items:center;width:min(94%,480px)}
.tagrow{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}
.tag{font:11px ui-monospace,Menlo,monospace;padding:4px 8px;border-radius:6px;border:1px solid var(--line);color:var(--muted)}
.tag.on{border-color:var(--accent);color:var(--accent)}
.tag.off{border-color:var(--line);color:var(--muted);opacity:.5}
.readout{font:10px ui-monospace,Menlo,monospace;color:var(--muted);text-align:center}
js
const probe = document.createElement('span');
probe.style.cssText = 'position:absolute;visibility:hidden;white-space:nowrap;font:20px -apple-system,system-ui,sans-serif';
probe.textContent = '0 1/2 1st';
document.body.appendChild(probe);
function widthWith(setting){
  probe.style.fontFeatureSettings = setting;
  return probe.getBoundingClientRect().width;
}
const base = widthWith('normal');
const tests = [
  { tag: 'zero', setting: '"zero" 1' },
  { tag: 'frac', setting: '"frac" 1' },
  { tag: 'ordn', setting: '"ordn" 1' },
];
const tagrow = document.getElementById('tagrow');
const readout = document.getElementById('readout');
let onCount = 0;
tests.forEach(function(t){
  const w = widthWith(t.setting);
  const active = Math.abs(w - base) > 0.4;
  if (active) onCount++;
  const el = document.createElement('span');
  el.className = 'tag ' + (active ? 'on' : 'off');
  el.textContent = '"' + t.tag + '" 1' + (active ? ' ✓' : ' —');
  tagrow.appendChild(el);
});
readout.textContent = onCount + '/' + tests.length + '개 태그에서 폭 변화 실측됨 (0=off 기준 비교, 폰트마다 다름)';

`font-feature-settings` takes a comma-separated list of `"tag" integer` pairs (e.g. `"liga" 1, "case" 1`). Most tags are 0 or 1 for off/on, but a character-variant tag like `cv01`, which picks among several alternates, can take a larger integer like 2 or 3.

The spec recommends using a named high-level property — `font-variant-ligatures`, `font-variant-numeric`, `font-variant-caps` — whenever a feature has one, since the browser can reconcile it more predictably with other styling rules. `font-feature-settings` is the escape hatch reserved for features with no named property at all.

When both are set on the same element, the named `font-variant-*` property wins — a feature turned off via `font-feature-settings` gets turned back on by `font-variant-ligatures: common-ligatures`. The demo flips a few uncommon tags (`zero`, `frac`, `ordn`) with this low-level property and measures, live, which ones actually change rendered width in the system font.

When to use

Reserve it for features with no named property at all — stylistic sets, character variants, font-specific tags. Kerning, ligatures, and numeral styles all have named properties that are safer to use instead.