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

Fix android letter spacing #9420

Closed
wants to merge 4 commits into from

Conversation

tim-ford
Copy link

Motivation for this fix is to get "letterSpacing" property in styles to work on Android (for the most part - there are non working edge cases potentially - primary use case seems fine)

Test plan (required)
Tested using:
letterSpacing: -6,
fontSize:24,
fontFamily:'ionicons',

Good Stars
goodstars

Bad Stars
badstars

@ghost
Copy link

ghost commented Aug 16, 2016

By analyzing the blame information on this pull request, we identified @MengjueW and @rigdern to be potential reviewers.

@ghost
Copy link

ghost commented Aug 16, 2016

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@ghost
Copy link

ghost commented Aug 16, 2016

@tim-ford updated the pull request.

@ghost
Copy link

ghost commented Aug 16, 2016

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 16, 2016
@nihgwu
Copy link
Contributor

nihgwu commented Aug 16, 2016

awesome

@ghost
Copy link

ghost commented Aug 16, 2016

@tim-ford updated the pull request.

@ghost
Copy link

ghost commented Aug 16, 2016

@tim-ford updated the pull request - view changes

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 16, 2016
@munzur
Copy link

munzur commented Sep 3, 2016

Any update on this?

int fontSize = update.getFontSize();
if (!FloatUtil.floatsEqual(mLetterSpacing, nextLetterSpacing)) {
mLetterSpacing = nextLetterSpacing;
if(Float.isNaN(mLetterSpacing)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: space after if

@mkonicek
Copy link
Contributor

mkonicek commented Sep 8, 2016

Thanks for adding this!

In the Test plan, could you please show screenshots of text that has no letterSpacing set (should be unchanged), and a few examples of text with a few different values of letterSpacing set?

This PR sets the letter spacing in setText - what's the reason of doing it there rather than in setLetterSpacing?

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 8, 2016
@ghost
Copy link

ghost commented Sep 25, 2016

@tim-ford do you have any updates for this pull request? It's been a while since the last update so wanted to check in and see if you've looked at the requested changes.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 25, 2016
@belohlavek
Copy link

Will this be compatible with API 19+?
How long until it gets implemented?

@tim-ford
Copy link
Author

the formula and fixes work -- the formula was researched on the web for PX to EM conversions since Android does letterSpacing in EM -- the reason this hasn't gone anywhere is: not sure why it fails the tests -- since everything works fine in a functional App

@tim-ford
Copy link
Author

Also have updated fork to 35-stable -- not sure how to bring in those adjustments so the files can no longer in conflice

@hubciorz
Copy link

Any news on this, guys?

@lacker
Copy link
Contributor

lacker commented Oct 25, 2016

@tim-ford Are the tests failing for you locally too, or do you think it's something going wrong with CircleCI? I am not sure what you mean exactly when you say "not sure why it fails the tests"

@tim-ford
Copy link
Author

its been a couple of weeks since looking -- I have already released an application with this fix in it, the fix is fine -- updates have occurred since that will require some adjustments to code placement -- It seemed like an issue with CI at the time

@lacker
Copy link
Contributor

lacker commented Oct 25, 2016

The test errors do look related to spacing on Android so it at least isn't obvious to me that it's a flaky CI problem. But take a look and see if you agree with my take. Also fixing the merge conflicts should "kick" the CI to run again anyway.

@facebook-github-bot
Copy link
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@hramos
Copy link
Contributor

hramos commented Nov 7, 2016

Importing to see if our internal tests pass. It does seem like there are some conflicts that need to be resolved before we can merge this though.

@hramos
Copy link
Contributor

hramos commented Nov 10, 2016

@tim-ford can you resolve the conflicts?

@julesmoretti
Copy link

Would love this feature request to be resolved :)

@lacker
Copy link
Contributor

lacker commented Dec 14, 2016

It seems like this pull request has been abandoned. I'm going to close it but if you are still interested in working on this please feel free to reopen!

@jkomyno
Copy link

jkomyno commented Mar 24, 2017

Why was this pull request abandoned?

@christoph-jerolimov
Copy link
Contributor

Checkout #13199. I implemented letterSpacing based on this PR, but also solve that the layout was calculated correctly, which was missed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.