Class TextLegacy

  • Direct Known Subclasses:
    TextStream

    public class TextLegacy
    extends java.lang.Object
    Base class for AXTE classes which must track legacy positioning or spacing mode.

    AXTE underwent a major rework between versions 6 and 7 to support complex script languages. During this time, a number of text layout and positioning bugs were fixed, often inadvertently. In addition, more standard layout practices were adopted.

    Consequently, version 7 did not lay out text the same as version 6. This proved unacceptable for some customers and AXTE was modified to support a legacy positioning (version 6) mode. In this mode, implements the many facets of the old behaviour: vertical and horizontal positioning, line breaking rules and font metric fudging.

    In spite of all the effort in version 7 to support correct and standard layout practices, a bug crept in and was not detected soon enough to provent customers from creating forms with the incorrect behaviour. Therefore, we have intentionally not correct that bug, lest customers see yet another layout change. The problem occurs only when line spacing is overridden to something smaller than the default and can lead to vertical alignment problems or the last line of text being clipped. While it mak not make sense to fix this problem for forms customers, it leads to problems with other clients of AXTE.

    This class allows the derivative to be flagged by the client as supporting one of the three behaviours described above.

    • Field Detail

      • LEVEL_V6

        public static final int LEVEL_V6
        Legacy behaviour level enumeration. The level can be discribed as one of the following:
        • LEVEL_V6 - Use version 6 layout behaviour.
        • LEVEL_NORMAL (default) - Normal forms behaviour. Layout follows generally accepted behaviour, except for incorrect determination of line height of the last line when a line spacing override is in effect that reduces spacing smaller than the font size.
        • LEVEL_CORRECT_SPACING - Same as normal behaviour, except that it corrects for the line spacing bug.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TextLegacy

        public TextLegacy()
        Default constructor. The default legacy level is LEVEL_NORMAL;
    • Method Detail

      • getLegacyLevel

        public int getLegacyLevel()
        Query the current level.
        Returns:
        The current spacing level.
      • setLegacyLevel

        public void setLegacyLevel​(int eLevel)
        Set a new legacy spacing level.
        Parameters:
        eLevel - - New level.
      • hasLegacyPositioning

        public boolean hasLegacyPositioning()
        Query whether version 6 layout is in effect.
        Returns:
        True if the level is currently LEVEL_V6; false otherwise.
      • hasNormalPositioning

        public boolean hasNormalPositioning()
        Query whether normal forms layout is in effect.
        Returns:
        True if the level is currently LEVEL_NORMAL; false otherwise.
      • hasCorrectPositioning

        public boolean hasCorrectPositioning()
        Query whether normal layout with correct spacing handling is in effect.
        Returns:
        True if the level is currently LEVEL_CORRECT_SPACING; false otherwise.