Package org.pentaho.reporting.libraries.fonts.registry

Examples of org.pentaho.reporting.libraries.fonts.registry.FontNativeContext


    final float y = globalHeight - y2;

    final AffineTransform affineTransform = textSpec.getGraphics().getTransform();
    final float translateX = (float) affineTransform.getTranslateX();

    final FontNativeContext nativeContext = baseFontRecord.getNativeContext();
    if (baseFontRecord.isTrueTypeFont() && textSpec.isBold() && nativeContext.isNativeBold() == false)
    {
      final float strokeWidth = textSpec.getFontSize() / 30.0f; // right from iText ...
      if (strokeWidth == 1)
      {
        cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
      }
      else
      {
        cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE);
        cb.setLineWidth(strokeWidth);
      }
    }
    else
    {
      cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
    }

    // if the font does not declare to be italics already, emulate it ..
    if (baseFontRecord.isTrueTypeFont() && textSpec.isItalics() && nativeContext.isNativeItalics() == false)
    {
      final float italicAngle =
          baseFont.getFontDescriptor(BaseFont.ITALICANGLE, textSpec.getFontSize());
      if (italicAngle == 0)
      {
View Full Code Here


    final Float weight = attributes.get(TextAttribute.WEIGHT, TextAttribute.WEIGHT_REGULAR, Float.class);
    final Float italics = attributes.get(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE, Float.class);
    final boolean underlined = attributes.exists(TextAttribute.UNDERLINE);
    final boolean strikethrough = attributes.exists(TextAttribute.STRIKETHROUGH);

    FontNativeContext nativeContext = pdfTextSpec.getFontMetrics().getNativeContext();

    int style = 0;
    if (nativeContext.isNativeBold() == false && weight >= TextAttribute.WEIGHT_DEMIBOLD)
    {
      style |= Font.BOLD;
    }
    if (nativeContext.isNativeItalics() == false && italics >= TextAttribute.POSTURE_OBLIQUE)
    {
      style |= Font.ITALIC;
    }
    if (underlined)
    {
View Full Code Here

      final boolean italic = font.isItalic();

      final BaseFontFontMetrics fontMetrics = metaData.getBaseFontFontMetrics
          (fontName, fontSize, bold, italic, null,
              metaData.isFeatureSupported(OutputProcessorFeature.EMBED_ALL_FONTS), false);
      final FontNativeContext nativeContext = fontMetrics.getNativeContext();
      lastBaseFont = fontMetrics.getBaseFont();

      cb.setFontAndSize(lastBaseFont, fontSize);
      if (fontMetrics.isTrueTypeFont() && bold && nativeContext.isNativeBold() == false)
      {
        final float strokeWidth = font.getSize2D() / 30.0f; // right from iText ...
        if (strokeWidth == 1)
        {
          cb.setTextRenderingMode(PdfContentByte.TEXT_RENDER_MODE_FILL);
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.fonts.registry.FontNativeContext

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.