Search Unity

5.3 Text component, vertical placement not correct?

Discussion in 'UGUI & TextMesh Pro' started by eses, Dec 8, 2015.

  1. muzzythom

    muzzythom

    Joined:
    Dec 1, 2014
    Posts:
    17
    I currently see an issue (less extreme than mentioned here) when using Dynamic fonts. Switching to Unicode, makes the problem substantially worse, and reimporting does not fix it. The only workaround I can find is to resize the text object, which is not a good solution IMO (especially if a future patch would mean I'd have to revert everything back to the correct sizes.

    Here's 5.2 (correct)
    5.2-goodfont-2.PNG

    and 5.3 (incorrect)
    5.3-badfont.png

    The text baseline in 5.3 seems to be around where the text center was in 5.2. Adjusting the vertical alignment only moves it by a couple pixels, if at all.

    Is this the same issue and will it be fixed in the upcoming patch? (If not I'll make a new thread)
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,291
    It sounds like the same issue but I cant say for sure without seeing your project.
     
  3. dakka

    dakka

    Joined:
    Jun 25, 2010
    Posts:
    113
    @Karl thanks for the updates. Any news on when this will make it into a patch or release ?
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,291
    Cant really say until its landed in our mainline, once that happens then its a quick process. If it lands this week then its feasible that it could be in the week after. But that's just a guess at this stage so don't quote me on it
     
    dakka likes this.
  5. ZeraKoN

    ZeraKoN

    Joined:
    Nov 1, 2013
    Posts:
    5
    I updated today to 5.3.1p4. Some really nice fixes, but... Did this bug landed on the mainline yet?
    Don't hate me, we are all developers here... We know the feels... haha!
    Just wanted to keep myself updated with this bug! =)
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,291
    Its in next weeks 5.3.2p1
     
  7. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    Yaay \o/ Thanks for the heads up.
     
  8. Kronnect

    Kronnect

    Joined:
    Nov 16, 2014
    Posts:
    2,905
    Can't believe this issue is taking so much time to be included in a patch.
     
    diekeure and deekpyro like this.
  9. manny003

    manny003

    Joined:
    Mar 18, 2014
    Posts:
    70
    Seriously.

    Listen, I love Unity and all and greatly appreciate all the opportunity it has given indie developers. That said, it's not as if this were a *new* feature that didn't work quite right -- those situation are to be expected. This was a core feature that once worked and is now broken going on two months -- and the broken nature of it makes all other patches pointless, especially for mobile developers, if we have to stay on 5.2.4f1 just to be able to move forward.
     
    lucaswall likes this.
  10. lucaswall

    lucaswall

    Joined:
    Aug 5, 2015
    Posts:
    3
    Hey Karl,

    When you said next week's 5.3.2p1... Did you mean 5.3.2f1? Or do we still have a wait another week for a patch release?

    Thanks!

    Cheers,
    Lucas.
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,291
    5.3.2p1 but it should be out today not in a week. 5.3.2f1 was delayed so they both end up being out on the same day but 5.3.2p1 has an extra week of fixes in it.
     
    Cromfeli and eses like this.
  12. lucaswall

    lucaswall

    Joined:
    Aug 5, 2015
    Posts:
    3
    Ah, ok. Great! Thanks!
     
  13. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Yep, font placement seems to be working now! Thanks!
     
    karl_jones likes this.
  14. ZeraKoN

    ZeraKoN

    Joined:
    Nov 1, 2013
    Posts:
    5
    Patch 5.3.2p1 released. The font placement has been fixed, thanks!
     
    karl_jones likes this.
  15. dakka

    dakka

    Joined:
    Jun 25, 2010
    Posts:
    113
    @ karl Thanks for the follow up. Seems to be working now.
     
  16. Cromfeli

    Cromfeli

    Joined:
    Oct 30, 2014
    Posts:
    202
    I was so devastated to download the new release and see it was not fixed! Only then read there is also patch coming, and now it works perfectly!!!

    Thank you for the great job UI fellas :)

    Much love! :)
     
    karl_jones likes this.
  17. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    This + the particles system fix on the same day, it's like Christmas all over again /o/
     
    karl_jones likes this.
  18. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Kronnect and karl_jones like this.
  19. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Looks like I'll be downloading the patch soon then, one of my projects ran into this issue and got messed up... In my case, I was using non-dynamic fonts to make my custom font characters look sharper
     
  20. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    I suggest you against that!

    It is full of bugs - at least in iOS.
     
  21. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Yet some claim it to be faster than iOS... who to trust now? :D

    EDIT: Also, I don't plan on publishing to iOS until I have the necessary tools. (And good luck getting a mac... :D)
     
    Last edited: Feb 8, 2016
  22. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
  23. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Not that I use that... :D I might end up doing so one day however. Isn't that a low-level network-based class for things like downloading asset bundles?
     
  24. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    It is the unity default class for doing http requests - among them asset bundle downloading, but many multiplayer games are using it to talk to servers for all kinds of data.
     
  25. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Like signing in.. ;)
    Anyway, good points on some bits not working, I never knew. I also wonder how those got past QA... :D
     
  26. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    :(
     
  27. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    Btw, the Text alignement is indeed fixed for Android on Windows editor, but not for iOS from a mac...
     
  28. GuyTidhar

    GuyTidhar

    Joined:
    Jun 24, 2009
    Posts:
    320
    Are you sure about that? Maybe you have a different bug? Check you have the correct patch. I have built iOS on mac and the vertical alignment was fixed for me...
     
  29. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,291
    The text alignment should be fixed on all platforms. Sounds like you have a different problem. Make sure it is not the way you have your text setup. If you still think it is a big them submit a bug report with the project or a sample project.
     
  30. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    I'll check again this evening, but I updated the editor yesterday (5.3.2f1) and the problem is still there :/ I'll let you know more asap.
    On Windows I'm on version 5.3.2p1, maybe I have a cache issue on mac and I should be on p1 (never know which one of p1/f1 is the most recent).
     
  31. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Using the latest 5.3.2p3 release and maybe the fixes had some effects on the old GUI/legacy system.
    Because it has broken the alignment on the non new Unity GUI. All was fine with 5.3 final I can confirm.
    Will try reimport but just a heads up..
     
  32. Grhyll

    Grhyll

    Joined:
    Oct 15, 2012
    Posts:
    119
    Sorry, turns out I wasn't up to date, the download proposed by the standard easy-to-find link for Unity gives the 5.3.2f1, I had to go on the patches page to get the last one! Installing now, but I guess it will be ok for me.

    Edit: confirming it's ok.
     
    Last edited: Feb 18, 2016
  33. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    375
    It is unpleasant.
     
  34. Linolium

    Linolium

    Joined:
    Aug 28, 2014
    Posts:
    1
    This is a still a problem in 5.3.3f1 with TextMesh. I am currently blocked from submitting highly needed updates by this on multiple projects.

    This is a big problem.

    When will it really be fixed? Going through entire applications and "adjusting" the offsets of every TextMesh instance is not an option.

     

    Attached Files:

  35. Maulwurfmann

    Maulwurfmann

    Joined:
    Mar 11, 2014
    Posts:
    366
    I also have big issues with incorrect displayed text in 5.3.3p1. Not only the allignment is incorrect, but also the font size.

    As others already posted, setting to dynamic will "fix" this.

    But also if the canvas is enabled on start. I use several canvases and only the ones who are enabled at start are displayed proablby, maybe this helps to find a solution for this problem...
     
  36. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    375
    Last edited: Mar 8, 2016
  37. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    375
    edit: solved in 5.3.3!
     
    Last edited: Mar 13, 2016
  38. Talasas

    Talasas

    Joined:
    May 14, 2011
    Posts:
    8
    I have noticed that vertical alignment works but line spacing does not if you only have one line of text which means you can't set the baseline. This if after re-importing the fonts as well.

    Edit: This is using 5.3.3p2
     
  39. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    See if the latest patch release fixes it. If not... looks like Unity QA's getting another bug report. ;)
     
  40. pfreese

    pfreese

    Unity Technologies

    Joined:
    Feb 23, 2015
    Posts:
    85
    Can you clarify this? What effect of line spacing changes with a single line of text are you expecting?
     
  41. Talasas

    Talasas

    Joined:
    May 14, 2011
    Posts:
    8
    To offset the vertical alignment against the base line. Really in my case I was using it to fine tune the vertical alignment to compensate for high alignment within the font that we are using:

    001-font-alignment.png

    You can see in this image, Option 1 is using Arial with middle alignment vertically. Option 2 is the same thing but using the font we wish to use for production. I was able to fine tune the position of these elements by setting the Line Spacing to compensate.

    I interpret line spacing as the gap between the alignment setting and the base line of font for each line, rather than the gap "between two lines" as it were. It seems like currently the setting is relying on there being at least two lines before it applies the spacing:

    002-line-space.png

    Both of the above items have middle vertical alignment and line spacing set to -0.34. The top item has just the text "Option 1" in the text field while the bottom item has a newline at the end. I would expect these two cases to have the same results.
     
  42. Morgan

    Morgan

    Joined:
    May 21, 2006
    Posts:
    1,223
    This problem persists in 5.3.5p3. Baseline still shifted up—murder on my text-heavy app. (In addition, multi-line fields that used to fit 3 lines sometimes only fit 2, suggesting a line-spacing issue as well.)

    EDIT: Both the baseline shift (since I'm centering vertically) and fitting fewer lines would be explained by the bottom of the recttransform having moved upward.

    My workaround for now is to set the bottom a couple pixels lower manually. (Took a snapshot in case I need to revert later.)

    Perhaps this is a side effect of a previous fix? I would say that right now, having equal top and bottom look visually nicely centered, when previously that would look shifted down. So, other than this being an annoying change that broke some things, maybe it's actually better now?
     
    Last edited: Jun 14, 2016
  43. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    You know what I find funny right now? That people's projects still have this odd problem... :D
    I did have it at some stage, but the patch that confirmed a 'fix' actually did work for me.

    Still, interesting edge case... dare I hope the 'fix' isn't shifting rect transforms! XD (I don't think that's it, but who knows?)

    EDIT: From reading the last part of your post, if the text alignment's using the bottom... I guess that would make it easy to fit a text box to a panel or something, and make sure the actual rect itself fits in there. (I often have to use textrects that are a fair bit bigger than what I'm putting the text in, just to get the spacing right... )
     
  44. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Could someone provide a sample scene that exhibits these issues? I would love to test these in TextMesh Pro to make sure the level of control that is expected is available.

    TextMesh Pro does provide the ability to adjust font metrics such as Ascender, Descender, Baseline, etc on a per Font Asset basis as seen below.

    upload_2016-6-14_21-10-0.png

    Although fonts are suppose to follow some standards, I quickly realized it wasn't the case with many fonts. When I added support for Multi Font & Sprites which makes it possible to use different fonts and sprites in the same text object, it became clear I needed to provide users control over these metrics.