Package org.jnode.awt.font

Examples of org.jnode.awt.font.FontManager


    public void drawString(String str, float x, float y) {
        // we should call "simpleGraphics.drawString(str, (int) x, (int) y);"
        // but since it doesn't handle transform, we have to implement ourself the rendering
        // TODO should we move that code to simpleGraphics implementation ?
        JNodeToolkit tk = (JNodeToolkit) Toolkit.getDefaultToolkit();
        FontManager fm = tk.getFontManager();
        fm.drawText(surface, getClip(), getTransform(), str, getFont(), (int) x, (int) y, getColor());
    }
View Full Code Here


    /**
     * @return All fonts
     * @see java.awt.GraphicsEnvironment#getAllFonts()
     */
    public Font[] getAllFonts() {
        final FontManager fm = getFontManager();
        if (fm != null) {
            return fm.getAllFonts();
        } else {
            return new Font[0];
        }
    }
View Full Code Here

    /**
     * @see java.awt.Toolkit#getFontMetrics(java.awt.Font)
     */
    public FontMetrics getFontMetrics(Font font) {
        final FontManager fm = getFontManager();
        if (fm != null) {
            return fm.getFontMetrics(font);
        } else {
            return null;
        }
    }
View Full Code Here

public class FontManagerTest {

    public static void main(String[] args) {
        // fonts loaded
        Font[] fonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
        FontManager mgr = getFontManager();

        System.out.println("" + fonts.length + " available font(s)");
        for (int i = 0; i < fonts.length; i++) {
            final Font font = fonts[i];
            System.out.println("name=" + font.getName() +
                " family=" + font.getFamily() + "\n" +
                "\tfontName=" + font.getFontName() +
                " size=" + font.getSize() + "\n" +
                "\tmetrics=" + mgr.getFontMetrics(font));
        }
    }
View Full Code Here

TOP

Related Classes of org.jnode.awt.font.FontManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.