carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Insufficient Line heights in Carbons Typography

Open johnjesse opened this issue 4 years ago β€’ 8 comments

Insufficient Line heights in Carbons Typography

Detailed description

The line-heights defined in the carbon typography page here - https://www.carbondesignsystem.com/guidelines/typography/overview struggle with text that includes large descenders and ascenders. Typically text with large ascenders or descenders are accented letters - (the case is worse when the letters are capitals) - or specical characters - for instance emoji

This can cause issues where

  • Text is overflowing the container boundary
  • lines of text overlap

Steps to reproduce the issue

See code sandbox here - https://codesandbox.io/s/carbon-typography-issues-hd924?file=/src/index.js - this is a contrived example just using letters - but it illustrates that most Carbon type styles have the issue - the only ones that don't appear to be

  • body-long-02
  • expressive-heading-02

This feels like a big issue -> surely all the line-heights should be coping with the text including long ascenders and descenders

here are a couple examples of the issues image image image

johnjesse avatar Sep 07 '20 10:09 johnjesse

cc @jeanservaas @aagonzales curious what you all think the next steps should be here, or if we should meet together to talk about this and figure it out together πŸ‘€

joshblack avatar Jun 01 '21 15:06 joshblack

FYI - we did a bit of our own investigation for this - the main issues appear to happen in the plex fonts for the capital letters with double accents - whilst most languages don't use these characters, they are more often used in tonal languages

Having said that - one that does this is Vietnamese e.g. https://vietnamesetypography.com/tone-marks/

We were unable to find other languages that caused the same issues (but hadn't done an exhaustive search) - so we moved to a line-height of 1.5 everywhere, which works for everything except capital letters with double accents - with the known issue that Vietnamese would cause our UI issues.

johnjesse avatar Jun 01 '21 17:06 johnjesse

I haven't fully read this issue but just want to make a note that changing line heights will affect a lot of internal padding across components. Changing line height everywhere from 1.25 to 1.5 may seem like a small thing but it could have big ripples.

aagonzales avatar Jun 01 '21 21:06 aagonzales

Also if its a problem with the typeface itself we are in a unique place to be able to influence and change the fonts. Maybe this is also an issue for the IBM Plex repo. https://github.com/IBM/plex/issues

Quickly brought this up with @mjabbink and he thinks this issue may have been resolved with the latest update to IBM Plex that @vpicone is about to push out.

aagonzales avatar Jun 01 '21 21:06 aagonzales

Vertical heights will need to be defined per use case. Vietnamese may require more line-height compared to Latin due to the double accents. The same issue will come up for usage with Plex Devanagari, and Japanese for example.

mjabbink avatar Jun 01 '21 21:06 mjabbink

Screen Shot 2021-06-01 at 4 52 04 PM

mjabbink avatar Jun 01 '21 21:06 mjabbink

Body long will probably cover the taller vertical heights required in a few non-Latin scripts like Japanese, Korean, and Devanagari. We should probably double-check this for body copy because we may need to have a similar construct for those. i.e long becomes the β€œshort” version for those scripts and we add an extralong (if you will) for the body copy in those scripts.

Screen Shot 2021-06-01 at 5 02 11 PM

mjabbink avatar Jun 01 '21 22:06 mjabbink

Actually, I think this is not a Plex issue so no need to recreate the issue there.

mjabbink avatar Jun 01 '21 22:06 mjabbink

if someone uses Vietnamese, you're going to have to bump the line-height.

sstrubberg avatar Nov 28 '22 16:11 sstrubberg

@sstrubberg Do you have a link to any information about the completion of this?