Package java.awt.font

Examples of java.awt.font.LineBreakMeasurer.nextLayout()


            if (_shape.getWordWrap() == TextShape.WrapNone) {
                wrappingWidth = _shape.getSheet().getSlideShow().getPageSize().width;
            }

            TextLayout textLayout = measurer.nextLayout(wrappingWidth + 1,
                    nextBreak == -1 ? paragraphEnd : nextBreak, true);
            if (textLayout == null) {
                textLayout = measurer.nextLayout((float)anchor.getWidth(),
                    nextBreak == -1 ? paragraphEnd : nextBreak, false);
            }
View Full Code Here


            }

            TextLayout textLayout = measurer.nextLayout(wrappingWidth + 1,
                    nextBreak == -1 ? paragraphEnd : nextBreak, true);
            if (textLayout == null) {
                textLayout = measurer.nextLayout((float)anchor.getWidth(),
                    nextBreak == -1 ? paragraphEnd : nextBreak, false);
            }
            if(textLayout == null){
                logger.log(POILogger.WARN, "Failed to break text into lines: wrappingWidth: "+wrappingWidth+
                        "; text: " + rt.getText());
View Full Code Here

      int textEnd = iter.getEndIndex();
      LineBreakMeasurer measurer = new LineBreakMeasurer(iter,
        fontRenderContext);
      measurer.setPosition(textStart);
      while (measurer.getPosition() < textEnd) {
        TextLayout line = measurer.nextLayout((float) layoutWidth);
        result.addLine(line);
        height += (line.getAscent() + line.getDescent() + line.getLeading());
      }
    }
    result.setSize(layoutWidth, height);
View Full Code Here

                    LineBreakMeasurer measurer = new LineBreakMeasurer(aci, frc);
                    float wrappingWidth = textBox.width;

                    while (measurer.getPosition() < currentString.length()) {
                        layout = measurer.nextLayout(wrappingWidth);

                        Shape shape = layout.getOutline(oldAT);
                        double deltaScale = textBox.width * oldAT.getScaleX() / shape.getBounds().width;
                        if (1 - deltaScale > 0) {
                            AffineTransform adjust = (AffineTransform) oldAT.clone();
View Full Code Here

            if (_shape.getWordWrap() == TextShape.WrapNone) {
                wrappingWidth = _shape.getSheet().getSlideShow().getPageSize().width;
            }

            TextLayout textLayout = measurer.nextLayout(wrappingWidth + 1,
                    nextBreak == -1 ? paragraphEnd : nextBreak, true);
            if (textLayout == null) {
                textLayout = measurer.nextLayout(textWidth,
                    nextBreak == -1 ? paragraphEnd : nextBreak, false);
            }
View Full Code Here

            }

            TextLayout textLayout = measurer.nextLayout(wrappingWidth + 1,
                    nextBreak == -1 ? paragraphEnd : nextBreak, true);
            if (textLayout == null) {
                textLayout = measurer.nextLayout(textWidth,
                    nextBreak == -1 ? paragraphEnd : nextBreak, false);
            }
            if(textLayout == null){
                logger.log(POILogger.WARN, "Failed to break text into lines: wrappingWidth: "+wrappingWidth+
                        "; text: " + rt.getText());
View Full Code Here

            if(wrappingWidth < 0) wrappingWidth = 1;

            int nextBreak = text.indexOf('\n', startIndex + 1);
            if(nextBreak == -1) nextBreak = it.getEndIndex();

            TextLayout layout = measurer.nextLayout((float)wrappingWidth, nextBreak, true);
            if (layout == null) {
                 // layout can be null if the entire word at the current position
                 // does not fit within the wrapping width. Try with requireNextWord=false.
                 layout = measurer.nextLayout((float)wrappingWidth, nextBreak, false);
            }
View Full Code Here

            TextLayout layout = measurer.nextLayout((float)wrappingWidth, nextBreak, true);
            if (layout == null) {
                 // layout can be null if the entire word at the current position
                 // does not fit within the wrapping width. Try with requireNextWord=false.
                 layout = measurer.nextLayout((float)wrappingWidth, nextBreak, false);
            }

            if(layout == null) {
                // exit if can't break any more
                break;
View Full Code Here

    LineBreakMeasurer measurer = new LineBreakMeasurer(iter, fr);
    measurer.setPosition(textStart);
    double y = getAbsoluteY();
    double textY = y;
    while (measurer.getPosition() < textEnd) {
      TextLayout line = measurer.nextLayout((float) layoutWidth);
      lines.add(line);
      textY += (line.getAscent() + line.getDescent() + line.getLeading());
    }
    setSize(getSize().getWidth(), textY - y);
    setValid(true);
View Full Code Here

      int textEnd = iter.getEndIndex();
      LineBreakMeasurer measurer = new LineBreakMeasurer(iter,
        fontRenderContext);
      measurer.setPosition(textStart);
      while (measurer.getPosition() < textEnd) {
        TextLayout line = measurer.nextLayout((float) layoutWidth);
        result.addLine(line);
        height += (line.getAscent() + line.getDescent() + line.getLeading());
      }
    }
    result.setSize(layoutWidth, height);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.