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

The latest Label calculate Size seems not correct with some .ttf font #16399

Closed
halx99 opened this issue Aug 19, 2016 · 11 comments
Closed

The latest Label calculate Size seems not correct with some .ttf font #16399

halx99 opened this issue Aug 19, 2016 · 11 comments
Milestone

Comments

@halx99
Copy link
Contributor

halx99 commented Aug 19, 2016

  • cocos2d-x version: github latest
  • devices test on: Windows 10 14393.82 win32 program
  • developing environments
    • NDK version:
    • Xcode version:
    • VS version: 2013 or 2015
    • brower type and version:

Steps to Reproduce:

  1. Use latest cocosstudio to edit a demo UI with Label
  2. publish to .csb and load it, then the postion not correct because the contetSize of Label not be calculated correct.
  3. test cocosstudio project: http://halx99.oschina.io/releases/LabelBugTest.zip

CocosStudio Effect:
cocosstudioeffect

The latest Label render effect:
gameeffect

@halx99
Copy link
Contributor Author

halx99 commented Aug 19, 2016

@minggo please take a look, does this is a bug?

@minggo
Copy link
Contributor

minggo commented Aug 19, 2016

@halx99 sorry, cocos studio is canceled, we don't have resource to support it.

@halx99
Copy link
Contributor Author

halx99 commented Aug 19, 2016

@minggo Well, I think it's not cocosstudio problem, you also can reproduce this issue draw the border of the label, the render text will surpass right edge.

@minggo
Copy link
Contributor

minggo commented Aug 19, 2016

@halx99 could you please provide a test case? Thanks.

@halx99
Copy link
Contributor Author

halx99 commented Aug 19, 2016

ok, I will.

@halx99
Copy link
Contributor Author

halx99 commented Aug 19, 2016

@minggo The test case: https://github.com/halx99/cocos2d-x/tree/labelsizebugtest

My test result:
a _mrg6co5oa tkv 2n89 w

@minggo
Copy link
Contributor

minggo commented Aug 19, 2016

@halx99 i can not find the error from your pasted image. What does the red rectangle mean?

@halx99
Copy link
Contributor Author

halx99 commented Aug 19, 2016

@minggo The red rectangle is border of the label, normally all letters shoud at inner of the rectangle, you can see the last letter is surpassed a little.

@minggo
Copy link
Contributor

minggo commented Aug 19, 2016

Yep.

@dumganhar
Copy link

@halx99, I tested your demo and I could reproduced it.

@newnon has submitted a Pull Request #16689

After I applied @newnon's patch, this issue was fixed.

@halx99, could you try to apply that patch and test again? Thanks.

@halx99
Copy link
Contributor Author

halx99 commented Oct 13, 2016

@dumganhar ok, I will test it

@minggo minggo added this to the 3.14 milestone Oct 17, 2016
@minggo minggo closed this as completed Oct 17, 2016
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