Class FontStretchPropertyMaker

  • All Implemented Interfaces:
    java.lang.Cloneable, Constants

    public class FontStretchPropertyMaker
    extends EnumProperty.Maker
    implements Constants
    This subclass of EnumProperty.Maker handles the special treatment of relative font stretch values described in 7.8.5.
    • Field Detail

      • orderedFontStretchValues

        private Property[] orderedFontStretchValues
    • Constructor Detail

      • FontStretchPropertyMaker

        public FontStretchPropertyMaker​(int propId)
        Create an enum property which can handle relative font stretches
        Parameters:
        propId - the font size property id.
    • Method Detail

      • convertProperty

        public Property convertProperty​(Property p,
                                        PropertyList propertyList,
                                        FObj fo)
                                 throws PropertyException
        Convert a property. Implements the parts of 7.8.5 relevant to relative font stretches
        Overrides:
        convertProperty in class EnumProperty.Maker
        Parameters:
        p - the property to convert
        propertyList - the property list to use in conversion
        fo - the FO to use in conversion
        Returns:
        the converted property
        Throws:
        PropertyException - if a property conversion exception occurs
      • computeNextAbsoluteFontStretch

        private Property computeNextAbsoluteFontStretch​(Property baseProperty,
                                                        int direction)
        Calculates the nearest absolute font stretch property to the given font stretch
        Parameters:
        baseProperty - the font stretch property as set on the parent fo
        direction - should be -1 to get the next narrower value or +1 for the next wider value