-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.java
98 lines (85 loc) · 3.35 KB
/
test.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*****************************************************************************/
//
// Copyright (c) James P. Buzbee 1996
// House Blend Software
//
// jbuzbee@nyx.net
//
// Permission to use, copy, modify, and distribute this software
// for any use is hereby granted provided
// this notice is kept intact within the source file
//
/***************************************************************************/
import java.awt.*;
import java.awt.Graphics;
import java.applet.Applet;
import java.awt.Image;
import java.awt.Event;
import java.io.*;
import houseblend.*;
/***************************************************************************/
public class test extends java.applet.Applet
{
HersheyFont scriptFont;
HersheyFont gothicFont;
HersheyFont rowmanFont;
public void init( )
{
scriptFont = new HersheyFont(getDocumentBase(), "scripts.jhf");
gothicFont = new HersheyFont(getDocumentBase(), "gothgbt.jhf");
rowmanFont = new HersheyFont( getDocumentBase(), "rowmans.jhf");
}
public void paint( Graphics g )
{
g.setColor( Color.white );
g.fillRect( 0,0,this.size().width, this.size().height );
g.setColor( Color.black );
scriptFont.setHeight( 1.0f );
scriptFont.setWidth( 1.0f );
scriptFont.setItalics( true );
scriptFont.setItalicsSlant( 0.8f );
scriptFont.setVerticalAlignment( HersheyFont.VERTICAL_TOP );
scriptFont.setHorizontalAlignment( HersheyFont.HORIZONTAL_CENTER );
scriptFont.drawString("This is a Centered Script Font", 250, 0, g );
scriptFont.setHeight( -1.0f );
scriptFont.setWidth( -1.0f );
scriptFont.drawString("This is a Centered Script Font", 250, 500, g );
g.setColor( Color.magenta );
gothicFont.setRotation( 45 );
gothicFont.setHeight( 2.0f );
gothicFont.setWidth( 2.0f );
gothicFont.setHorizontalAlignment( HersheyFont.HORIZONTAL_CENTER );
gothicFont.drawString("Gothic!", 220, 170, g );
g.setColor( Color.green );
rowmanFont.setLineWidth( 4 );
rowmanFont.setRotation( 270.0 );
rowmanFont.setHeight( 1.0f );
rowmanFont.setWidth( 1.0f );
rowmanFont.setItalics( false );
rowmanFont.drawString("This is a Roman Font", 0, 50, g );
g.setColor( Color.red );
rowmanFont.setWidth( -1.0f );
rowmanFont.setHeight( -1.0f );
rowmanFont.setHorizontalAlignment( HersheyFont.HORIZONTAL_RIGHT );
rowmanFont.setVerticalAlignment( HersheyFont.VERTICAL_BOTTOM );
rowmanFont.drawString("This is a Roman Font", 500, 50, g );
g.setColor( Color.blue );
rowmanFont.setRotation( -15.0 );
rowmanFont.setHeight( -1.5f );
rowmanFont.setWidth( 1.0f );
rowmanFont.setHorizontalAlignment( HersheyFont.HORIZONTAL_LEFT );
rowmanFont.drawString("Mirror Image !", 180, 360, g );
rowmanFont.setHeight( 1.5f );
rowmanFont.drawString("Mirror Image !", 180, 360, g );
g.setColor( Color.orange );
rowmanFont.setRotation( 0.0 );
rowmanFont.setHeight( 1.0f );
rowmanFont.setWidth( 1.0f );
rowmanFont.setItalics( true );
rowmanFont.setItalicsSlant( -0.5f );
rowmanFont.setHorizontalAlignment( HersheyFont.HORIZONTAL_LEFT );
rowmanFont.drawString("Reverse Italics ?", 175, 270, g );
rowmanFont.setItalicsSlant( 0.5f );
rowmanFont.drawString("Normal Italics !", 190, 300, g );
}
}