Renderer should have final decision of the styles to apply.
Rendered forced styles are applied over text-segments
ones, then renderer defaults (text-style's ones).
Also adds proportional font size.
Fixes all style inheritance and font sizing hacks in region
sys.
Final fixed font size is only computed at update time, if
not set to fixed size by decoder.
The current workflow is often parsing a subtitle format, then convert it
in a common HTML and then push it to the renderer as HTML. The renderer
will reparse the HTML and try to render it. Of course, that means that
only one renderer can do that correctly, and so we bloat the freetype
renderer as much as we can.
It also means that we have 2 render callbacks for subtitles, one for
normal text and one for styled text, and we sometimes reparse the HTML
to remove the tags, for the first.
We now only use a text_segment, with new segments at every style change;
an unique render function and the renderer can decide to honor or not
the style.
It's a big commit, so regressions can arise, but it was tested for most
common cases.
Place a black background behind caption text. We cannot use the
existing "background" feature for subdecoders because it fills the
entire subpicture block, and in the case of the EIA-608 decoder
would result in a large square (since we send all lines to
the subpicture decoder even if they are blank). This approach
allows for rendering of the background even in such cases, while
preserving proper layout of the captions.
Signed-off-by: Rafaël Carré <funman@videolan.org>
In order to get consistent EIA-608 caption positioning, we need to be able
to size the fonts based on the size of the video. Add support for
specifying the font height as a percentage of the video.
Signed-off-by: Rafaël Carré <funman@videolan.org>