Highlight translated segments with custom colors via API in SDL Trados Studio 2024

Hello.

I'm encountering issues with the Trados Studio 2024 API (18.0.0.1013). I'm developing a plugin to integrate my custom machine translation models into Trados, similar to the DeepL or ChatGPT plugins. I want to highlight specific machine-translated segments either by changing the font style or the text color via the API, similar to what the Wordlight plugin does. However, I haven't found a way to achieve this yet.

My plugin implements the Translation Memory API.

I tried adding open/close tags (objects of type Sdl.LanguagePlatform.Core.Tag) to the translated segment (object of type Sdl.LanguagePlatform.Core.Segment) to add styling for the text.

e.g:

Fullscreen
1
2
3
4
5
6
var startTag = new Tag(TagType.Start, "0", 0, 0, "<cf font=Calibri bold=True>", false);
var endTag = new Tag(TagType.End, "0", 0, 0, "</cf>", false);
Segment translation = new Segment( ... );
translation.Add(startTag);
translation.Add(translatedText);
translation.Add(endTag);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

But this doesn't seem to have any effect on the final text rendering process. Is there any way to highlight the translated text with custom colors or change it's font?

Thanks.