Separate Fonts for Actor Name & Subtitle Text

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
s0what
Posts: 2
Joined: Sat Apr 26, 2025 2:01 pm

Separate Fonts for Actor Name & Subtitle Text

Post by s0what »

Hello there, I hope you can help my peanut brain.

I am trying to give the displayed actor names a separate font, like in the picture example below.
Image

My current thinking is that I might have to create to separate textfield for that, but not sure how I would link that to actor name and dialogue text only? would something like in the picture even be possible?

cheers
User avatar
Tony Li
Posts: 23251
Joined: Thu Jul 18, 2013 1:27 pm

Re: Separate Fonts for Actor Name & Subtitle Text

Post by Tony Li »

Hi,

No need to create a separate text field!

If you don't need to change the speaker name's color, you can inspect the subtitle panel's StandardUISubtitlePanel component.

Tick Add Speaker Name, and set Add Speaker Name Format to something like:

<font="Gothic"><size=30>{0}</size></font>: {1}

The <tags> above assume you're using TextMesh Pro. (See TextMesh Pro Support.) If you're using legacy Unity UI Text, you can use rich text codes.

The {0} will be replaced by the speaker's name, and {1} will be replaced by the subtitle text.

If you do need to change the speaker name's color, too, then UNtick Add Speaker Name. Instead, add a Dialogue Actor component to the speaker's GameObject. Set the Actor dropdown. Then tick Dialogue UI Settings > Set Subtitle Color and Apply Color To Prepended Name. Set the Prepend Actor Name Format, for example to something like:

Prepend Actor Name Separator: -
Prepend Actor Name Format: <font="Gothic"><size=30>{0}</size></font>{1}
s0what
Posts: 2
Joined: Sat Apr 26, 2025 2:01 pm

Re: Separate Fonts for Actor Name & Subtitle Text

Post by s0what »

Oh, thank you for the quick answer!

So I ticked "Add Speaker Name" and used your formating. Now the text gets bigger, but the font doesn't change, instead it displays the font rich text. You can see it in the bottom of the picture. Maybe something is wrong with my formating or font naming?

Image

But, I managed a workaround (as seen in the top of the picture) and added the alternative Font to one of the different weights in the textmeshpro asset. And with the following code it now works: <color=#EAEAEA><font-weight="900">{0}</font-weight> - {1}</color>

Still, if you have an idea why the <font="Gothic"> option doesnt work I'd be happy to hear it :)

PS: i like that you do the support via a classical forum and not discord, i managed to find a lot of answers here
User avatar
Tony Li
Posts: 23251
Joined: Thu Jul 18, 2013 1:27 pm

Re: Separate Fonts for Actor Name & Subtitle Text

Post by Tony Li »

Hi,

Make sure the font is in the Resource/Fonts & Materials folder, as specified here.

p.s. - We also have a discord, when people have questions there I'll usually point them to answers here. Tip: On the forum, search for "HOWTO" plus a question for official how-to articles.
Post Reply