KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > test > ttfdump


1 /* *****************************************************************************
2  * ttfdump.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.test;
11
12 import java.io.*;
13 import org.openlaszlo.utils.FileUtils;
14 import org.apache.log4j.*;
15
16 // Apache Batik TrueType Font Parser
17
import org.apache.batik.svggen.font.*;
18 import org.apache.batik.svggen.font.table.*;
19
20 public class ttfdump {
21    static public void main (String JavaDoc args[]) {
22        try {
23            File src = new File (args[0]);
24            System.out.println("Trying " + src.getPath());
25            org.apache.batik.svggen.font.Font ttf;
26            ttf = org.apache.batik.svggen.font.Font.create(src.getPath());
27            NameTable nameTable = ttf.getNameTable();
28            System.out.println("Font name: " + nameTable.getRecord((short)1));
29        } catch (Exception JavaDoc e) {
30            e.printStackTrace();
31        }
32    }
33 }
34
Popular Tags