Пример #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);
        }
Пример #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);
        }
Пример #3
0
 public eBreakAction newline()
 {
     state = eLineState.None;
     return(eBreakAction.LineFeed);
 }
Пример #4
0
 public LineBreaker(int right)
 {
     lineBreakPosition = checked ((ushort)right);
     state             = eLineState.None;
 }