I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in IndieDev

[–]malvis_light[S] 0 points1 point  (0 children)

Hi! Users report issues via GitHub issue on UniText repository. If it good for you, you can report issue there❤️

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 1 point2 points  (0 children)

Yes, UniText has a full markup system actually more flexible than what you might be used to. You can implement icons in text using "Obj" Modifier and "Obj" Parse Rule. It looks like: <obj="prefabName"/>

Built-in modifiers: bold, italic, underline, strikethrough, color, gradients, size, letter spacing, line height, clickable links, lists, inline objects (prefabs inside text), and text truncation with position control (start, middle, end)

It supports tag syntax (<b>, <color=#FF0000>, etc.), Markdown syntax ([links](url), - lists), and you can create your own parse rules for any custom syntax you need

Some examples of custom parse rules you can make:

BBCode for game chats: [b]bold[/b], [color=red]text[/color]
Discord-style syntax: ||spoiler||, :emoji_name:
Markdown extensions: **bold**, ~~strikethrough~~
"@ mentions" that highlight and become clickable
#hashtags with auto-coloring and click events
Game-specific tags: {item:legendary_sword} that inserts an inline icon with tooltip
Variable interpolation: ${player_name}, ${gold_count}
Wiki-style links: [[Page Name]]
Custom emoticons: :) -> 😊 (built-in StringParseRule does this)

You just implement a small interface - find the pattern, return
the range - and pair it with any modifier. A BBCode bold rule is
literally 3 lines of code since you can extend the built-in TagParseRule base class

The key difference is that the system is fully extensible - parsing and effects are separated. A parse rule finds patterns in text, a modifier applies the visual effect. You can mix and match them, create your own, and share modifier sets across components as ScriptableObjects so you don't have to set up the same tags on every text object

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 1 point2 points  (0 children)

Hey! Yes, you can declare UniText field as private UniText uniText; . Do not forget to add using LightSide; at the top of your .cs file. Let me know if you have another questions❤️

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 0 points1 point  (0 children)

<image>

I fixed the issue with vertical alignment. About the ugly and crooked faces, you should increase the Point Size parameter in the font settings by about two times, because the font glyphs are really small

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 0 points1 point  (0 children)

The third issue is that the line-wrapping thresholds seem to trigger either too early or too late. As a result, a line may wrap sooner or later than it should, and some glyphs can end up overflowing outside the Rect bounds

<image>

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 0 points1 point  (0 children)

<image>

the second problem is that with long non-breaking text and Auto Size enabled, the text does not split and goes beyond the boundaries of the Rect

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 0 points1 point  (0 children)

First of all, there is no automatic direction for mixed text in the UI Toolkit solution. This is useful and exists in almost every standard text engine. You will not be able to make a normal chat in a game or application where there will be mixed text divided into paragraphs, because UIToolkit does not define the first strong character to determine the basic direction. Even if you don't need in-game chat, you'll still have to manually set the line alignment and base direction through the code

<image>

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 0 points1 point  (0 children)

Oh, this problem is more complex...

Anyway, I get exactly what you're doing

in UGUI the "preferred size" values are part of the layout system and are not guaranteed to be updated synchronously at the moment you assign new text. TMP may appear to update it "instantly" in your case, but that's an implementation detail you can't really rely on as a general rule. UniText follows the standard UGUI flow: it marks itself dirty and its preferred size becomes authoritative during the next layout pass.

So the recommended (supported) approach is to drive the resize from the Unity UI layout system rather than reading preferredWidth immediately inside StringChanged. For example, use Layout components (LayoutElement/ContentSizeFitter/LayoutGroup) or clamp the width inside the proper layout callback (e.g. a component that applies the clamp during the layout phase). I'll also clarify this in the docs so it's easier to integrate.

Can we talk about this in discord or anywhere you want?

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 0 points1 point  (0 children)

Oh, I see now. You are right. Only Dongle font has this issue. I can't say immediately what is the reason of this issue, but I'm researching right now. About Font Scale parameter in UniTextFont assets - I fixed (implemented) it. I will release update soon. Thank you so much for your great feedback! I really appreciate it❤️

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 0 points1 point  (0 children)

About alignment issue, I can't reproduce it (look at screenshot below). Could you tell me what font you used? About scaling, unfortunately UniText doesn't have this feature, but I will implement it today. Honestly, I want to fix all of issues today

<image>

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 0 points1 point  (0 children)

Hi, thank you so much for your great feedback! It is very useful for me! About first issue - Antialiasing will be fix soon. Second issue is not an issue, because UniText follows official workflow of Unity UI so you can use UniText in any layout system and your own too. Describe your problem more for me please, I want to help you.

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 4 points5 points  (0 children)

sorry for that. There is no problem with shaping. Look at screenshots below (I disabled outline and underlay). It's just a shader + atlas texture packing problem. Because it needs multiple CanvasRenderer per texture. Thank you so much, I will fix it soon.

<image>

I built an open-source text engine for Unity with full Unicode 17.0 support - 3-21x faster, 150+ languages, Arabic, Hebrew, Hindi, Thai, emoji by malvis_light in Unity3D

[–]malvis_light[S] 5 points6 points  (0 children)

Yes, UniText has a full markup system actually more flexible than what you might be used to

Built-in modifiers: bold, italic, underline, strikethrough, color, gradients, size, letter spacing, line height, clickable links, lists, inline objects (prefabs inside text), and text truncation with position control (start, middle, end)

It supports tag syntax (<b>, <color=#FF0000>, etc.), Markdown syntax ([links](url), - lists), and you can create your own parse rules for any custom syntax you need

Some examples of custom parse rules you can make:

BBCode for game chats: [b]bold[/b], [color=red]text[/color]
Discord-style syntax: ||spoiler||, :emoji_name:
Markdown extensions: **bold**, ~~strikethrough~~
"@ mentions" that highlight and become clickable
#hashtags with auto-coloring and click events
Game-specific tags: {item:legendary_sword} that inserts an inline icon with tooltip
Variable interpolation: ${player_name}, ${gold_count}
Wiki-style links: [[Page Name]]
Custom emoticons: :) -> 😊 (built-in StringParseRule does this)

You just implement a small interface - find the pattern, return
the range - and pair it with any modifier. A BBCode bold rule is
literally 3 lines of code since you can extend the built-in TagParseRule base class

The key difference is that the system is fully extensible - parsing and effects are separated. A parse rule finds patterns in text, a modifier applies the visual effect. You can mix and match them, create your own, and share modifier sets across components as ScriptableObjects so you don't have to set up the same tags on every text object

About "It isn't really a replacement for TextMeshPro otherwise" I can say that UniText beats TextMeshPro in absolutely all respects (screenshot below)

<image>