Font Adjuster

  



Auto adjust font size to fit inside label? I'm wondering if it's possible to have a label's (or text input's, or whatever else) font size change to fit all text inside the label's dimensions. For example, I have a label with the text property of: 'Description: ' & DescriptionVariable. The font-size-adjust CSS property sets the size of lower-case letters relative to the current font size (which defines the size of upper-case letters). /. Use the specified font size./ font-size-adjust: none; /. Use a font size that makes lowercase letters half the specified font size./ font-size-adjust: 0.5; /. Global values./ font-size-adjust: inherit; font-size-adjust: initial; font-size.

Here's how to change the size of text, images, and apps in Windows 10. To change your display in Windows 10, select Start Settings Ease of Access Display.To make only the text on your screen larger, adjust the slider under Make text bigger. The text-size-adjust property allows web authors to disable or modify this behavior, as web pages designed with small screens in mind do not need it. Syntax The text-size-adjust property is specified as none, auto, or a. Note −The font and basefont tags are deprecated and it is supposed to be removed in a future version of HTML. So they should not be used rather, it's suggested to use CSS styles to manipulate your fonts. But still for learning purpose, this chapter will explain font and basefont tags in detail.

Unity3D font renderer lacks support forGPOS and GSUB.Because Thai font heavily depends on these features, rendered image looks ugly without them.

This library gives workaround to render Thai font almost correctly.Following image shows differences between results from original Unity3D and this library.Position of tone mark, upper vowel and lower vowel would be adjusted by surrounding characters.

Font Adjuster

Where can I get it?

Font Adjustment On Kindle

Visit Releasepage to get latest ThaiFontAdjuster unity-package.

How to use

Just before setting text of UnityEngine.UI.Text, text need to be translated byThaiFontAdjuster.Adjust. Font of Text should be one of supported Thai fonts.

For other UI library using Unity3D dynamic font (like NGUI), you can do it by the same way.

Limitation

ThaiFontAdjuster only can handle special fonts.

Font
  • Font should have extended glyphs from U+F700 to U+F71A providing various position of Thai characters.
  • NECTEC National Fonts (Garuda, Loma, Kinnari, Norasi) already provide it.
  • Modified NotoSansThai containing extended glyphs is included in this package.
  • If you want to use another font, check it contains extended glyphs, otherwise glyphs have to be added to font by yourself.

Adjusting position is not same as true-type rendered one with GPOS and GSUB support.

Make Font Larger

  • This library adjusts position of glyph at best with limited extended set of character.But without GPOS, ideal positioning is impossibe.

Font Adjusting

Under the hood

Adjust Font Size

If you want to know more detail about this libary, check UnderTheHood article.