Here is a simple patch to add support for absolute and relative font size specifications. I think the part of the patch for the <absolute> specifications is OK as is, that is the font sizes are fixed based on a default (=medium) of 12pt and a stepping factor of 1.2 as recommended in the spec. While the spec allows for the stepping to be font specific at this point in time having a "one size fits all" approach should do. I am not so sure about the <relative> part of the patch. The patch simply translates the "smaller" or "larger" keywords into a percentage. The spec really asks for mapping into one of the absolute sizes using rounding and if outside the <absolute> sizes using extrapolation. My understanding of the property subsystem is not (yet?) good enough to attempt something like that without guidance / hints from the experienced fop-devs. The patch also contains updated testcases (with checks :-)).
Created attachment 15895 [details] The patch
Thanks for doing this. Your patch looks good and appears to work. However, theres one little thing thats puzzling me. Finn, who is our properties guru wrote the class CommonFont. If you look at the method getFontState there is some code that implements the relative keywords for font weight and comments that say should do font size relative keywords too. Why would he write this if all he needed to do was added some keywords to the Property Maker ???
Actually looking at Commonfont.getFontState() the relative font weights are not (!) implemented (something else to do). One reason Finn couldn't use the same scheme I used for font-sizes is that font-weight does not allow percentage values. Another reason is, as I pointed out, that my implementation is not strictly spec compliant. Both, relative font-weights and relative font-sizes must be implement with reference to the parent value. Now if I could figure out how this property inheritance / resolution stuff is implemented in Fop, i.e. how / where / when I can get to the value of the property in the parent element, I could fix both of these relative properties (and may be some of the other percentage stuff not working).
Yes you are right that getFontState() method isn't doing a great deal and as you say this is because the percentage should apply to the parent. I have applied your patch but decided to leave the bodge for relative sizes out for now. There's already a task item to properly implement percentages within FOP's property/FO sub systems. So I think this is best addressed after that work is completed. Thanks for your contribution
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed