public static void println(String mesg, int font, int x, int y, byte r, byte g, byte b, Buffer inBuffer) 
    {
        byte [] outData = (byte[]) inBuffer.getData();
        RGBFormat vfIn = (RGBFormat) inBuffer.getFormat();
        Dimension sizeIn = vfIn.getSize();

        int pixStrideIn = vfIn.getPixelStride();
        int lineStrideIn = vfIn.getLineStride();
        int f = 0;
        int op = 0;
        int xx,yy;
        int CHAR_HEIGHT = 11;
        int CHAR_LENGTH = 7;
        int CHAR_START;
        int c;
        char[] string;
        int max;
        int[] fonts;

        fonts  = font_6x11;
        if (font == FONT_8x8) 
        {
            CHAR_HEIGHT=CHAR_LENGTH=8;
            fonts = font_8x8;
        }
        
        string = mesg.toCharArray();
        max = string.length;

        if (max*pixStrideIn*CHAR_LENGTH > lineStrideIn)
            max  = lineStrideIn;
        
        if (y < CHAR_HEIGHT)
            y = CHAR_HEIGHT;
        
        if (y > sizeIn.height-CHAR_HEIGHT)
            y = sizeIn.height-CHAR_HEIGHT;
        
        for (int ii = 0; ii < string.length; ii++) 
        {
            c = (byte)string[ii];
            CHAR_START = 8; // Magic number - ie, There are only 8 bits in a byte and 
            // we iterate thru them.
            for (xx = x + (CHAR_LENGTH*ii);xx < x+(CHAR_LENGTH*ii)+CHAR_LENGTH;xx++) 
            {
                for (yy = CHAR_HEIGHT-1; yy >= 0; yy--) 
                {
                    f = fonts[(CHAR_HEIGHT * c) + yy];
                    op = lineStrideIn * (y - yy) + xx * pixStrideIn;
                    if ((f & (1 << CHAR_START)) > 0) 
                    {
                        outData[op++] = b;
                        outData[op++] = g;
                        outData[op++] = r;
                    }
                }
                
                CHAR_START--;
            }
        }
    }