TTML: percentage font size calculation not correct
Currently the calculation of the font size of TTML subtitle files is not correct, if the font size is specified as percentage: The tts:fontSize value is applied to the VLC constant STYLE_DEFAULT_REL_FONT_SIZE at the moment.
However the Computed Cell Size of TTML applies here: The "video region" is divided into a grid of columns/rows by the ttp:cellResolution attribute on the (root) tt:tt element (if the attribute is not present, the default value "32 15" applies); see also https://www.w3.org/TR/ttml1/#parameter-attribute-cellResolution. A font size of "100%" then equals to a single row of that grid (other values are calculated accordingly).
Example file
I attached an example file with ttp:cellResolution="50 30" on the tt:tt element and tts:fontSize="160%" on the default style.
The current equation leads to the following result value of f_font_relsize:\
= STYLE_DEFAULT_REL_FONT_SIZE * size / 100.0 = 6.25 * 160 / 100.0 = 10 %
The correct calculation here would be:\
= 100.0 / cell_resolution_rows * size / 100.0 = 160 / 30 = 5.333333333 %
This way the second subtitle "Herzlich willkommen zur Live-Untertitelung des NDR (20.05.2017)" occupies two lines as intended (instead of four lines due to line wrapping done by the rendering).
The correct rendering result can also be seen by using: http://sandflow.com/imsc1proc/index.html