Package org.jnode.awt.font

Examples of org.jnode.awt.font.TextRenderer


        super(BDFFont.class, "bdf");       
    }

    protected TextRenderer createTextRenderer(RenderCache renderCache, Font font) {
        final BDFFont bdfFont = getCompatibleFont(font);
        final TextRenderer renderer = new BDFTextRenderer(bdfFont.getContainer());
        return renderer;
    }
View Full Code Here


     * @param y
     */
    public void drawText(Surface g, Shape clip, AffineTransform tx, CharSequence text, Font font, int x, int y,
                         Color color) {
        Font txFont = getTranslatedFont(font);
        final TextRenderer renderer = getProvider(txFont).getTextRenderer(txFont);
        renderer.render(g, clip, tx, text, x, y, color);
    }
View Full Code Here

     * @param font
     * @return The renderer
     */
    @Override
    public final TextRenderer getTextRenderer(Font font) {
        TextRenderer r = renderers.get(font);
        if (r == null) {
            r = createTextRenderer(renderCache, font);
            renderers.put(font, r);
        }
        return r;
View Full Code Here

        super(TTFFont.class, "ttf");
        log.debug("new TTFontProvider");
    }

    protected TextRenderer createTextRenderer(RenderCache renderCache, Font font) {
        TextRenderer r;
//        if (false || renderer.equals("new")) {
        r = new TTFTextRenderer(renderCache, getFontMetrics(font), getFontData(font));
//        } else {
//            r = new TTFSimpleTextRenderer(getFontData(font), font.getSize());               
//        }
View Full Code Here

    public static void main(String[] argv) {
        FontProvider<BDFFont> fp = new BDFFontProvider();
        Set<? extends Font> obj = fp.getAllFonts();
        System.out.println(obj);
        final TextRenderer tr = fp.getTextRenderer(obj.iterator().next());
        final AffineTransform tf = AffineTransform.getTranslateInstance(0, 0);
        JFrame f = new JFrame("BDF Test");
        f.add(new JComponent() {
            private static final long serialVersionUID = 1L;
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                Graphics2DSurface gs = new Graphics2DSurface((Graphics2D) g);

                tr.render(gs, null, tf, "JNode", 100, 100, Color.BLACK);
            }
        });
        f.setSize(400, 400);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
View Full Code Here

TOP

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

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.