01: /******************************************************************************
02: * FontType.java
03: * ****************************************************************************/package org.openlaszlo.media;
04:
05: /**
06: * Class for holding font type strings.
07: *
08: * @author <a href="mailto:bloch@laszlosystems.com">Eric Bloch</a>
09: */
10: public class FontType {
11: public static final String FFT = "fft";
12: public static final String TTF = "ttf";
13:
14: /**
15: * Return the font type from a filename
16: */
17: public static String fromName(String name) {
18: int index = name.lastIndexOf('.');
19: if (index == -1 || index + 2 >= name.length()) {
20: return "";
21: }
22:
23: return name.substring(index + 1).toLowerCase();
24: }
25: }
|