mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Add more italic support to spt/sptx - thx Peter :)
This commit is contained in:
parent
88223ef242
commit
720ba172d9
@ -134,6 +134,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
int textLengthFirstLine = buffer[index + 16 + 20];
|
||||
int textLengthSecondLine = buffer[index + 16 + 20 + 4];
|
||||
var allItalic = buffer[index + 16 + 4] == 1;
|
||||
|
||||
if (textLengthFirstLine == 0 && textLengthSecondLine == 0)
|
||||
{
|
||||
@ -156,6 +157,11 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
p.Text += Environment.NewLine + Encoding.Default.GetString(buffer, index + 16 + 20 + 16 + textLengthFirstLine, textLengthSecondLine);
|
||||
}
|
||||
|
||||
if (allItalic)
|
||||
{
|
||||
p.Text = "<i>" + p.Text.Trim() + "</i>";
|
||||
}
|
||||
|
||||
index += 16 + 20 + 16 + textLengthFirstLine + textLengthSecondLine;
|
||||
return p;
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
if (ok)
|
||||
{
|
||||
var allItalic = buffer[index + 16 + 4] == 1;
|
||||
var length1 = buffer[index + 16 + 20];
|
||||
var length2 = buffer[index + 16 + 26];
|
||||
var length = length1;
|
||||
@ -99,6 +100,11 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
EndTime = GetTimeCode(Encoding.UTF8.GetString(buffer, index + 8, 8)),
|
||||
Text = FixItalics(text)
|
||||
};
|
||||
if (allItalic)
|
||||
{
|
||||
p.Text = "<i>" + p.Text.Trim() + "</i>";
|
||||
}
|
||||
|
||||
index += 16;
|
||||
return p;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user