Unity-Simple-SRT icon indicating copy to clipboard operation
Unity-Simple-SRT copied to clipboard

Extra \n on the subtitle text.

Open Glwssa opened this issue 3 years ago • 2 comments
trafficstars

Hi. I'm using Subtitle Dispenser to place the subtitles on a 1087x180 rectangular box, but when the subtitle dispenser places an extra \n on the end of each subtitle and it messes with the alignment of the text inside the box. Screenshot_42 Screenshot_41

Glwssa avatar Feb 21 '22 10:02 Glwssa

Fixed it by going to the subtitle displayer and removing all the \n,\t,\r from the final text output. currentlyDisplayingText.text = currentlyDisplayingText.text.Replace("\t", "").Replace("\n", "").Replace("\r", "").Replace("\r\n", "");

Glwssa avatar Feb 21 '22 13:02 Glwssa

Update: Found a better solution that fixes the issue without deleting all the other \n on the text. currentlyDisplayingText.text = currentlyDisplayingText.text.TrimEnd('\n');

Glwssa avatar Feb 24 '22 13:02 Glwssa