Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro Capitalizing first letter in every word

Discussion in 'UGUI & TextMesh Pro' started by kabumere, May 6, 2018.

  1. kabumere

    kabumere

    Joined:
    Oct 2, 2016
    Posts:
    31
    Does TextMesh Pro have the ability to capitalize the first letter in every word? Or is that something we have to handle in our scripts?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    That is something you need to handle on your end.
     
  3. kabumere

    kabumere

    Joined:
    Oct 2, 2016
    Posts:
    31
    Got it and thanks for the quick reply!
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    That wouldn't be that difficult to add as a feature. It would be just another style mode like Smallcaps or Superscript, etc.

    When I have time, I can look into that.
     
    MrLucid72 likes this.
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Capitalising Each Word Hasn't Got Any Valid Use In Any Language Really Though..?
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    There is something called "Title Case" which capitalizes the first letter of each word. It is not well known and that commonly used.

    There is also "Sentence Case" where the first letter of a sentence is capitalized. Although most people may not be familiar with this term, it is something most of us know / do when writing.

    Interestingly, "Pascal Case" and "Camel Case" are also styles which could be supported at some point.
     
    Last edited: May 18, 2019
    hippocoder likes this.
  7. kabumere

    kabumere

    Joined:
    Oct 2, 2016
    Posts:
    31
    I wanted to use it for displaying titles in the game news that I push to clients. And I'm sure others have many other use cases for it as well.
     
    protopop likes this.
  8. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    962
    This would rock! Just a simple thing that'd save a ton of time since this is common for headers.

    "Some Header Here"

    This would greatly help for localizing.

    Let's say a localization key == "some text here" you want to use as a header, rather than in a normal sentence. I'd just flip the switch and it turns into "Some Text Here".