[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Algorithm to determine the base value for a relative font-size value?
Hi all,I want to calculate the actual font-size in case the attribute style:font-size has a relative value, but I'm not sure about it.
Example A, first line in attachment =================================== The style "Basis" has attribute style:font-size="24pt".The style "BasisHalf" has attributes style:parent-style="Basis" and style:font-size="50%".
The document has the element <text:tspan text:style-name="BasisHalf">foo</text:tspan> Section "20.183 fo:font-size" has the sentence,"In contrast to XSL, percentage values can be used within common styles only and are based on the font height of the parent style rather than to the font height of the attributes neighborhood."
I act as if the term "font height" means "font size" and calculate 50%*24pt=12pt; and therefore would render the word "foo" in 12pt.
Example B, second line in attachment ==================================== The style "Half" has set style:font-size="50%" and does not have a parent-style. In "section 16.2 <style:style>" you read in third sentence,"The determination of the value of a formatting property begins with any style that is specified by an element. If the formatting property is present in that style, its value is used."
For an element <text:tspan text:style-name="Half">bar</text:tspan> the value of the formatting property "font-size" is "50%" following this sentence. But it is not clear, to what base value the value 50% refers.
Unsurprisingly application render the attached file different. :(LibreOffice bug https://bugs.documentfoundation.org/show_bug.cgi?id=99544 comment#6 is the proposal to use the algorithm in section 16.2 similar to get the base value for the percent value.
What do you think about that? Do I overlook a rule in the specification?Jos: The attachment is in https://beta.opendocumentformat.org/upload/de/166 too, but I get only Word 2016 rendering there.
Kind regards Regina