Wednesday 13 June 2018

Using fontLister

Using fontLister


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */




/**
 *
 * @author rajesh kumar shukla
 */
import java.awt.*;

public class FontLister {

  public static void main( String[] argv ) {
    Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    for( int i = 0; i < fonts.length; i++ ) {
      System.out.println( i + " font=" + fonts[i] );
    }
    Font myFont = fonts[2].deriveFont( Font.BOLD, 32 );
  }
}

0 comments:

Post a Comment