From: Lawrence D'O. <ld...@ge...> - 2011-08-18 10:30:00
|
On Thu, 18 Aug 2011 07:59:18 +0100 (BST), eblanca76 wrote: >> But why would you want to break up the subtitle rendering in this >> way? > Because subtitle streams are often made of mixed styles ... Which you would normally want to render all at once. >> Also I notice you only handle the style tags at the start of each >> line, whereas the description above allows them at any point within >> a line. > > I thought a long time about this. > Then I decided for this (restrictive?) solution because rendering a > line such as: > > 2 > 00:00:09,163 --> 00:00:10,422 > <b><i>Different styles: </i></b><i>italic</i> normal and <b>bold</b> > > would be a huge effort. There is a library that already knows how to handle this mixing of style runs, and that’s Pango. I think it would be more fruitful to rework the line layout to use that, rather than expend effort adding much more complexity to the existing code. |