


Then you notice something wrong where there is only fallback font. Also notice that Line Height has no effect at all. Fallback font adjustmentįallback font means in the TextMeshProUGUI inspector we are using the same font as previously used, but because the character isn’t there it will load up an additional texture for those fonts.įirst adjust the scale to match the first font. With only Line Height and Ascender, I could achieve this result. We will counter-adjust that later with scaling. Remember that all fallback fonts will share Line Height with the root font. If there is no line height each line’s baseline would be at the same position. Line Height affects how baseline are spaced out from each other. Line Height - Alignment - BaselineĪctually the 3 on the left has 3 more lines in each. Top align is at the top edge, middle aling has the baseline at center of most characters, bottom align untouched. Here’s the result of adjusting just Ascender. From this two images, TMP’s Ascender is equal to the first image’s cap height. Note that definition of TMP’s “Ascender” is not the same with some other source’s “Ascender”. So what I want to do here is the bottom align should have the descender sticking out of the box but the top and center align should be moved down a bit. Also, center align is not so “center” as when you put the baseline at center the font sticks up from it. top align will not be “in the box” but bottom align is. But, the meaning of Top alignment is actually : put the baseline at the top edge of the RectTransform .

The top align isn’t quite the expected result, I expected the top edge of character to be at the top box. What you see is top, middle, and bottom align with equal RectTransform matching the Unity grid. It can have unique everything else, Scale being the most important as you must use it to “reconcile” with main font’s line height when is being fallbacked on.Therefore with this approach, a game in Japanese localization will get the same massive line height from Thai language where we need some room for diacritics, etc. Fallback fonts must share the Line Height with the root font.Again, this is not how localization would work out in the end. This font does not have Japanese character, so I (naively) think needs to go to an another texture when that happens. Notice the fallback font list in the image. Anyways, we will look at just how the fallback fonts works first. As you will learn later that you must use a combination of font asset switching and fallback fonts. And somehow that magically resolves to every possible text you throw at it. you maybe thinking of making an uber TMP font asset that you can assign to all your TMP_Text component in your game. The…įont Height ()- Refers to the height of the font from the lowest descender to the highest ascender. The TextMesh Pro font creation window can be opened in the editor via Window / TextMeshPro - Font Asset Creator. Your imported TMP font looks weird, kinda off from the RectTransform you had setup, or broke when using multiple languages that falls back to other TMP asset? Let’s not rely on extracted data and understand it completely in this article.
