Discrepancy in leading space rendering of layoutText #19

Closed
jamie-threerings opened this Issue Mar 28, 2013 · 3 comments

Comments

Projects
None yet
3 participants
@jamie-threerings
Contributor

jamie-threerings commented Mar 28, 2013

This is pretty easy to observe in the demo. Choose "Text Test" and click to enter a string with leading and trailing spaces, like " A ". Under java, just the "A" is rendered. Under ios, the " A" is rendered. Is it possible to make this consistent? It's causing problems for me in a styled text renderer in my app.

I'd prefer to include spaces in all rendering since that would allow the best control. Otherwise, I'd need to somehow measure a space and do special extra stuff during laying out each chunk, not pretty.

@roguenet

This comment has been minimized.

Show comment
Hide comment
@roguenet

roguenet Mar 28, 2013

Contributor

My only initial problem with the included spacing preference is that typically a user will write bold HTML text as "here is a bunch of text, only some of which is bold." The bolded text in that example needs a little extra space around it than normal text, but the person writing the formatted text isn't going to be thinking about that, and you're going to end up with bold text snuggled up too close to normal text.

Contributor

roguenet commented Mar 28, 2013

My only initial problem with the included spacing preference is that typically a user will write bold HTML text as "here is a bunch of text, only some of which is bold." The bolded text in that example needs a little extra space around it than normal text, but the person writing the formatted text isn't going to be thinking about that, and you're going to end up with bold text snuggled up too close to normal text.

@samskivert

This comment has been minimized.

Show comment
Hide comment
@samskivert

samskivert Mar 28, 2013

Member

Text layout and rendering is a morass of ill specified and dubiously implemented functionality (on every platform). There's nothing in PlayN's Java layout and rendering code that is stripping off whitespace. So something deep in the bowels of Java is doing it. PlayN can't fix that for you.

Member

samskivert commented Mar 28, 2013

Text layout and rendering is a morass of ill specified and dubiously implemented functionality (on every platform). There's nothing in PlayN's Java layout and rendering code that is stripping off whitespace. So something deep in the bowels of Java is doing it. PlayN can't fix that for you.

@samskivert samskivert closed this Mar 28, 2013

@samskivert

This comment has been minimized.

Show comment
Hide comment
@samskivert

samskivert Mar 28, 2013

Member

I take that back. It looks like the code that PlayN uses to work around font rendering discrepancies is causing problems when you have leading whitespace. Yay Java. I'll see what I can do.

Member

samskivert commented Mar 28, 2013

I take that back. It looks like the code that PlayN uses to work around font rendering discrepancies is causing problems when you have leading whitespace. Yay Java. I'll see what I can do.

@samskivert samskivert reopened this Mar 28, 2013

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