@Override public int getBreakWeight(int axis, float pos, float len) {
            // return GoodBreakWeight;
            if (axis == View.X_AXIS) {
                checkPainter();
                int p0 = getStartOffset();
                int p1 = getGlyphPainter().getBoundedPosition(this, p0, pos, len);
                if (p1 == p0) {
                    // can't even fit a single character
                    return View.BadBreakWeight;
                }
                try {
                    // if the view contains line break char return forced break
                    String text = getDocument().getText(p0, p1 - p0);
                    if (text.indexOf(WrapHTMLFactory.SEPARATOR) >= 0) {
                        return View.ForcedBreakWeight;
                    }
                } catch (BadLocationException ex) {
                    // should never happen
                }

            }
            return super.getBreakWeight(axis, pos, len);
        }
Forces a line break.

@return View.ForcedBreakWeight
src/cn/ieclipse/smartim/common/WrapHTMLFactory.java