1 /* 2 * Copyright 2002 - 2007 JEuclid, http://jeuclid.sf.net 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /* $Id: ListFonts.java,v 503f7e4f22db 2008/04/28 12:43:00 maxberger $ */ 18 19 package net.sourceforge.jeuclid.app; 20 21 import java.util.Collections; 22 import java.util.List; 23 import java.util.Vector; 24 25 import net.sourceforge.jeuclid.font.FontFactory; 26 27 /** 28 * Lists all fonts available to JEuclid. 29 * 30 * @version $Revision: 503f7e4f22db $ 31 */ 32 public final class ListFonts { 33 /** 34 * Default Constructor. 35 */ 36 private ListFonts() { 37 // Empty on purpose 38 } 39 40 /** 41 * Retrieves font list and prints it to the console. 42 * 43 * @param args 44 * not used. 45 */ 46 public static void main(final String[] args) { 47 final FontFactory f = FontFactory.getInstance(); 48 final List<String> allFonts = new Vector<String>(f.listFontNames()); 49 Collections.sort(allFonts); 50 for (final String s : allFonts) { 51 System.out.println(s); 52 } 53 } 54 }