Springen naar inhoud


Foto

Subtitle and Italic

Enigma2

  • Please log in to reply
Er zijn 80 reacties in dit onderwerp

Re: Subtitle and Italic #61 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 08:12

Strange.... here no disalignment...??? I asked you to put the SRT here.

Re: Subtitle and Italic #62 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 08:20

I suspect the srt you have is not anymore in the correct format... it is converted in linux format...

Re: Subtitle and Italic #63 TheMystery

  • Senior Member
  • 395 berichten

+2
Neutral

Geplaatst op 4 februari 2011 - 09:13

I have tested it with an mkv with embedded subtitles witch i can choose, so i don't use srt files
Maybe that the format is then different.

Re: Subtitle and Italic #64 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 09:39

I indeed kan confirm it.... but the next questions is why it does rendering it like this when a color change code is at the end of a line...?

Re: Subtitle and Italic #65 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 09:46

I'm scared it is something when the last character is a color change at a end of a line (font.cpp)

case 'c':
				    {
					   char color[8];
					   int codeidx;
					   for (codeidx = 0; codeidx < 8; codeidx++)
					   {
						  if ((i + 2 + codeidx) == uc_visual.end()) break;
						  color[codeidx] = (char)((*(i + 2 + codeidx)) & 0xff);
					   }
					   if (codeidx == 8)
					   {
						  pGlyph ng;
						  ng.newcolor = gRGB(color).argb();
						  ng.flags = GS_COLORCHANGE;
						  ng.w = 0;
						  glyphs.push_back(ng);
						  i += 1 + codeidx;
						  continue;
					   }
					   break;
				    }


Re: Subtitle and Italic #66 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 10:45

pieterg,

Please help. Something is incorrect here when the color escape string is at the end of a row.

Re: Subtitle and Italic #67 ims

  • PLi® Core member
  • 13643 berichten

+212
Excellent

Geplaatst op 4 februari 2011 - 12:13

@littlesat: trying:
text = replace_all(text, "<i>", (std::string) gRGB(0,255,255));
text = replace_all(text, "<b>", (std::string) gRGB(255,255,0));
text = replace_all(text, "</i>", "");
text = replace_all(text, "</b>", "");


=> is not color on the end . And it is same:

COLORED1
			COLORED2

It is in case:
7
00:00:33,067 --> 00:00:35,456
<i>-Baldricku!</i>
<b>Ano, pane.</b>

There is on end of first line
<br />

Kdo nic nedělá, nic nezkazí!

Re: Subtitle and Italic #68 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 12:50

I also discovered this in between.... something strange is going on here. I also replaced the color back to white string by e.g. 1234567890 and with the same results....? Strange why it is not renedering to the begin of the next line. I cannot find the reason yet. I still suggest we need a fix in font.cpp

Strange thing was that I tested with e.g.

3
00:01:00,503 --> 00:01:03,965
Ik <b>heb</b> gewonnen.
- Geef die tak aan mij.

which was rendered fine...

Re: Subtitle and Italic #69 ims

  • PLi® Core member
  • 13643 berichten

+212
Excellent

Geplaatst op 4 februari 2011 - 13:09

but if i displaying it with <i>.....</i> (without replacement chars) and have set for all subs yellow color (text = (std::string) gRGB(255,255,0) + text;), then are both texts true centered (of course, with <i> )

I think, there works bad centering, if is changed colors.

Problem making this variant only:

line1
<>line2</>

<>line1</>
<>line2</>
Kdo nic nedělá, nic nezkazí!

Re: Subtitle and Italic #70 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 13:11

I do not have the idea it is bad centering, but render the next line it goes not back to the begin position or so and render the both lines as one line???

Re: Subtitle and Italic #71 ims

  • PLi® Core member
  • 13643 berichten

+212
Excellent

Geplaatst op 4 februari 2011 - 13:30

in both cases are both line bad centered. 1st is more left, second is more right. Line break is made well ( text arent in same line).
Kdo nic nedělá, nic nezkazí!

Re: Subtitle and Italic #72 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 13:42

I think it is related to the linebreak. Ik goes to the next line and when you teke the complete thing as it was one line then the centering is OK.

Re: Subtitle and Italic #73 ims

  • PLi® Core member
  • 13643 berichten

+212
Excellent

Geplaatst op 4 februari 2011 - 13:46

there is 0x0d 0x0a ("\n") between line. May be, replace it with <> ?
Kdo nic nedělá, nic nezkazí!

Re: Subtitle and Italic #74 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 13:55

What do you mean by replacing it with <>? Normally 0x0d 0x0a is working fine.

Re: Subtitle and Italic #75 ims

  • PLi® Core member
  • 13643 berichten

+212
Excellent

Geplaatst op 4 februari 2011 - 14:05

ok. but in this case \n+color make problems...

It is stupid, but it helps:
text = replace_all(text, "<i>", " " + (std::string) gRGB(0,255,255));
text = replace_all(text, "<b>", " " + (std::string) gRGB(255,255,0));


Space before color info... :-)
Kdo nic nedělá, nic nezkazí!

Re: Subtitle and Italic #76 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 14:49

Indeed... it happens when the color change in the begin of the line second (or third etc...) line.

Now I understand what happens here... the color change just works a round as it is a not printable character and if it is the first line it does not see the first char in line flag.

Nextflags was copied to flags and made zero after the copy and then color escape code is renedered. So the nextline flag is never seen again - I have to set a nextflags = flags before the continue in the code above in font.cpp.

Later today I'll fix it... (Kids are watching TV).

Thanks ims for thinking with me.... it was a brainbraker for me the whole morning as I was looking after the color change. At the end in esubtitle.cpp we do not have to change anything.

Re: Subtitle and Italic #77 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 18:50

FYI: http://openpli.git.s...0cdb0f13a55af2a

Re: Subtitle and Italic #78 ims

  • PLi® Core member
  • 13643 berichten

+212
Excellent

Geplaatst op 4 februari 2011 - 19:20

Works well ;)
Kdo nic nedělá, nic nezkazí!

Re: Subtitle and Italic #79 littlesat

  • PLi® Core member
  • 56597 berichten

+694
Excellent

Geplaatst op 4 februari 2011 - 19:41

Thanks for help ims...

Now the start of the srt subtitles.... I have the idea the second and afterwards it starts with the third subtitle. The first two are skipped due to the push/pull mechanism which is very tricky in servicemp3.cpp

Re: Subtitle and Italic #80 ims

  • PLi® Core member
  • 13643 berichten

+212
Excellent

Geplaatst op 4 februari 2011 - 19:50

Thanks for help ims...

Now the start of the srt subtitles.... I have the idea the second and afterwards it starts with the third subtitle. The first two are skipped due to the push/pull mechanism which is very tricky in servicemp3.cpp


And what in this case adding into buffer with .srt subs at first permanently 2 subtitle lines with space on position 00:00:00,000 and 00:00:00:010 ? => all subs could be displayed ... Ugly ?
Kdo nic nedělá, nic nezkazí!



Also tagged with one or more of these keywords: Enigma2

1 gebruiker(s) lezen dit onderwerp

0 leden, 1 bezoekers, 0 anonieme gebruikers