FontType.java :  » Ajax » Laszlo-4.0.10 » org » openlaszlo » media » Java Open Source

Java Open Source » Ajax » Laszlo 4.0.10 
Laszlo 4.0.10 » org » openlaszlo » media » FontType.java
/******************************************************************************
 * FontType.java
 * ****************************************************************************/

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

package org.openlaszlo.media;

/**
 * Class for holding font type strings.
 *
 * @author <a href="mailto:bloch@laszlosystems.com">Eric Bloch</a>
 */
public class FontType {
    public static final String FFT = "fft";
    public static final String TTF = "ttf";

    /**
     * Return the font type from a filename
     */
    public static String fromName(String name) {
        int index = name.lastIndexOf('.');
        if (index == -1 || index + 2 >= name.length()) {
            return "";
        }

        return name.substring(index+1).toLowerCase();
    }
}

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.