Ejemplo n.º 1
0
        public bool NeedsToBreakBeforeWordBreaker(string sText, int iCursor, int xPixel, IRect rectDest, int iGlyphType)
        {
            bool bReturn = false;

            try {
                if (rectDest != null)
                {
                    if (sText != null && iCursor >= 0 && iCursor < sText.Length)
                    {
                        int zone_Right = rectDest.X + rectDest.Width;
                        while (!RString.IsWordBreaker(sText[iCursor]))                           //while (!RString.IsSpacing(sText[iCursor])) {
                        {
                            xPixel += WidthOf(sText[iCursor], iGlyphType);
                            if (xPixel >= zone_Right)
                            {
                                bReturn = true;
                                break;
                            }
                            iCursor++;
                        }
                    }
                }
                else
                {
                    RReporting.ShowErr("Cannot check line breaking using null rect.", "", "NeedsToBreakBeforeWordBreaker");
                }
            }
            catch (Exception exn) {
                RReporting.ShowExn(exn, "checking for line break", String.Format("NeedsToBreakBeforeWordBreaker {{{0}{1}{2}rectDest:{3}}}",
                                                                                 RReporting.DebugStyle("sText", sText, false, true),
                                                                                 RReporting.DebugStyle("iCursor", iCursor, true),
                                                                                 RReporting.DebugStyle("xPixel", xPixel, true),
                                                                                 IRect.ToString(rectDest)));
            }
            return(bReturn);
        }