Package org.apache.harmony.awt.gl.font

Examples of org.apache.harmony.awt.gl.font.LinuxFont


        long display = xg2d.display;
        int screen = xg2d.xConfig.dev.screen;
        long colormap = x11.XDefaultColormap(display, screen);

        LinuxFont peer = (LinuxFont)g.getFont().getPeer();

        X11.XColor xcolor = getXColor(g.getColor());
        long xcolorPtr = xcolor.lock();

        /*
         * Work around for escape-subsequences.
         * We don't draw anything instead of \n,\r,\t
         *
         * */
        char[] outChars = new char[str.length()];
        char[] inChars = str.toCharArray();
        int j = 0;
        for (int i = 0; i < inChars.length; i++){
            if(peer.getFontType() == FontManager.FONT_TYPE_T1){
                if (!peer.isGlyphExists(inChars[i])){
                    continue;
                }
            }

            switch (inChars[i]){
                case '\n':
                case '\r':
                case '\t':
                    break;
                default:
                    outChars[j] = inChars[i];
                    j++;
            }
        }
        if (inChars.length != 0 ){
            LinuxNativeFont.drawStringNative(xg2d.xftDraw, display, colormap,
                    peer.getFontHandle(), (int)Math.round(x), (int)Math.round(y),
                    outChars, j, xcolorPtr);
        }
        xcolor.unlock();

    }
View Full Code Here


        long display = xg2d.display;
        int screen = xg2d.xConfig.dev.screen;
        long colormap = x11.XDefaultColormap(display, screen);

        LinuxFont peer = (LinuxFont)glyphVector.getFont().getPeer();

        X11.XColor xcolor = getXColor(g.getColor());
        long xcolorPtr = xcolor.lock();

        for (int i = 0; i < glyphVector.getNumGlyphs(); i++) {

            Glyph gl = ((CommonGlyphVector)glyphVector).vector[i];
            if (gl.getPointWidth() == 0){
                continue;
            }

            Point2D pos = glyphVector.getGlyphPosition(i);

            int xBaseLine = (int)Math.round(x + pos.getX());
            int yBaseLine = (int)Math.round(y + pos.getY());
            char chars[] = {gl.getChar()};

            LinuxNativeFont.drawStringNative(xg2d.xftDraw, display, colormap,
                    peer.getFontHandle(), xBaseLine, yBaseLine, chars, 1,
                    xcolorPtr);
        }
        xcolor.unlock();

    }
View Full Code Here

        long display = xg2d.display;
        int screen = xg2d.xConfig.dev.screen;
        long colormap = x11.XDefaultColormap(display, screen);

        LinuxFont peer = (LinuxFont)g.getFont().getPeer();

        X11.XColor xcolor = getXColor(g.getColor());
        long xcolorPtr = xcolor.lock();

        /*
         * Work around for escape-subsequences.
         * We don't draw anything instead of \n,\r,\t
         *
         * */
        char[] outChars = new char[str.length()];
        char[] inChars = str.toCharArray();
        int j = 0;
        for (int i = 0; i < inChars.length; i++){
            if(peer.getFontType() == FontManager.FONT_TYPE_T1){
                if (!peer.isGlyphExists(inChars[i])){
                    continue;
                }
            }

            switch (inChars[i]){
                case '\n':
                case '\r':
                case '\t':
                    break;
                default:
                    outChars[j] = inChars[i];
                    j++;
            }
        }
        if (inChars.length != 0 ){
            LinuxNativeFont.drawStringNative(xg2d.xftDraw, display, colormap,
                    peer.getFontHandle(isAntialiasingHintSet(g)), (int)Math.round(x), (int)Math.round(y),
                    outChars, j, xcolorPtr);
        }
        xcolor.unlock();

    }
View Full Code Here

        long display = xg2d.display;
        int screen = xg2d.xConfig.dev.screen;
        long colormap = x11.XDefaultColormap(display, screen);

        LinuxFont peer = (LinuxFont)glyphVector.getFont().getPeer();

        X11.XColor xcolor = getXColor(g.getColor());
        long xcolorPtr = xcolor.lock();

        for (int i = 0; i < glyphVector.getNumGlyphs(); i++) {

            Glyph gl = ((CommonGlyphVector)glyphVector).vector[i];
            if (gl.getPointWidth() == 0){
                continue;
            }

            Point2D pos = glyphVector.getGlyphPosition(i);

            int xBaseLine = (int)Math.round(x + pos.getX());
            int yBaseLine = (int)Math.round(y + pos.getY());
            char chars[] = {gl.getChar()};

            LinuxNativeFont.drawStringNative(xg2d.xftDraw, display, colormap,
                    peer.getFontHandle(isAntialiasingHintSet(g)), xBaseLine, yBaseLine, chars, 1,
                    xcolorPtr);
        }
        xcolor.unlock();

    }
View Full Code Here

        long display = xg2d.display;
        int screen = xg2d.xConfig.dev.screen;
        long colormap = x11.XDefaultColormap(display, screen);

        LinuxFont peer = (LinuxFont)g.getFont().getPeer();

        X11.XColor xcolor = getXColor(g.getColor());
        long xcolorPtr = xcolor.lock();

        /*
         * Work around for escape-subsequences.
         * We don't draw anything instead of \n,\r,\t
         *
         * */
        char[] outChars = new char[str.length()];
        char[] inChars = str.toCharArray();
        int j = 0;
        for (int i = 0; i < inChars.length; i++){
            if(peer.getFontType() == FontManager.FONT_TYPE_T1){
                if (!peer.isGlyphExists(inChars[i])){
                    continue;
                }
            }

            switch (inChars[i]){
                case '\n':
                case '\r':
                case '\t':
                    break;
                default:
                    outChars[j] = inChars[i];
                    j++;
            }
        }
        if (inChars.length != 0 ){
            LinuxNativeFont.drawStringNative(xg2d.xftDraw, display, colormap,
                    peer.getFontHandle(isAntialiasingHintSet(g)), (int)Math.round(x), (int)Math.round(y),
                    outChars, j, xcolorPtr);
        }
        xcolor.unlock();

    }
View Full Code Here

        long display = xg2d.display;
        int screen = xg2d.xConfig.dev.screen;
        long colormap = x11.XDefaultColormap(display, screen);

        LinuxFont peer = (LinuxFont)glyphVector.getFont().getPeer();

        X11.XColor xcolor = getXColor(g.getColor());
        long xcolorPtr = xcolor.lock();

        for (int i = 0; i < glyphVector.getNumGlyphs(); i++) {

            Glyph gl = ((CommonGlyphVector)glyphVector).vector[i];
            if (gl.getPointWidth() == 0){
                continue;
            }

            Point2D pos = glyphVector.getGlyphPosition(i);

            int xBaseLine = (int)Math.round(x + pos.getX());
            int yBaseLine = (int)Math.round(y + pos.getY());
            char chars[] = {gl.getChar()};

            LinuxNativeFont.drawStringNative(xg2d.xftDraw, display, colormap,
                    peer.getFontHandle(isAntialiasingHintSet(g)), xBaseLine, yBaseLine, chars, 1,
                    xcolorPtr);
        }
        xcolor.unlock();

    }
View Full Code Here

TOP

Related Classes of org.apache.harmony.awt.gl.font.LinuxFont

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.