Package org.jfree.layouting.renderer.text

Examples of org.jfree.layouting.renderer.text.Glyph


    long minimumChunkWidth = 0;

    final int lastPos = Math.min(glyphs.length, offset + length);
    for (int i = offset; i < lastPos; i++)
    {
      final Glyph glyph = glyphs[i];
      final Spacing spacing = glyph.getSpacing();
    //      heightAbove = Math.max(glyph.getBaseLine(), heightAbove);
    //      heightBelow = Math.max(glyph.getHeight() - glyph.getBaseLine(), heightBelow);
      final int kerning = glyph.getKerning();
      final int width = glyph.getWidth();
      if (glyph.getBreakWeight() <= BreakOpportunityProducer.BREAK_CHAR)
      {
        // for the layouting, we avoid inner-word breaks
        // Later, when we have to force breaks, we may take inner-breaks into
        // account.
        wordMinChunkWidth += width + spacing.getMinimum() - kerning;
        wordMinWidth += width + spacing.getMinimum() - kerning;
        wordPrefWidth += width + spacing.getOptimum() - kerning;
        wordMaxWidth += width + spacing.getMaximum() - kerning;
      }
      else
      {
        wordMinChunkWidth += width + spacing.getMinimum() - kerning;
        wordMinWidth += width + spacing.getMinimum() - kerning;
        wordPrefWidth += width + spacing.getOptimum() - kerning;
        wordMaxWidth += width + spacing.getMaximum() - kerning;

        minimumChunkWidth = Math.max(minimumChunkWidth, wordMinChunkWidth);
        wordMinWidth = 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 Glyph[] gs = getGlyphs();
    final int length = getLength();
    final StringBuffer b = new StringBuffer();
    for (int i = getOffset(); i < length; i++)
    {
      final Glyph g = gs[i];
      b.append((char) (0xffff & g.getCodepoint()));
      final int[] extraCPs = g.getExtraChars();
      for (int j = 0; j < extraCPs.length; j++)
      {
        final int extraCP = extraCPs[j];
        b.append(extraCP);
      }
View Full Code Here

    g2.setFont(new Font(fontSpecification.getFontFamily(), style, (int) fontSpecification.getFontSize()));

    final int length = renderableText.getOffset() + renderableText.getLength();
    for (int i = renderableText.getOffset(); i < length; i++)
    {
      final Glyph g = gs[i];
      g2.drawString(LogicalPageDrawable.glpyhToString(g), runningPos / 1000f, (posY + g.getBaseLine()) / 1000f);
      runningPos += g.getWidth();
    }
  }
View Full Code Here

    g2.setFont(new Font(fontSpecification.getFontFamily(), style, (int) fontSpecification.getFontSize()));

    final int length = renderableText.getOffset() + renderableText.getLength();
    for (int i = renderableText.getOffset(); i < length; i++)
    {
      final Glyph g = gs[i];
      g2.drawString(LogicalPageDrawable.glpyhToString(g), runningPos / 1000f, (posY + g.getBaseLine()) / 1000f);
      runningPos += g.getWidth();
    }
  }
View Full Code Here

    long minimumChunkWidth = 0;

    final int lastPos = Math.min(glyphs.length, offset + length);
    for (int i = offset; i < lastPos; i++)
    {
      final Glyph glyph = glyphs[i];
      final Spacing spacing = glyph.getSpacing();
    //      heightAbove = Math.max(glyph.getBaseLine(), heightAbove);
    //      heightBelow = Math.max(glyph.getHeight() - glyph.getBaseLine(), heightBelow);
      final int kerning = glyph.getKerning();
      final int width = glyph.getWidth();
      if (glyph.getBreakWeight() <= BreakOpportunityProducer.BREAK_CHAR)
      {
        // for the layouting, we avoid inner-word breaks
        // Later, when we have to force breaks, we may take inner-breaks into
        // account.
        wordMinChunkWidth += width + spacing.getMinimum() - kerning;
        wordMinWidth += width + spacing.getMinimum() - kerning;
        wordPrefWidth += width + spacing.getOptimum() - kerning;
        wordMaxWidth += width + spacing.getMaximum() - kerning;
      }
      else
      {
        wordMinChunkWidth += width + spacing.getMinimum() - kerning;
        wordMinWidth += width + spacing.getMinimum() - kerning;
        wordPrefWidth += width + spacing.getOptimum() - kerning;
        wordMaxWidth += width + spacing.getMaximum() - kerning;

        minimumChunkWidth = Math.max(minimumChunkWidth, wordMinChunkWidth);
        wordMinWidth = 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 Glyph[] gs = getGlyphs();
    final int length = getLength();
    final StringBuffer b = new StringBuffer();
    for (int i = getOffset(); i < length; i++)
    {
      final Glyph g = gs[i];
      b.append((char) (0xffff & g.getCodepoint()));
      final int[] extraCPs = g.getExtraChars();
      for (int j = 0; j < extraCPs.length; j++)
      {
        final int extraCP = extraCPs[j];
        b.append(extraCP);
      }
View Full Code Here

    long minimumChunkWidth = 0;

    final int lastPos = Math.min(glyphs.length, offset + length);
    for (int i = offset; i < lastPos; i++)
    {
      final Glyph glyph = glyphs[i];
      final Spacing spacing = glyph.getSpacing();
    //      heightAbove = Math.max(glyph.getBaseLine(), heightAbove);
    //      heightBelow = Math.max(glyph.getHeight() - glyph.getBaseLine(), heightBelow);
      final int kerning = glyph.getKerning();
      final int width = glyph.getWidth();
      if (glyph.getBreakWeight() <= BreakOpportunityProducer.BREAK_CHAR)
      {
        // for the layouting, we avoid inner-word breaks
        // Later, when we have to force breaks, we may take inner-breaks into
        // account.
        wordMinChunkWidth += width + spacing.getMinimum() - kerning;
        wordMinWidth += width + spacing.getMinimum() - kerning;
        wordPrefWidth += width + spacing.getOptimum() - kerning;
        wordMaxWidth += width + spacing.getMaximum() - kerning;
      }
      else
      {
        wordMinChunkWidth += width + spacing.getMinimum() - kerning;
        wordMinWidth += width + spacing.getMinimum() - kerning;
        wordPrefWidth += width + spacing.getOptimum() - kerning;
        wordMaxWidth += width + spacing.getMaximum() - kerning;

        minimumChunkWidth = Math.max(minimumChunkWidth, wordMinChunkWidth);
        wordMinWidth = 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 Glyph[] gs = getGlyphs();
    final int length = getLength();
    final StringBuffer b = new StringBuffer();
    for (int i = getOffset(); i < length; i++)
    {
      final Glyph g = gs[i];
      b.append((char) (0xffff & g.getCodepoint()));
      final int[] extraCPs = g.getExtraChars();
      for (int j = 0; j < extraCPs.length; j++)
      {
        final int extraCP = extraCPs[j];
        b.append(extraCP);
      }
View Full Code Here

    g2.setFont(new Font(fontSpecification.getFontFamily(), style, (int) fontSpecification.getFontSize()));

    int length = renderableText.getOffset() + renderableText.getLength();
    for (int i = renderableText.getOffset(); i < length; i++)
    {
      Glyph g = gs[i];
      g2.drawString(LogicalPageDrawable.glpyhToString(g), runningPos / 1000f, (posY + g.getBaseLine()) / 1000f);
      runningPos += g.getWidth();
    }
  }
View Full Code Here

TOP

Related Classes of org.jfree.layouting.renderer.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.