Example #1
0
        internal FormatSettings(
            TextFormatterImp formatter,
            TextSource textSource,
            TextRunCacheImp runCache,
            ParaProp pap,
            TextLineBreak previousLineBreak,
            bool isSingleLineFormatting,
            TextFormattingMode textFormattingMode,
            bool isSideways
            )
        {
            _isSideways         = isSideways;
            _textFormattingMode = textFormattingMode;
            _formatter          = formatter;
            _textSource         = textSource;
            _runCache           = runCache;
            _pap               = pap;
            _digitState        = new DigitState();
            _previousLineBreak = previousLineBreak;
            _maxLineWidth      = Constants.IdealInfiniteWidth;

            if (isSingleLineFormatting)
            {
                // Apply text indent on each line in single line mode
                _textIndent = _pap.Indent;
            }
        }
Example #2
0
        /// <summary>
        /// Update formatting parameters at line start
        /// </summary>
        internal void UpdateSettingsForCurrentLine(
            int maxLineWidth,
            TextLineBreak previousLineBreak,
            bool isFirstLineInPara
            )
        {
            _previousLineBreak = previousLineBreak;
            _digitState        = new DigitState(); // reset digit state
            _maxLineWidth      = Math.Max(maxLineWidth, 0);

            if (isFirstLineInPara)
            {
                _textIndent = _pap.Indent;
            }
            else
            {
                // Do not apply text indentation to all but the first line in para
                _textIndent = 0;
            }
        }