Package java.awt.font

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


                final LineBreakMeasurer measurer =
                        new LineBreakMeasurer(attStr.getIterator(),
                        metrics.getFontRenderContext());


                while ((layout = measurer.nextLayout(wrapWidth)) != null) {
                    layoutList.add(layout);
                }
            }
        }
        return layoutList;
View Full Code Here


        //float availableWidth = formatWidth - ParagraphUtil.getSegmentOffset(nextTabStop, rightX); // nextTabStop can be null here; and that's OK
        float availableWidth = endX - text.getParagraph().getLeftIndent() - ParagraphUtil.getSegmentOffset(nextTabStop, rightX); // nextTabStop can be null here; and that's OK
       
        // creating a text layout object for each tab segment
        TextLayout layout =
          lineMeasurer.nextLayout(
            availableWidth,
            tabIndexOrEndIndex,
            requireNextWord
            );
       
View Full Code Here

                  paragraph,
                  startIndex,
                  startIndex + 1
                  );
               LineBreakMeasurer lbm = new LineBreakMeasurer(tmpText.getIterator(), getFontRenderContext());
               TextLayout tlyt = lbm.nextLayout(100);
              maxAscent = tlyt.getAscent();
              maxDescent = tlyt.getDescent();
              maxLeading = tlyt.getLeading();
            }
            else
View Full Code Here

                    paragraph,
                    startIndex,
                    startIndex + 1
                    );
                 LineBreakMeasurer lbm = new LineBreakMeasurer(tmpText.getIterator(), getFontRenderContext());
                 TextLayout tlyt = lbm.nextLayout(100);
                maxAscent = tlyt.getAscent();
                maxDescent = tlyt.getDescent();
                maxLeading = tlyt.getLeading();
              }
              else
View Full Code Here

            descText);
        attributedDescription.addAttribute(TextAttribute.FONT, font);
        LineBreakMeasurer lineBreakMeasurer = new LineBreakMeasurer(
            attributedDescription.getIterator(), frc);
        while (true) {
          TextLayout tl = lineBreakMeasurer.nextLayout(descTextWidth);
          if (tl == null)
            break;
          descriptionTextHeight += fontHeight;
        }
        // add an empty line after the paragraph
View Full Code Here

          attributedDescription
              .addAttribute(TextAttribute.FONT, font);
          LineBreakMeasurer lineBreakMeasurer = new LineBreakMeasurer(
              attributedDescription.getIterator(), frc);
          while (true) {
            TextLayout tl = lineBreakMeasurer
                .nextLayout(availableWidth);
            if (tl == null)
              break;
            footerTextHeight += fontHeight;
          }
View Full Code Here

        attributedDescription.addAttribute(TextAttribute.FONT, font);
        LineBreakMeasurer lineBreakMeasurer = new LineBreakMeasurer(
            attributedDescription.getIterator(), frc);
        int currOffset = 0;
        while (true) {
          TextLayout tl = lineBreakMeasurer
              .nextLayout(descLabelWidth);
          if (tl == null)
            break;
          int charCount = tl.getCharacterCount();
          String line = descText.substring(currOffset, currOffset
View Full Code Here

              .addAttribute(TextAttribute.FONT, font);
          LineBreakMeasurer lineBreakMeasurer = new LineBreakMeasurer(
              attributedDescription.getIterator(), frc);
          int currOffset = 0;
          while (true) {
            TextLayout tl = lineBreakMeasurer
                .nextLayout(footerLabelWidth);
            if (tl == null)
              break;
            int charCount = tl.getCharacterCount();
            String line = footerText.substring(currOffset,
View Full Code Here

      AttributedCharacterIterator textIterator = attributedText.getIterator();
      FontRenderContext fontRendering = g.getFontRenderContext();
      LineBreakMeasurer measurer = new LineBreakMeasurer(textIterator, fontRendering);
      WrappedLines lines = new WrappedLines();
      while(measurer.getPosition() < textIterator.getEndIndex()) {
        TextLayout layout = measurer.nextLayout(maxWidth);
        lines.add(layout);
      }
      return lines;
    }
View Full Code Here

        height = 0;
        if (length() > 0) {
            LineBreakMeasurer lbm = new LineBreakMeasurer(getIterator(), frc);
            if (lbm.getPosition() < length()) {
                while (true) {
                    TextLayout layout = lbm.nextLayout((float)width);
                    height += layout.getAscent() + layout.getDescent();
                    if (lbm.getPosition() >= length()) {
                        break;
                    }
                    height += layout.getLeading();
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.