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

Discrepancy in leading space rendering of layoutText #19

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

Discrepancy in leading space rendering of layoutText #19

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

Comments

@jamie-threerings
Copy link
Contributor

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
Copy link
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.

@samskivert
Copy link
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.

@samskivert
Copy link
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.

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

No branches or pull requests

3 participants