Fonts have wrong spacing/kerning in uitoolkit after switch to Unity 6

After updating to Unity 6, it looks like some of the fonts I am using in UIToolkit have the wrong spacing between letters.

I tried reimporting/refreshing the fonts, but this didn’t seem to do anything. I haven’t gone back to check if this was an issue before updating to Unity 6, but I think I would have noticed it before then. If there’s something else I could try, or something else I might have done to cause this, let me know.

Example in uitoolkit text with Bebas Neue font (text is “Bebas Neue”. I’m using a few different fonts, a few others also have spacing issues, but this one has the most noticable issues. It looks like “Beba S Neue”) :
image

Example text from Google Fonts (what I expect it to look like):

We actually read more kerning tables from the font compared to before, so differences are anticipated.

But in your case, unless you tried adjusting the font yourself, it is possible we did something wrong. I would suggest waiting a bit to see if there is a pattern on the forum and to fill a bug if there is no solution.

There is definitely an issue with Unity 6 / UI Toolkit and fonts. I have imported a few fonts for my project and spacing remained correct up to a point, then as I worked in Unity Toolkit on other aspects of UI I noticed that font spacing for the specific fonts was completely messed up, which renders the font itself unusable for the UI after that point. (I will note that use of the font for single words remains fine, but there will be issues with random letters/spaces having the wrong spacing in sentences and paragraphs.)

I am also seeing this bug. I am using the Kanit Google Font and specifically the “t” character may be reproducible.

I am seeing this as well. When reimplementing UI in with UI Toolkit the space between the letters is messed up and many letters are getting merged together. In particular example it´s the Montserrat-Bold font. For example around capital G.

Same here with Nunito Sans from Google Fonts. Unity 6000.0.37

E.G.
a b c d e f g h i j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V

Hope this can get fixed soon :crossed_fingers::crossed_fingers::crossed_fingers:

This keeps getting replies so I made a bug report, will post here if I get any updates.

Have you got an issue-tracker link @jamie_stripe? :slight_smile:

I am having a similar issue:

font: lato-regular
the most obvious case can be seen is in the word: “inseparable”.

Hi! Has anyone been able to find a solution to this? I am experiencing the same problem using Unity 6000.0.46f1

As suggested in another thread (I didn’t manage to find it again), as a temporary fix you can create a Font Asset from the font settings. That fixed it for me.

Why is this still a problem? For my project i was using Unity 6000.1.3. I had to do it from scratch using legacy ui because i was in a hurry.

Creating font assets did not fix the issue. I did notice one thing using git. I usually work on at least two computers and changing all the time (pushing/pulling from git), and asset files of fonts were always on a list for staging - every commit. Why would font assets data change if i didnt touch it since the import (beggining of a project)?

Hi, it’s been a while but for the bug report I think they weren’t able to reproduce based on the project I sent them or something, and I got caught up with other stuff and forgot about this. If someone else wants to try to make a report let me know how it goes.

I sat on 2022.3 LTS for ages due to this bug. I wanted to upgrade from 2022 quite some time ago, I think to 2023, but noticed this bug and decided not to upgrade. So it could’ve been a change in 2023.

Just upgraded my project to 6000.0.58f1 and seeing it again. Typically occurs on first render/layout. Adjusting a pixel somewhere resolves it until the next first layout of some string. About to upgrade to 6.3 LTS, we’ll see if it’s still there.

I just checked my project in 6000.2.12 with the Bebas Neue font, and it seems to work properly now. I don’t know when this got fixed, or if it’s still an issue for other fonts, but it seems like this issue at least got partially addressed.

Same here, fixed on 6.3