// Various fonts and colour types 

/* methods used 
public final static in PLAIN
public final static in BOLB
public final static in ITALIC
public Font(String fontname, int style, int size)
public void setFont (Font fnt)
public void drawLine(int x1, int y1, int x2 , int y2)
public void drawString(String s, int x, int y)
public void drawRect(int x, int y, int width, int height)
public void fillRect(int x, int y, int width, int height)
public void drawOval(int x, int y, int width, int height)
public void fillRect(int x, int y, int width , int height)
use applet class in HTML script
*/

import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Font;
import java.awt.Color;

public class VariousFonts extends Applet
{
	private Font fonta;
	private Font fontb;
	private Font fontc;
	private Font fontd;
	private Font fonte;
	
	// method called by the browser or appletviewer
	// when an Applet is going to be executed
	
	public void init()
	{
		fonta = new Font ("Times Roman",Font.PLAIN,12);
		fontb = new Font ("Courier",Font.ITALIC,14);
		fontc = new Font ("Helvetica",Font.BOLD,16);
		fontd = new Font ("Dialog",Font.BOLD+Font.ITALIC,18);
		fonte = new Font ("ZapfDingBats",Font.BOLD+Font.ITALIC,18);
		
	}
	
	//Paint on the applet
	
	public void paint(Graphics g)
	{
		// set font and color and write out on the screen
		
		g.setFont(fonta);
		g.setColor(Color.red);
		
		//String start(it x1, int y1 point)
		
		g.drawString("TimesRoman (12) - bold in red ", 25,20);
		
		// set different font and clour and write on the screen 
		
		g.setFont(fontb);
		g.setColor(Color.green);
		g.drawString("Courier (14) - Bold in Green ", 25,40);
		
		// set different font and clour and write on the screen
		g.setFont(fontc);
		g.setColor(Color.blue);
		g.drawString("Helvitica ( aerial) - (14) - Italic", 25,60);
		
		// set different font and clour and write on the screen
		
		g.setFont(fontd);
		g.setColor(Color.black);
		g.drawString("Dialog (14) - bold in black / Italic", 25,80);
		
		// set different font and clour and write on the screen
		
		g.setColor(Color.yellow);
		g.setFont(fonte);
		g.drawString("ZapfDingBats (14) - bold / Italic", 25,100);
		
		// set different font and clour and write on the screen
		
		g.setFont(fontc);
		g.setColor(Color.red);
		g.drawString("red", 25,120);
		
		//line (int x1, int y1 to int x2 , int y2 points)
		
		g.drawLine(25,150,150,150);
		
		//draw a rectagle (x1, y1, int width and int height)
		
		g.drawRect(25,160,60,80);
		
		//draws a rectagle filled with the colour red
		
		g.fillRect(180,160,60,80);
		
		//draw a rectagle (x1, y1, int width and int height)
		
		g.drawOval(25,250,60,80);
		
		g.fillOval(180,250,60,80);
	}	

}

		
