Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve quo2 text component #13793

Closed
Parveshdhull opened this issue Aug 10, 2022 · 8 comments
Closed

Improve quo2 text component #13793

Parveshdhull opened this issue Aug 10, 2022 · 8 comments

Comments

@Parveshdhull
Copy link
Member

Parveshdhull commented Aug 10, 2022

1. letter-spacing

Letter spacing currently used by the component doesn't match with letter spacing for Figma design.
And looks like small changes in letter spacing are not affecting the text component.
Formula used by Figma for letter spacing: formula (ref)
Heading-1/Regular
Screenshot

2. Line Height:

The line height currently used by the component doesn't match with line height from the Figma design
Paragraph-2/Regular
Screenshot

[Original image]
Screenshot

@yqrashawn
Copy link
Member

  1. Line Height:

H @Parveshdhull I compared Paragraph-2/Regular and can't find line height difference.

CleanShot 2022-09-09 at 14 35 23@2x

@Parveshdhull
Copy link
Member Author

hi @yqrashawn,
Thank you very much for looking into this.
Please can you try with 5-10 lines? Small line heights difference might not be visible, but they add up to a big difference with multiple lines.

@yqrashawn
Copy link
Member

image

There's indeed mismatch. I'll check.

Line 1
image

Line 10
image

@cammellos
Copy link
Member

Closing for now due to inactivity

@Parveshdhull
Copy link
Member Author

reopening issue (#16981 (review))

@Parveshdhull
Copy link
Member Author

related PR #13960, and related discussion #13960 (comment)

@yqrashawn
Copy link
Member

add more info here
we use inter font, and it has this thing called Dynamic Metrics http://rsms.me/inter/dynmetrics/
it's a formula that calculates letter spacing based on font size

merged PR #13960 fixed the formula in our code

yet, quo2 text component is different from figma design

A is figma design
B is screen shot from http://rsms.me/inter/dynmetrics/
C is quo2 text component screenshot on ios, not tested on android

you can see B and C are identical, which means quo2 text implementation is the same as the Inter font recommended dynamic metrics implementation
the calculated letter spacing value always looks like 0.31585560420509633% and figma round it to 0.32%, which might be the reason A is not the same as B/C

CleanShot 2023-08-22 at 10 00 03

@yqrashawn
Copy link
Member

this might help https://www.figma.com/community/plugin/795733302011238428/Inter-Letter-Spacing
Inter Letter Spacing figma plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants