Package com.lowagie.text

Examples of com.lowagie.text.Font


      logger.error(Tools.getStackTrace(e));
    }
   
      // headers and footers must be added before the document is opened
        HeaderFooter footer = new HeaderFooter(
                    new Phrase("Pagina n�mero: ", new Font(bf)), true);
        footer.setBorder(Rectangle.NO_BORDER);
        footer.setAlignment(Element.ALIGN_CENTER);
        document.setFooter(footer);

        HeaderFooter header = new HeaderFooter(
                    new Phrase(title, new Font(bf)), false);
        header.setAlignment(Element.ALIGN_CENTER);
        document.setHeader(header);
    document.open();
  }
View Full Code Here


     *
     * @return the font name
     */
    public String getFontName()
    {
        Font font = getCurrentFont();

        return font.getFamilyname();
    }
View Full Code Here

     *
     * @return the font style
     */
    public String getFontStyle()
    {
        Font font = getCurrentFont();
        StringBuilder sb = new StringBuilder();

        if ( font.isBold() )
        {
            sb.append( BOLD );
        }

        if ( font.isItalic() )
        {
            if ( sb.length() == 0 )
            {
                sb.append( ITALIC );
            }
            else
            {
                sb.append( "," );
                sb.append( ITALIC );
            }
        }

        if ( font.isUnderlined() )
        {
            if ( sb.length() == 0 )
            {
                sb.append( UNDERLINE );
            }
View Full Code Here

     *
     * @return the font name
     */
    public String getFontSize()
    {
        Font font = getCurrentFont();

        return String.valueOf( font.getCalculatedSize() );
    }
View Full Code Here

     *
     * @return the font color blue
     */
    public String getFontColorBlue()
    {
        Font font = getCurrentFont();

        return String.valueOf( font.color().getBlue() );
    }
View Full Code Here

     *
     * @return the font color green
     */
    public String getFontColorGreen()
    {
        Font font = getCurrentFont();

        return String.valueOf( font.color().getGreen() );
    }
View Full Code Here

     *
     * @return the font color red
     */
    public String getFontColorRed()
    {
        Font font = getCurrentFont();

        return String.valueOf( font.color().getRed() );
    }
View Full Code Here

     */
    public static Font getMonoSpacedFont( int style, float size, Color color )
    {
        try
        {
            return new Font( BaseFont.createFont( BaseFont.COURIER, BaseFont.CP1252, false ), size, style, color );
        }
        catch ( Exception e )
        {
            throw new ExceptionConverter( e );
        }
View Full Code Here

     * @param color the font color.
     * @return a font the font.
     */
    public static Font getFont( int style, float size, Color color )
    {
        Font font = new Font();
        font.setFamily( DEFAULT_FONT_NAME );
        font.setStyle( style );
        font.setSize( size );
        font.setColor( color );
        return font;
    }
View Full Code Here

      }

      final BaseFontFontMetrics fontMetrics = metaData.getBaseFontFontMetrics
          (fontName, fontSize, bold, italic, "utf-8", false, false);
      final BaseFont baseFont = fontMetrics.getBaseFont();
      final Font font = new Font(baseFont, (float) fontSize, style, textColor);
      final Chunk c = new Chunk(text, font);
      if (backgroundColor != null)
      {
        c.setBackground(backgroundColor);
      }
View Full Code Here

TOP

Related Classes of com.lowagie.text.Font

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.