Skip to content
NewTemplates & toolkits are on the way — join the waitlist
Hecham Gazhi

UI Design · Lesson 06 / 12

Typography in UI

Type anatomy, choosing and pairing typefaces, building a type scale, line height, line length, letter spacing, text styles, alignment and designing for Arabic and multilingual interfaces.

5 min read · 5 quiz questions

Why typography matters

Most interfaces are mostly text: labels, buttons, headings, descriptions, data. Typography — how that text is set — shapes readability, hierarchy and personality more than almost any other choice. Get it right and an interface can look polished with very little else.

Type anatomy

TermMeaning
Typeface vs fontA typeface is the design (Inter); a font is one specific style of it (Inter Semibold 16px)
Serif / sans-serifSerifs are small strokes at the ends of letters; sans-serif fonts don't have them
x-heightThe height of lowercase letters like 'x'. A large x-height reads better at small sizes
BaselineThe invisible line letters sit on
Ascender / descenderParts that rise above the x-height (h, d) or drop below the baseline (g, p)
WeightThickness of strokes: Light 300, Regular 400, Medium 500, Semibold 600, Bold 700
Leading (line height)Vertical distance between lines of text
Tracking (letter spacing)Uniform space between all letters
KerningSpace between specific pairs of letters (AV, To)

Choosing typefaces

Pairing fonts

One family is often enough for a whole product, using weight and size for hierarchy. If you pair two, make them clearly different in role — e.g. a characterful serif for headings and a neutral sans-serif for body — and limit yourself to two.

  • Readability first. For UI text, choose a typeface designed for screens, with a generous x-height and clear letter shapes (I, l and 1 shouldn't look identical).
  • Enough weights. You'll typically need Regular, Medium/Semibold and Bold.
  • Language support. If your product supports Arabic, choose fonts with good Arabic designs (e.g. IBM Plex Sans Arabic, Noto Sans Arabic, Cairo, Tajawal) and pair them with a matching Latin font.
  • Licensing and performance. Check the licence and keep the number of font files small — each weight is another download.
  • System fonts (San Francisco on Apple, Roboto on Android, Segoe UI on Windows) are fast, familiar and highly readable — a good default for many apps.

Building a type scale

A type scale is a limited set of sizes used across the product. A common approach is a modular scale: start with a base size (16px) and multiply by a ratio. With 1.25 (the "major third"), you get 16, 20, 25, 31, 39, 49…

RatioNameFeel
1.125Major secondSubtle; good for dense apps and dashboards
1.2Minor thirdBalanced; common for product UIs
1.25Major thirdClear hierarchy; websites and apps
1.333Perfect fourthStrong contrast; editorial and marketing pages

Live preview

display · 49pxDesign systems
h1 · 39pxDesign systems
h2 · 31pxDesign systems
h3 · 25pxDesign systems
body-lg · 20pxDesign systems
body · 16pxDesign systems
caption · 13pxDesign systems

Ratio 1.25 (major third) from a 16px base.

You don't have to follow a ratio exactly. Round values to whole pixels and adjust where needed — the point is to have few, clearly different sizes.

Line height, line length and spacing

Line height

  • Body text: about 1.4–1.6 times the font size.
  • Headings: tighter, about 1.1–1.3, because large text with loose line height looks disconnected.
  • Use line heights that fit your spacing scale (e.g. 24px for 16px text).

Line length

Aim for 45–75 characters per line for comfortable reading. Very long lines make it hard to find the start of the next line; very short ones break the rhythm.

Letter spacing

  • Large headings often look better with slightly negative tracking (e.g. −1% to −2%).
  • Small uppercase labels need positive tracking (e.g. +5% to +10%) to stay legible.
  • Never add letter spacing to Arabic — it breaks the connections between letters.

Text styles by role

Define a small set of named text styles and use only those. Name them by role, not by size, so sizes can change without renaming everything.

  • Body text on the web is usually 16px; avoid going below 14px for anything people need to read, and 12px only for short captions.
  • Use rem units in code so text respects the user's browser font-size setting.
  • Use weight and size for hierarchy — not underline (it looks like a link) and not ALL CAPS for long text (harder to read).
Examplecss
/* font: weight size/line-height family */
--text-display:  600 3rem/1.1    var(--font-sans);   /* 48/53 */
--text-h1:       600 2rem/1.2    var(--font-sans);   /* 32/38 */
--text-h2:       600 1.5rem/1.25 var(--font-sans);   /* 24/30 */
--text-h3:       600 1.25rem/1.3 var(--font-sans);   /* 20/26 */
--text-body:     400 1rem/1.5    var(--font-sans);   /* 16/24 */
--text-small:    400 0.875rem/1.45 var(--font-sans); /* 14/20 */
--text-caption:  500 0.75rem/1.35 var(--font-sans);  /* 12/16 */

Alignment and formatting

  • Left-align text in left-to-right languages; right-align in Arabic and Hebrew.
  • Centre only short text: headings, empty states, buttons.
  • Avoid justified text on screens — it creates uneven gaps ("rivers").
  • Use tabular (monospaced) numbers in tables and prices so digits line up.
  • Avoid widows (a single word on the last line of a heading) by adjusting wording or using text-wrap: balance.

Typography for Arabic and multilingual UI

  • Arabic script is connected and has different vertical proportions; it often needs a slightly larger size and more line height than Latin text at the same visual weight.
  • Choose Arabic and Latin fonts designed to work together, with similar weight and x-height.
  • Mirror the layout for right-to-left (text alignment, icons with direction, navigation order), but keep numbers and code left-to-right.
  • Test with real translations: German words are long, Arabic text may be shorter or longer, and both can break tight layouts.

Common mistake: Designing only in English and "translating later". Truncated labels, overlapping text and broken RTL layouts are much harder to fix after development.

Key takeaways

  • Typography drives readability, hierarchy and personality in text-heavy interfaces.
  • Choose screen-friendly typefaces with the weights and languages you need; one or two families is enough.
  • Use a limited type scale, 1.4–1.6 line height for body text and 45–75 characters per line.
  • Name text styles by role, use rem units, and keep body text around 16px.
  • Arabic needs suitable fonts, more line height, no letter spacing and mirrored layouts.

Exercise

Create a type system

  1. Pick one typeface (and an Arabic companion if needed).
  2. Generate a type scale from 16px with a ratio of 1.2 or 1.25.
  3. Define 7 text styles from display to caption, with line heights.
  4. Design an article page and a settings screen using only those styles.
  5. Check every line length and adjust the content width if needed.

Test yourself

Typography in UI quiz

5 questions. Score 70% or more to complete the lesson.

  1. 1.What's a typical body text size on the web?
  2. 2.What line height suits body text?
  3. 3.Which is a better text style name?
  4. 4.Why avoid letter spacing on Arabic text?
  5. 5.Why use tabular numbers in tables?