package e4s.tutorial; import e4s.html.*; import e4s.db.*; import e4s.servlet.*; /** * Using fonts in texts. This example demonstrates how font declarations * are beeing used - in the case that they are not defined by a E4CSS this * kind of mechanism can be used. * * {@tutorial Example_Font} * * @see e4s.html.FONT */ public class Example_Font extends E4ModuleImplementation { public static E4Method startFont = null; public void startFont( HTML html ) { TABLE table = html.TABLE(); table.setBorder(); table.setCellspacing(0,0); String fonts[] = {FONT.FACE_ARIAL,FONT.FACE_COURIER,FONT.FACE_VERDANA,FONT.FACE_TIMES,"Century Schoolbook"}; for( int size = -3; size < +6; size++ ) { TR tr = table.TR(); for( int i = 0; i < fonts.length; i++ ) { TD td = tr.TD(); FONT font = td.FONT(fonts[i],size); font.println(fonts[i] + ", " + size); } } html.P(); html.FONT("ARIAL",E4Color.GREEN,2).print("This is ARIAL, 2, green"); } }