Search Unity

How to add Lenny? ( ͡° ͜ʖ ͡°)

Discussion in 'Unity UI & TextMesh Pro' started by Avalin, Mar 14, 2019 at 9:15 PM.

  1. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    33
    I already have Hiragana and Katakana implemented for my font and I can do the ¯\_(ツ)_/¯
    but lenny becomes a square. I know that my character set supports it, since if I use Unity's native text, it will show. But obviously I want TextMesh Pro's features with it, so no can do.

    Currently these are my added ranges:

    20-7E,A0-BB,BF-C4,C6-DD,DF-EF,F1-FD,FF,2010-2015,2018-2027,2030,2038-203E,2043,2047,204B,204E-204F,2056,20AC,2122,25A1,30a0-30FF,3040-309F,0250-02AF


    The last one should include IPA, which at least should give me lenny's nose afaik (but it doesn't!)
    I would appreciate it, if I could just get every character from my font without having to manually insert them, is there a way to do so? I realise that this isn't ideal in most usecases but I really wouldn't mind

    EDIT: I learnt I could try adding the characters explicitly in Custom Characters setting. Unfortunately, TextMesh Pro claims they're missing, despite them being part of the font for sure. What gives?
     
    Last edited: Mar 14, 2019 at 9:33 PM
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,269
    I'll take a look shortly.

    What source font file are you using?

    In the meantime, what version of Unity and TextMesh Pro are you using?
     
    Last edited: Mar 14, 2019 at 10:01 PM
  3. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    33
    It is called Reactor7 (Found here: https://www.dafont.com/reactor7.font)
    Unity 2018.3.8f1
    I was using TextMesh Pro 1.3, realised there's an update just now so now I'm at 1.4 however my problem remains the same
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,269
    This is the result I get using your font and TMP version 1.4.0.

    upload_2019-3-14_15-20-26.png

    Please note that when using the new Dynamic SDF system which is part of version 1.4.0, you will need to either add a dynamic fallback to your font asset or create a new font asset that is set to dynamic or some combination thereof.

    Edit ... I was copy pasting the wrong sequence. Checking again...

    This is what I am getting using Arial

    upload_2019-3-14_15-25-38.png
     
  5. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    33

    Edit: Hopefully above clarifies what I mean a bit more
     
  6. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,269
    These are the unicode involved in this sequence.

    upload_2019-3-14_15-27-26.png

    It appears the Reactor 7 font is missing \u0296 and /u035C
     
  7. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    33
    Ah okay, maybe I'm just confused by how the unity Text manage to render them so pixel-y if they are in fact missing (I would assume it would have just used Arial if it wasn't there?)

    Do you have any idea how I got the pixelated result that matches my charset, if they indeed are missing? Can I somehow get that in Textmesh Pro too, so it doesn't change font as drastically as Arial would be?
     
  8. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,269
    This is what I get with UI Text.

    upload_2019-3-14_15-36-1.png

    As you can see, the missing glyphs are being replaced by some other glyphs from some other font. They might appear pixelated as a result of using low sampling on the bitmap font.

    One option might be to edit your font to add those missing glyphs. There are a few free font editing tools available. There might also be other pixel art style fonts that include those glyphs.

    I looked at a bunch of pixel art fonts on that website and none appear to have those glyphs in there. So I think the easiest solution is to edit that font to add those missing glyphs.
     
    Last edited: Mar 14, 2019 at 10:46 PM
    Avalin likes this.
  9. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    33
    I am also having problems just getting the characters from Arial, seemingly they go square too (when using TextMeshPro, works fine with native UI text), I use the same character ranges as above, and I seemingly get 212/349 characters, so I think I'm doing something wrong in the import? I got the Arial font from my Windows system folder, I don't know if that has an impact of any sort

    Edit: Okay nevermind, my Unity just needed to restart, and suddenly it works fine.
     
  10. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    2,269
    The character range above appears to be missing the range or just the specific characters which are 0296 and 035C.

    To address that you could either update your font asset to add those two additional characters to your range. Alternatively, you could create a new dynamic font asset and assign it as fallback to your main Arial font asset.

    To do the above, you would simply select the Arial font file and right click to bring up the context menu and navigate to the options as seen below.

    upload_2019-3-14_16-30-41.png

    This will create a new dynamic font asset from Arial. You will need to make sure you match the sampling point size and padding of your primary Arial font asset. These settings will be changed in the Generation Settings section of the font asset editor.

    upload_2019-3-14_16-32-6.png

    and then simply assign this dynamic font asset to your primary Arial font asset.