Uh oh!
There was an error while loading. Please reload this page.
Add letterSpacing style property for Text - #482
Conversation
frantic
commented
Mar 30, 2015
Restarted the Travis build. @a2 / @nicklockwood - what do you think? |
brentvatne
commented
Mar 30, 2015
👍 - I'd love to see this get merged |
There was a problem hiding this comment.
This is a tiny nit, but I would move this to after the line that adds the NSFontAttributeName attribute to maintain consistency but that's really the only thing I have against this. Looks good otherwise! 👍
06e01e6 to
d1451feComparevkurchatkin
commented
Mar 30, 2015
@a2 thank you, fixed the nit |
vjeux
commented
Mar 30, 2015
Hey, can you make sure it actually follows the same behavior as CSS. Example, can you run this in React Native, take a screenshot and make sure it looks pixel perfect: If you want to try a different font: http://iosfonts.com/ |
vjeux
commented
Mar 30, 2015
It is super important that any feature which has the same name as CSS does actually work exactly the same as CSS, otherwise it makes debugging a lot hard and confuses developers. |
vkurchatkin
commented
Mar 30, 2015
@vjeux here is what I get: The code: return(<Viewstyle={{flex: 1,backgroundColor: 'white'}}><Viewstyle={{flex: 1,justifyContent: 'flex-end',alignItems: 'flex-start'}}><Textstyle={{fontFamily: 'Copperplate',letterSpacing: 5,fontSize: 10}}>
This is <Textstyle={{letterSpacing: 0}}>a text with a lot</Text> of spaces
</Text></View><Viewstyle={{flex: 1,backgroundColor: 'blue'}}><WebViewurl="http://localhost:8082/"renderLoading={()=><View/>}renderError={()=><View/>}/></View></View>);}Html: <!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title></title></head><bodystyle="padding: 0; margin: 0"><spanstyle="font-family: Copperplate; letter-spacing: 5px; font-size: 10px;">
This is <spanstyle="letter-spacing:0">a text with a lot</span> of spaces
</span></body></html> |
vjeux
commented
Mar 30, 2015
Can you also check what's the behavior for negative spacing? Thanks a lot for making sure it's the same |
vkurchatkin
commented
Mar 30, 2015
vkurchatkin
commented
Mar 31, 2015
There is the last nasty problem: width calculation. One the web letter spacing affects width, both positive and negative. Negative letter spacing makes width less than required to display text, but it is not clipped according to this width (even with all kinds of |
vkurchatkin
commented
Mar 31, 2015
Pushed a fix for this problem, now behaves exactly the same way |
There was a problem hiding this comment.
nit: can you add a trailing comma
brentvatne
commented
Apr 1, 2015
Great work @vkurchatkin - looking forward to putting this to use! |
869bdb7 to
f3f0828Comparevkurchatkin
commented
Apr 1, 2015
@vjeux all done |
chirag04
commented
Apr 2, 2015
Awesome work @vkurchatkin - I badly want to see this getting merged. |
vkurchatkin
commented
Apr 9, 2015
@vjeux ping |
nicklockwood
commented
Apr 9, 2015
This looks good to me. Not sure what's holding it up. I'll check. |
ide
commented
May 8, 2015
+1 |
brentvatne
commented
May 11, 2015
@nicklockwood any update? |
nicklockwood
commented
May 12, 2015
Sorry about the radio silence. There were a few issues merging - notably this broke the UIExplorer snapshot tests because the default letterSpacing value of 0 is not pixel-for-pixel identical to having no letterSpacing set at all (it disables iOS's per-character smart kerning). Anyway, that's fixed now, and I've merged this internally so it should be appearing on GitHub real soon. |
brentvatne
commented
May 12, 2015
🌴 that's great, thanks! |


Fixes#457