Bird
Raised Fist0
Figmabi_tool~10 mins

Font size and line height in Figma - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the font size to 16 pixels in Figma.

Figma
textNode.fontSize = [1]
Drag options to blanks, or click blank then click option'
A16px
B'16px'
C16
Dsize16
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like '16px' instead of a number.
Including units like 'px' in the value.
2fill in blank
medium

Complete the code to set the line height to 24 pixels in Figma.

Figma
textNode.lineHeight = [1]
Drag options to blanks, or click blank then click option'
A24
B'24px'
ClineHeight24
D24px
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like '24px' instead of a number.
Adding units like 'px'.
3fill in blank
hard

Fix the error in the code to correctly set font size to 18 pixels.

Figma
textNode.fontSize = [1]
Drag options to blanks, or click blank then click option'
A18px
B18
CfontSize18
D'18px'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string with 'px' units.
Including units in the value.
4fill in blank
hard

Fill both blanks to set font size to 20 and line height to 28 pixels.

Figma
textNode.fontSize = [1]
textNode.lineHeight = [2]
Drag options to blanks, or click blank then click option'
A20
B28
C'28px'
D'20px'
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings with 'px' units.
Mixing numbers and strings.
5fill in blank
hard

Fill all three blanks to set font size to 14, line height to 21, and assign the font family 'Roboto'.

Figma
textNode.fontSize = [1]
textNode.lineHeight = [2]
textNode.fontName = [3]
Drag options to blanks, or click blank then click option'
A14
B21
C{ family: 'Roboto', style: 'Regular' }
D'Roboto'
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings for fontSize or lineHeight.
Assigning fontName as a string instead of an object.

Practice

(1/5)
1. What does font size control in Figma?
easy
A. The color of the text
B. The space between lines of text
C. How big the text appears on the screen
D. The font style like bold or italic

Solution

  1. Step 1: Understand font size meaning

    Font size determines how large or small the text looks visually.
  2. Step 2: Differentiate from line height

    Line height controls spacing between lines, not size of text.
  3. Final Answer:

    How big the text appears on the screen -> Option C
  4. Quick Check:

    Font size = Text size [OK]
Hint: Font size = text height, line height = space between lines [OK]
Common Mistakes:
  • Confusing font size with line height
  • Thinking font size changes text color
  • Mixing font size with font style
2. Which of the following is the correct way to set font size and line height in Figma's text properties panel?
easy
A. Font size as a percentage, line height in pixels only
B. Font size in pixels, line height as a number or percentage
C. Both font size and line height only accept percentages
D. Font size and line height cannot be changed in Figma

Solution

  1. Step 1: Check Figma text property inputs

    Font size is set in pixels (px) for exact text height.
  2. Step 2: Understand line height input

    Line height can be set as a number (like 24) or percentage (like 150%).
  3. Final Answer:

    Font size in pixels, line height as a number or percentage -> Option B
  4. Quick Check:

    Font size = px, line height = number or % [OK]
Hint: Font size uses px, line height can be px or % [OK]
Common Mistakes:
  • Trying to set font size as a percentage
  • Assuming line height only accepts pixels
  • Believing font size and line height cannot be changed
3. If a text block has a font size of 16px and a line height of 24px in Figma, what is the space between the lines of text?
medium
A. 8px
B. 24px
C. 16px
D. 40px

Solution

  1. Step 1: Understand line height vs font size

    Line height is total height of each line including text and space.
  2. Step 2: Calculate space between lines

    Space = line height - font size = 24px - 16px = 8px.
  3. Final Answer:

    8px -> Option A
  4. Quick Check:

    Line height - font size = space [OK]
Hint: Subtract font size from line height for spacing [OK]
Common Mistakes:
  • Confusing line height as only the space
  • Using font size instead of difference
  • Adding font size and line height
4. You set a font size of 18px and line height of 14px in Figma. What issue will this cause?
medium
A. Font size will automatically adjust to 14px
B. Text will be too spaced out
C. No issue, this is a valid setting
D. Lines will overlap because line height is less than font size

Solution

  1. Step 1: Compare font size and line height values

    Font size is 18px, line height is smaller at 14px.
  2. Step 2: Understand effect of smaller line height

    Line height less than font size causes lines to overlap visually.
  3. Final Answer:

    Lines will overlap because line height is less than font size -> Option D
  4. Quick Check:

    Line height < font size = overlap [OK]
Hint: Line height must be ≥ font size to avoid overlap [OK]
Common Mistakes:
  • Thinking font size adjusts automatically
  • Assuming no problem if line height is smaller
  • Confusing line height with letter spacing
5. You want to design a dashboard with text that is easy to read on all screen sizes. Which combination of font size and line height is best practice in Figma?
hard
A. Font size 14px with line height 20px for good spacing
B. Font size 10px with line height 10px for compact text
C. Font size 18px with line height 14px to save space
D. Font size 12px with line height 12px for uniformity

Solution

  1. Step 1: Consider readability on screens

    Font size 14px is readable; line height 20px gives enough space between lines.
  2. Step 2: Evaluate other options

    Options with line height equal or less than font size cause cramped or overlapping text.
  3. Final Answer:

    Font size 14px with line height 20px for good spacing -> Option A
  4. Quick Check:

    Readable font + enough line height = best practice [OK]
Hint: Choose line height about 1.4x font size for readability [OK]
Common Mistakes:
  • Picking line height equal to or less than font size
  • Choosing too small font size for screens
  • Ignoring line height impact on readability