Package org.pentaho.reporting.engine.classic.core.layout.text

Examples of org.pentaho.reporting.engine.classic.core.layout.text.Glyph


    long spacerOpt = 0;

    final int lastPos = Math.min(glyphs.getSize(), offset + length);
    for (int i = offset; i < lastPos; i++)
    {
      final Glyph glyph = glyphs.getGlyph(i);
      //      heightAbove = Math.max(glyph.getBaseLine(), heightAbove);
      //      heightBelow = Math.max(glyph.getHeight() - glyph.getBaseLine(), heightBelow);
      final int kerning = glyph.getKerning();
      final int width = glyph.getWidth();
      final int realCharSpace = width - kerning;
      realCharTotal += realCharSpace;
      if (i == (lastPos - 1))
      {
        wordMinChunkWidth += realCharSpace;
      }
      else
      {
        final Spacing spacing = glyph.getSpacing();
        spacerMax += spacing.getMaximum();
        spacerMin += spacing.getMinimum();
        spacerOpt += spacing.getOptimum();
        if (normalTextSpacing == true &&
            Spacing.EMPTY_SPACING.equals(spacing) == false)
        {
          normalTextSpacing = false;
        }

        wordMinChunkWidth += spacing.getMinimum() + realCharSpace;
      }

      if (glyph.getBreakWeight() > BreakOpportunityProducer.BREAK_CHAR)
      {
        minimumChunkWidth = Math.max(minimumChunkWidth, wordMinChunkWidth);
        wordMinChunkWidth = 0;

        // Paranoid sanity checks: The word- and linebreaks should have been
        // replaced by other definitions in the text factory.
        if (glyph.getBreakWeight() == BreakOpportunityProducer.BREAK_LINE)
        {
          throw new IllegalStateException("A renderable text cannot and must " +
              "not contain linebreaks.");
        }
      }
View Full Code Here


    final int offset = node.getOffset();
    final int maxPos = offset + length;

    for (int i = offset; i < maxPos; i++)
    {
      final Glyph g = gs.getGlyph(i);
      runningPos += g.getWidth();
      if (runningPos > contentX2)
      {
        return Math.max(0, i - offset);
      }
    }
View Full Code Here

      final StringBuffer buffer = new StringBuffer(gs.getSize());
      final int maxPos = offset + computeMaximumTextSize(renderableText, contentX2);

      for (int i = offset; i < maxPos; i++)
      {
        final Glyph g = gs.getGlyph(i);
        final Spacing spacing = g.getSpacing();
        if (i != offset)
        {
          final int optimum = spacing.getOptimum();
          if (optimum != 0)
          {
View Full Code Here

      final int maxPos = renderableText.getOffset() + computeMaximumTextSize(renderableText, contentX2);
      long runningPos = posX;
      final long baselineDelta = awtBaseLine - baseline;
      for (int i = renderableText.getOffset(); i < maxPos; i++)
      {
        final Glyph g = gs.getGlyph(i);
        final float y = (float) StrictGeomUtility.toExternalValue(posY + g.getBaseLine() + baselineDelta);
        g2.drawString(gs.getGlyphAsString(i, codePointBuffer), (float) StrictGeomUtility.toExternalValue(runningPos), y);
        runningPos += g.getWidth() + g.getSpacing().getMinimum();
      }
    }
    g2.dispose();
  }
View Full Code Here

    final int offset = node.getOffset();
    final int maxPos = offset + length;

    for (int i = offset; i < maxPos; i++)
    {
      final Glyph g = gs.getGlyph(i);
      runningPos += g.getWidth();
      if (runningPos > contentX2)
      {
        return Math.max(0, i - offset);
      }
    }
View Full Code Here

    final int offset = node.getOffset();
    final int maxPos = offset + length;

    for (int i = offset; i < maxPos; i++)
    {
      final Glyph g = gs.getGlyph(i);
      runningPos += g.getWidth();
      if (runningPos > contentX2)
      {
        return Math.max(0, i - offset);
      }
    }
View Full Code Here

      final long baselineDelta = awtBaseLine - baseline;
      final float y = (float) (StrictGeomUtility.toExternalValue
          (posY + awtBaseLine + baselineDelta));
      for (int i = renderableText.getOffset(); i < maxPos; i++)
      {
        final Glyph g = gs.getGlyph(i);
        g2.drawString(gs.getGlyphAsString(i, codePointBuffer),
            (float) StrictGeomUtility.toExternalValue(runningPos), y);
        runningPos += RenderableText.convert(g.getWidth()) + g.getSpacing().getMinimum();
      }
    }
    g2.dispose();
  }
View Full Code Here

      final StringBuilder buffer = new StringBuilder(gs.getSize());
      final int maxPos = offset + renderableText.computeMaximumTextSize(contentX2);

      for (int i = offset; i < maxPos; i++)
      {
        final Glyph g = gs.getGlyph(i);
        final Spacing spacing = g.getSpacing();
        if (i != offset)
        {
          final float optimum = (float) StrictGeomUtility.toFontMetricsValue(spacing.getMinimum());
          if (optimum != 0)
          {
View Full Code Here

    long spacerOpt = 0;

    final int lastPos = Math.min(glyphs.getSize(), offset + length);
    for (int i = offset; i < lastPos; i++)
    {
      final Glyph glyph = glyphs.getGlyph(i);
      //      heightAbove = Math.max(glyph.getBaseLine(), heightAbove);
      //      heightBelow = Math.max(glyph.getHeight() - glyph.getBaseLine(), heightBelow);
      final int kerning = glyph.getKerning();
      final int width = glyph.getWidth();
      final long realCharSpace = convert(width - kerning);
      realCharTotal += realCharSpace;
      wordMinChunkWidth += realCharSpace;
      if (i != (lastPos - 1))
      {
        final Spacing spacing = glyph.getSpacing();
        spacerMax += spacing.getMaximum();
        spacerMin += spacing.getMinimum();
        spacerOpt += spacing.getOptimum();
        if (normalTextSpacing == true &&
            Spacing.EMPTY_SPACING.equals(spacing) == false)
        {
          normalTextSpacing = false;
        }

        wordMinChunkWidth += spacing.getMinimum();
      }

      if (glyph.getBreakWeight() > BreakOpportunityProducer.BREAK_CHAR)
      {
        minimumChunkWidth = Math.max(minimumChunkWidth, wordMinChunkWidth);
        wordMinChunkWidth = 0;

        // Paranoid sanity checks: The word- and linebreaks should have been
        // replaced by other definitions in the text factory.
        if (glyph.getBreakWeight() == BreakOpportunityProducer.BREAK_LINE)
        {
          throw new IllegalStateException("A renderable text cannot and must " +
              "not contain linebreaks.");
        }
      }
View Full Code Here

    final int offset = getOffset();
    final int maxPos = offset + length;

    for (int i = offset; i < maxPos; i++)
    {
      final Glyph g = gs.getGlyph(i);
      runningPos += RenderableText.convert(g.getWidth());
      if (i != offset)
      {
        runningPos += g.getSpacing().getMinimum();
      }
      if (runningPos > contentX2)
      {
        return Math.max(0, i - offset);
      }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.text.Glyph

Copyright © 2018 www.massapicom. 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.