Art, design & a little curiosity
Typography ↗

Optical margin alignment: tune the edge around type

Use optical margin alignment to judge how punctuation and angled letterforms shape a text block’s edge. Compare a page-layout setting with CSS hanging punctuation, and test the result at the size readers will see.

Original abstract visual study for typography.
Original visual study / Typography

A mathematically straight edge can look uneven

A text frame can align every character box to one vertical guide and still appear ragged. A comma or quotation mark has relatively little dark ink near its edge; an angled letter such as A or W may also leave more white space beside its outline than a straight stem does. The eye reads the visible shapes, not the invisible boxes around them. Optical margin alignment lets selected marks extend slightly beyond a text boundary so the visible edge can feel more even.

This is a small correction to a particular composition, not a rule that every page needs. It is most noticeable in a narrow column, a short quotation, or a display setting where a few glyphs define the silhouette. In a wide ragged-right paragraph, the irregular line endings may be part of the texture already. Decide by looking at the whole block and its neighbor, rather than treating every punctuation mark as an error.

Keep the page-layout and browser methods distinct

Adobe InDesign’s Optical Margin Alignment is a story-level setting. Its instructions recommend matching the setting’s size value to the body text and allow a paragraph-level override. That makes it useful for a multi-frame print story: the adjustment follows the story, while an exceptional paragraph can opt out. Inspect the first and last lines as well as the body; a pull quote, list, or caption may need a different decision from continuous prose.

CSS defines a separate hanging-punctuation property for punctuation at line edges. Its values describe opening marks at the start, closing marks at the end, or stops and commas at line endings. The W3C CSS Text Level 3 document is a Candidate Recommendation Draft, and lists this property as at risk; that is a standards status, not a statement that every browser implements it. Treat the CSS rule as a progressive enhancement: keep ordinary text layout sound without it, check target browsers, and watch for overflow when the container lacks room. A browser property does not reproduce all of a desktop layout program’s optical treatment of angled letters.

Compare the visible ink, not just the guide

Make two copies of one short text block. Use the same typeface, size, measure, line spacing, and words in both. In the first, align the text frame conventionally. In the second, enable the layout program’s optical margin feature or, for a browser-only trial, test the supported CSS behavior. Keep the left and right frame guides visible while judging the result, then hide them and compare the perceived edge. Guides reveal where the boxes sit; hiding them reveals whether the adjustment actually improves the composition.

Use more than one line ending. A short sample such as an opening quote followed by a sentence can show the left edge; a paragraph with a comma or period near the right edge can show the other side. Do not add spaces or manually drag individual glyphs before the first comparison, because those changes can mask what the setting does. Afterward, inspect small text at its intended size and a larger setting separately. If the adjustment creates an awkward jut or makes a line feel detached from the frame, disable it for that text.

Make the exception part of the system

Optical alignment changes the relationship between the text’s ink and the frame edge. It should not change the reading order, clip a mark, or force a new line break merely to make a guide look tidy. Check the spread or screen at realistic scale, including the neighboring column, image, or rule. The edge may read better on its own but feel too loose beside a hard boundary. Where consistency matters across many pages, record which paragraph styles use the adjustment and why. A documented exception is easier to maintain than a one-off nudge that disappears in the next revision.

Put it into practice

Try it yourself

  1. Choose a short paragraph or quotation with visible commas, stops, or angled capitals; record its typeface, size, measure, and line spacing.
  2. Duplicate it without changing the text or frame. Keep the margin guides visible and apply optical margin alignment to only one copy.
  3. Compare the first and last line edges with guides visible, then hide the guides and judge the text block beside its surrounding layout.
  4. For web text, test hanging-punctuation only as progressive enhancement. Check the actual target browsers, narrow widths, and overflow; preserve a good default layout.
  5. Keep the adjustment only where it improves the whole composition. Record any paragraph-level exception and revisit it after font, size, or measure changes.
A worked example

Worked example: a fictional gallery introduction

Imagine a two-column page introducing a fictional exhibition called “Paper, Folded.” The opening paragraph begins with an opening quotation mark, and a later line ends with “surface.” Duplicate the paragraph in the same typeface and size. In the print-layout version, apply Optical Margin Alignment to the story, then compare the quotation and period with the column guides. If the opening quote sits more comfortably outside the left guide but the ending period seems to detach from the narrow measure, keep the story setting for the opening and use the documented paragraph override for the closing block only if the page system supports that distinction. In a web mockup, try hanging-punctuation: first; on the quotation block only after checking target browsers and edge overflow. This is a fictional specimen for visual practice, not a tested browser-compatibility result or a claim that readers prefer one setting.

References & further reading

Examples and exercises in this guide are original teaching scenarios.

Keep following the thread.

More typography ↗
Typography5 min read

Build a responsive type scale and test the reading rhythm

Create a small editorial specimen with a deliberate type hierarchy, then test its proportions at narrow widths, larger text sizes, and user-adjusted spacing. Treat the scale as a set of relationships that must survive change, not a row of fixed numbers.