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

[Text] Account for font leading so descenders are not clipped #96

Closed
wants to merge 1 commit into from
Closed

[Text] Account for font leading so descenders are not clipped #96

wants to merge 1 commit into from

Conversation

ide
Copy link
Contributor

@ide ide commented Feb 25, 2015

Prior to this diff, descenders (the hanging tail on letters like g and j) were clipped on the last line because the text measurer did not account for the font leading. With NSStringDrawingUsesFontLeading it honors the fonts line spacing.

To test: open the Text demo of the UIExplorer and see that the bottom of the letter g is no longer clipped off.

Before

Screenshot Before

After

Screenshot After

@ide
Copy link
Contributor Author

ide commented Mar 10, 2015

catping

@vjeux
Copy link
Contributor

vjeux commented Mar 10, 2015

Looks like a legit change. @a2?

@frantic
Copy link
Contributor

frantic commented Mar 22, 2015

@a2 @nicklockwood - could you guys please take a look? I think it's a legit change - I've seen this bug a lot. I haven't found anything obvious why we wouldn't want this in.
@ide - we started doing snapshot tests, please rebase your change on top of master.

@nicklockwood
Copy link
Contributor

Yes, this looks good to me. Please merge.

Prior to this diff, descenders (the hanging tail on letters like g and j) were clipped on the last line because the text measurer did not account for the font leading. With `NSStringDrawingUsesFontLeading` it honors the fonts line spacing.

To test: open the Text demo of the UIExplorer and see that the bottom of the letter g is no longer clipped off.

![Screenshot Before](https://cloud.githubusercontent.com/assets/379606/6364746/1c5527a0-bc60-11e4-8aeb-2147a6eb6596.png)

![Screenshot After](https://cloud.githubusercontent.com/assets/379606/6364747/1e9abe58-bc60-11e4-8c34-9f20ad8572ff.png)
@ide
Copy link
Contributor Author

ide commented Mar 23, 2015

@frantic is there anything else I need to do to update the snapshots?

@frantic
Copy link
Contributor

frantic commented Mar 23, 2015

@ide nope, thanks! Going to get this in via internal diff.

@frantic
Copy link
Contributor

frantic commented Mar 23, 2015

Landed internally. Thank you!

@frantic frantic closed this Mar 23, 2015
@ide ide deleted the text-measurement-descenders branch March 24, 2015 06:54
vjeux pushed a commit to vjeux/react-native that referenced this pull request Apr 13, 2015
Summary:
Prior to this diff, descenders (the hanging tail on letters like g and j) were clipped on the last line because the text measurer did not account for the font leading. With `NSStringDrawingUsesFontLeading` it honors the fonts line spacing.

To test: open the Text demo of the UIExplorer and see that the bottom of the letter g is no longer clipped off.

## Before

![Screenshot Before](https://cloud.githubusercontent.com/assets/379606/6364746/1c5527a0-bc60-11e4-8aeb-2147a6eb6596.png)

## After

![Screenshot After](https://cloud.githubusercontent.com/assets/379606/6364747/1e9abe58-bc60-11e4-8c34-9f20ad8572ff.png)
Closes facebook#96
Github Author: James Ide <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
vjeux pushed a commit to vjeux/react-native that referenced this pull request Apr 14, 2015
Summary:
Prior to this diff, descenders (the hanging tail on letters like g and j) were clipped on the last line because the text measurer did not account for the font leading. With `NSStringDrawingUsesFontLeading` it honors the fonts line spacing.

To test: open the Text demo of the UIExplorer and see that the bottom of the letter g is no longer clipped off.

## Before

![Screenshot Before](https://cloud.githubusercontent.com/assets/379606/6364746/1c5527a0-bc60-11e4-8aeb-2147a6eb6596.png)

## After

![Screenshot After](https://cloud.githubusercontent.com/assets/379606/6364747/1e9abe58-bc60-11e4-8c34-9f20ad8572ff.png)
Closes facebook#96
Github Author: James Ide <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
vjeux pushed a commit to vjeux/react-native that referenced this pull request Apr 15, 2015
Summary:
Prior to this diff, descenders (the hanging tail on letters like g and j) were clipped on the last line because the text measurer did not account for the font leading. With `NSStringDrawingUsesFontLeading` it honors the fonts line spacing.

To test: open the Text demo of the UIExplorer and see that the bottom of the letter g is no longer clipped off.

## Before

![Screenshot Before](https://cloud.githubusercontent.com/assets/379606/6364746/1c5527a0-bc60-11e4-8aeb-2147a6eb6596.png)

## After

![Screenshot After](https://cloud.githubusercontent.com/assets/379606/6364747/1e9abe58-bc60-11e4-8c34-9f20ad8572ff.png)
Closes facebook#96
Github Author: James Ide <[email protected]>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
harrykiselev pushed a commit to harrykiselev/react-native that referenced this pull request Aug 5, 2015
react-one pushed a commit to react-one/react-native that referenced this pull request Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants