Example #1
0
        public eBreakAction whitespace()
        {
            if (state == eLineState.Overflow)
            {
                state = eLineState.None;
                return(eBreakAction.LineFeed);
            }

            if (state.HasFlag(eLineState.HaveGlyphs))
            {
                state = eLineState.HaveWords;
            }

            return(eBreakAction.None);
        }
Example #2
0
        public eBreakAction glyph(int x)
        {
            if (state == eLineState.Overflow)
            {
                return(eBreakAction.None);
            }

            if (x < lineBreakPosition)
            {
                state |= eLineState.HaveGlyphs;
                return(eBreakAction.None);
            }

            if (state.HasFlag(eLineState.HaveWords))
            {
                state = eLineState.HaveGlyphs;
                return(eBreakAction.MoveLastWord);
            }

            state = eLineState.Overflow;
            return(eBreakAction.None);
        }
Example #3
0
 public eBreakAction newline()
 {
     state = eLineState.None;
     return(eBreakAction.LineFeed);
 }
Example #4
0
 public LineBreaker(int right)
 {
     lineBreakPosition = checked ((ushort)right);
     state             = eLineState.None;
 }