public bool ReadLine(out string sLine, string sText, ref int iMoveMe, IRect rectDest, int iGlyphType) { bool HasALine = false; bool bBreakable = false; int iSkipper = 0; int iStartLine = iMoveMe; try { int iStart = iMoveMe; int xPixel = rectDest.X; int zone_Right = rectDest.Right; if (iMoveMe + 1 < sText.Length) { HasALine = true; } while (iMoveMe + 1 < sText.Length) { //string sTemp=SafeSubstring(sText,iMoveMe,Environment.NewLine.Length); if (RString.CompareAt(sText, Environment.NewLine, iMoveMe)) { bBreakable = true; iSkipper = Environment.NewLine.Length; break; } else if (RString.CompareAt(sText, '\n', iMoveMe)) { bBreakable = true; iSkipper = 1; break; } else if (RString.CompareAt(sText, '\r', iMoveMe)) { bBreakable = true; iSkipper = 1; break; } else if (xPixel + WidthOf(sText[iMoveMe], iGlyphType) >= zone_Right) { int iLastBreaker = iMoveMe; bool bVisibleBreaker = false; bool bTest = RString.PreviousWordBreakerExceptNewLine(sText, ref iLastBreaker, out bVisibleBreaker); if (iLastBreaker > iStartLine) { if (bVisibleBreaker) { iSkipper = 0; //says not to skip any characters iMoveMe = iLastBreaker + 1; //includes it in the substring } else //else invisible, so skip it { iSkipper = 1; //says to skip it after substring is taken iMoveMe = iLastBreaker; //excludes it from the substring } } else //else no breaker { iSkipper = 0; } //NOTE: debug non-compliance: bBreakable and break allow non-html-style forced breakage if no breaker before wrap (when "else" case above occurs) bBreakable = true; //says to not skip to end of sText break; } //else if (NeedsToBreakBeforeWordBreaker(sText, iMoveMe+1, xPixel, rectDest, iGlyphType) && RString.IsWordBreakerExceptNewLine(sText,iMoveMe)) { // bBreakable=true; // iSkipper=1; // bTypeableNewLine=true; // break; //} else { xPixel += WidthOf(sText[iMoveMe], iGlyphType); iMoveMe++; } } if (!bBreakable) { iMoveMe = sText.Length; } sLine = RString.SafeSubstring(sText, iStart, iMoveMe - iStart); if (bBreakable) { iMoveMe += iSkipper; } } catch (Exception exn) { sLine = ""; RReporting.ShowExn(exn, "RFont ReadLine"); } return(HasALine); }