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

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


     * doesn't exist in the WindowsFont 
     * @param index the specified character
     */
    @Override
    public Glyph getGlyph(char index) {
        Glyph result = null;
        Integer key = Integer.valueOf(index);
        if (glyphs.containsKey(key)) {
            result = glyphs.get(key);
        } else {
            if (this.addGlyph(index)) {
View Full Code Here


    /**
     * Returns default Glyph object of this WindowsFont.
     */
    @Override
    public Glyph getDefaultGlyph() {
        Glyph result;
        Integer defaultKey = Integer.valueOf(defaultChar);

        if (glyphs.containsKey(defaultKey)) {
            result = glyphs.get(defaultKey);
        } else {
View Full Code Here

    public int getMissingGlyphCode() {
        return getDefaultGlyph().getGlyphCode();
    }

    public Glyph getGlyph(char index) {
        Glyph result = null;

        Object key = new Integer(index);
        if (glyphs.containsKey(key)) {
            result = (Glyph) glyphs.get(key);
        } else {
View Full Code Here

        return result;
    }

    public Glyph getDefaultGlyph() {
        Glyph result;
        Object key = new Integer(defaultChar);
        if (glyphs.containsKey(key)) {
            result = (Glyph) glyphs.get(key);
        } else {
            if (this.fontType == FontManager.FONT_TYPE_T1){
View Full Code Here

     * doesn't exist in the WindowsFont 
     * @param index the specified character
     */
    @Override
    public Glyph getGlyph(char index) {
        Glyph result = null;
        Integer key = Integer.valueOf(index);
        if (glyphs.containsKey(key)) {
            result = glyphs.get(key);
        } else {
            if (this.addGlyph(index)) {
View Full Code Here

    /**
     * Returns default Glyph object of this WindowsFont.
     */
    @Override
    public Glyph getDefaultGlyph() {
        Glyph result;
        Integer defaultKey = Integer.valueOf(defaultChar);

        if (glyphs.containsKey(defaultKey)) {
            result = glyphs.get(defaultKey);
        } else {
View Full Code Here

        if (((gv.getLayoutFlags() & GlyphVector.FLAG_HAS_TRANSFORMS) != 0)){

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

                Glyph gl = ((CommonGlyphVector)gv).vector[i];

                if (gl.getPointWidth()==0) {
                    continue;
                }

                char chr = gl.getChar();

                AffineTransform glyphAT = gv.getGlyphTransform(i);
                if ((glyphAT == null) || glyphAT.isIdentity()){
                    chars[count] = chr;
                    int index = i * 2;
                    int ind = count * 2;
                    positions[ind] = ((CommonGlyphVector)gv).visualPositions[index];
                    positions[ind + 1] = ((CommonGlyphVector)gv).visualPositions[index+1];
                    count++;
                    continue;
                }
               
                if (glyphAT.getType() == AffineTransform.TYPE_TRANSLATION){
                    chars[count] = chr;
                    int index = i * 2;
                    int ind = count * 2;
                    positions[ind] = ((CommonGlyphVector)gv).visualPositions[index] +
                                glyphAT.getTranslateX();
                    positions[ind + 1] = ((CommonGlyphVector)gv).visualPositions[index+1] +
                                glyphAT.getTranslateY();
                    count++;
                    continue;
                }
               
                at.transform(positions, 0, positions, 0, count);
               
                status = NativeFont.gdiPlusDrawDriverChars(graphicsInfo,
                        chars,
                        count,
                        font,
                        positions,
                        NativeFont.DriverStringOptionsCmapLookup,
                        fontMatrix);
                if (status != 0 && debugOutput){
                    System.err.println("GDIPlus DrawDriverString error status = " +
                            status);
                }

                count = 0;
               
                AffineTransform at1 = new AffineTransform(glyphAT);

                at1.concatenate(fontAT);
                at1.getMatrix(matrix);

                Point2D pos = gv.getGlyphPosition(i);
               
                status = NativeFont.gdiPlusDrawDriverChar(graphicsInfo,
                        chr,
                        font,
                        (float)(x + pos.getX()),
                        (float)(y + pos.getY()),
                        NativeFont.DriverStringOptionsCmapLookup,
                        matrix);
                if (status != 0 && debugOutput){
                    System.err.println("GDIPlus DrawDriverString error status = " +
                            status);
                }

            }
            if (count != 0){
               
                at.transform(positions, 0, positions, 0, count);

                status = NativeFont.gdiPlusDrawDriverChars(graphicsInfo,
                        chars,
                        count,
                        font,
                        positions,
                        NativeFont.DriverStringOptionsCmapLookup,
                        fontMatrix);
                if (status != 0 && debugOutput){
                    System.err.println("GDIPlus DrawDriverString error status = " +
                            status);
                }

            }
        } else {
            for (int i=0; i < len ; i++){
                Glyph gl = ((CommonGlyphVector)gv).vector[i];
               
                if (gl.getPointWidth()==0) {
                    continue;
                }

                chars[count] = gl.getChar();
                int index = i * 2;
                int ind = count * 2;
                positions[ind] = ((CommonGlyphVector)gv).visualPositions[index];
                positions[ind + 1] = ((CommonGlyphVector)gv).visualPositions[index+1];
                count++;
View Full Code Here

        AffineTransform at = new AffineTransform(fontAT);
        at.getMatrix(fontMatrix);
        at.preConcatenate(AffineTransform.getTranslateInstance(x, y));
       
        for (int i=0; i < len; i++){
            Glyph gl = ((CommonGlyphVector)gv).vector[i];

            if (gl.getPointWidth() ==0){
                continue;
            }
           
            char c = gl.getChar();
            AffineTransform glyphAT = gv.getGlyphTransform(i);
            Point2D pos = gv.getGlyphPosition(i);
           
            fontIndex = wcf.getCharFontIndex(c, 0);

            if ((glyphAT == null) ||
                    glyphAT.isIdentity() ||
                    glyphAT.getType() == AffineTransform.TYPE_TRANSLATION){
                if (fontIndex != charFontIndex) {
                    charFontIndex = fontIndex;

                    at.transform(positions, 0, positions, 0, count);

                    status = NativeFont.gdiPlusDrawDriverChars(graphicsInfo,
                            chars,
                            count,
                            font,
                            positions,
                            NativeFont.DriverStringOptionsCmapLookup,
                            fontMatrix);
                    if (status != 0 && debugOutput){
                        System.err.println("gdipDrawCompositeGlyphVector: " +
                                "GDIPlus DrawDriverString error status = " +
                                status);
                    }

                    count = 0;
                    font = gl.getPFont();
                    physFont = (WindowsFont)wcf.fPhysicalFonts[charFontIndex];
                }else {
                    chars[count] = c;
                    int ind = count * 2;
                    positions[ind] = pos.getX();
                    positions[ind + 1] = pos.getY();
                    count++;
                }
                continue;
            }

            charFontIndex = fontIndex;
            if (count > 0){

                at.transform(positions, 0, positions, 0, count);

                status = NativeFont.gdiPlusDrawDriverChars(graphicsInfo,
                        chars,
                        count,
                        font,
                        positions,
                        NativeFont.DriverStringOptionsCmapLookup,
                        fontMatrix);
                if (status != 0 && debugOutput){
                    System.err.println("gdipDrawCompositeGlyphVector: GDIPlus " +
                            "DrawDriverString error status = " + status);
                }
                count = 0;
            }
           
            font = gl.getPFont();

            AffineTransform at1 = new AffineTransform(glyphAT);
            at1.concatenate(fontAT);
            at1.getMatrix(matrix);

View Full Code Here

        float yPos = 0;
      
        int count = 0;
        for (int i=0; i < len; i++){
            char c = str.charAt(i);
            Glyph gl = wf.getGlyph(c);

            // We compare Advances because Width
            // of a char can be 0 (e.g. "Space" char)
            float advance = gl.getGlyphPointMetrics().getAdvance();
            if ( advance != 0){
                chars[count] = gl.getChar();
                positions[count * 2] = xPos;
                positions[count * 2 + 1] = yPos;
                xPos += advance;
                count++;
            }
View Full Code Here

        float yPos = 0;
      
        int count = 0;
        for (int i=0; i < len; i++){
            char c = str[i];
            Glyph gl = wf.getGlyph(c);

            // We compare advances because width
            // of a char can be 0 (e.g. "Space" char)
            float advance = gl.getGlyphPointMetrics().getAdvance();
            if ( advance != 0){
                chars[count] = gl.getChar();

                positions[count * 2] = xPos;
                positions[count * 2 + 1] = yPos;

                xPos += advance;
View Full Code Here

TOP

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

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.