Package org.pentaho.reporting.libraries.fonts.text

Examples of org.pentaho.reporting.libraries.fonts.text.Spacing


      {
        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);
View Full Code Here


      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)
          {
            textArray.add(buffer.toString());
            textArray.add(-optimum / textSpec.getFontSize());
            buffer.setLength(0);
View Full Code Here

    }

    int glyphClassification = classificationProducer.getClassification(codePoint);
    final long kerning = kerningProducer.getKerning(codePoint);
    int breakweight = breakOpportunityProducer.createBreakOpportunity(codePoint);
    final Spacing spacing = spacingProducer.createSpacing(codePoint);
    dims = fontSizeProducer.getCharacterSize(codePoint, dims);
    int width = dims.getWidth();
    int height = dims.getHeight();
    lastLanguage = languageClassifier.getScript(codePoint);
View Full Code Here

  }

  protected SpacingProducer createSpacingProducer
      (final StyleSheet layoutContext)
  {
    final Spacing spacing;
    if (metaData.isFeatureSupported(OutputProcessorFeature.SPACING_SUPPORTED))
    {
      final double minValue = layoutContext.getDoubleStyleProperty(TextStyleKeys.X_MIN_LETTER_SPACING, 0);
      final double optValue = layoutContext.getDoubleStyleProperty(TextStyleKeys.X_OPTIMUM_LETTER_SPACING, 0);
      final double maxValue = layoutContext.getDoubleStyleProperty(TextStyleKeys.X_MAX_LETTER_SPACING, 0);

      final int minIntVal = (int) StrictGeomUtility.toInternalValue(minValue);
      final int optIntVal = (int) StrictGeomUtility.toInternalValue(optValue);
      final int maxIntVal = (int) StrictGeomUtility.toInternalValue(maxValue);

      spacing = new Spacing(minIntVal, optIntVal, maxIntVal);
      return new StaticSpacingProducer(spacing);
    }
    spacing = (Spacing.EMPTY_SPACING);
    if (spacingProducer != null && ObjectUtilities.equal(spacing, spacingProducerKey))
    {
View Full Code Here

    }

    int glyphClassification = classificationProducer.getClassification(codePoint);
    final long kerning = kerningProducer.getKerning(codePoint);
    int breakweight = breakOpportunityProducer.createBreakOpportunity(codePoint);
    final Spacing spacing = spacingProducer.createSpacing(codePoint);
    dims = fontSizeProducer.getCharacterSize(codePoint, dims);
    int width = dims.getWidth();
    int height = dims.getHeight();
    lastLanguage = languageClassifier.getScript(codePoint);
View Full Code Here

  }

  protected SpacingProducer createSpacingProducer
      (final StyleSheet layoutContext)
  {
    final Spacing spacing;
    if (metaData.isFeatureSupported(OutputProcessorFeature.SPACING_SUPPORTED))
    {
      final double minValue = layoutContext.getDoubleStyleProperty(TextStyleKeys.X_MIN_LETTER_SPACING, 0);
      final double optValue = layoutContext.getDoubleStyleProperty(TextStyleKeys.X_OPTIMUM_LETTER_SPACING, 0);
      final double maxValue = layoutContext.getDoubleStyleProperty(TextStyleKeys.X_MAX_LETTER_SPACING, 0);

      final int minIntVal = (int) StrictGeomUtility.toInternalValue(minValue);
      final int optIntVal = (int) StrictGeomUtility.toInternalValue(optValue);
      final int maxIntVal = (int) StrictGeomUtility.toInternalValue(maxValue);

      spacing = new Spacing(minIntVal, optIntVal, maxIntVal);
      return new StaticSpacingProducer(spacing);
    }
    spacing = (Spacing.EMPTY_SPACING);
    if (spacingProducer != null && ObjectUtilities.equal(spacing, spacingProducerKey))
    {
View Full Code Here

      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)
          {
            textArray.add(buffer.toString());
            textArray.add(-optimum / textSpec.getFontSize());
            buffer.setLength(0);
View Full Code Here

      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);
View Full Code Here

    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
View Full Code Here

    }

    int glyphClassification = classificationProducer.getClassification(codePoint);
    final long kerning = kerningProducer.getKerning(codePoint);
    int breakweight = breakOpportunityProducer.createBreakOpportunity(codePoint);
    final Spacing spacing = spacingProducer.createSpacing(codePoint);
    dims = fontSizeProducer.getCharacterSize(codePoint, dims);
    int width = (dims.getWidth() & 0x7FFFFFFF);
    int height = (dims.getHeight() & 0x7FFFFFFF);
    lastLanguage = languageClassifier.getScript(codePoint);
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.fonts.text.Spacing

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.