Package java.awt.font

Examples of java.awt.font.GraphicAttribute


        hash = 37*hash + Float.floatToIntBits(height);
        return hash;
    }

    public GraphicAttribute toGraphicAttribute() {
        return new GraphicAttribute(alignment) {
            private BufferedImage image = getImage();

            @Override
            public float getAscent() {
                return originY <= 0 ? 0 : originY;
View Full Code Here


            LineMetrics lm = firstFont.getLineMetrics(breaker.text, 0, 1, breaker.frc);
            baselineOffsets = lm.getBaselineOffsets();
            baselineIndex = lm.getBaselineIndex();
        } else if (val instanceof GraphicAttribute) {
            // Get first graphic attribute and use it
            GraphicAttribute ga = (GraphicAttribute) val;

            int align = ga.getAlignment();

            if (
                    align == GraphicAttribute.TOP_ALIGNMENT ||
                    align == GraphicAttribute.BOTTOM_ALIGNMENT
            ) {
                baselineIndex = GraphicAttribute.ROMAN_BASELINE;
            } else {
                baselineIndex = align;
            }

            baselineOffsets = new float[3];
            baselineOffsets[0] = 0;
            baselineOffsets[1] = (ga.getDescent() - ga.getAscent()) / 2.f;
            baselineOffsets[2] = -ga.getAscent();
        } else { // Use defaults - Roman baseline and zero offsets
            baselineIndex = GraphicAttribute.ROMAN_BASELINE;
            baselineOffsets = new float[3];
        }
View Full Code Here

            LineMetrics lm = firstFont.getLineMetrics(breaker.text, 0, 1, breaker.frc);
            baselineOffsets = lm.getBaselineOffsets();
            baselineIndex = lm.getBaselineIndex();
        } else if (val instanceof GraphicAttribute) {
            // Get first graphic attribute and use it
            GraphicAttribute ga = (GraphicAttribute) val;

            int align = ga.getAlignment();

            if (
                    align == GraphicAttribute.TOP_ALIGNMENT ||
                    align == GraphicAttribute.BOTTOM_ALIGNMENT
            ) {
                baselineIndex = GraphicAttribute.ROMAN_BASELINE;
            } else {
                baselineIndex = align;
            }

            baselineOffsets = new float[3];
            baselineOffsets[0] = 0;
            baselineOffsets[1] = (ga.getDescent() - ga.getAscent()) / 2.f;
            baselineOffsets[2] = -ga.getAscent();
        } else { // Use defaults - Roman baseline and zero offsets
            baselineIndex = GraphicAttribute.ROMAN_BASELINE;
            baselineOffsets = new float[3];
        }
View Full Code Here

            LineMetrics lm = firstFont.getLineMetrics(breaker.text, 0, 1, breaker.frc);
            baselineOffsets = lm.getBaselineOffsets();
            baselineIndex = lm.getBaselineIndex();
        } else if (val instanceof GraphicAttribute) {
            // Get first graphic attribute and use it
            GraphicAttribute ga = (GraphicAttribute) val;

            int align = ga.getAlignment();

            if (
                    align == GraphicAttribute.TOP_ALIGNMENT ||
                    align == GraphicAttribute.BOTTOM_ALIGNMENT
            ) {
                baselineIndex = GraphicAttribute.ROMAN_BASELINE;
            } else {
                baselineIndex = align;
            }

            baselineOffsets = new float[3];
            baselineOffsets[0] = 0;
            baselineOffsets[1] = (ga.getDescent() - ga.getAscent()) / 2.f;
            baselineOffsets[2] = -ga.getAscent();
        } else { // Use defaults - Roman baseline and zero offsets
            baselineIndex = GraphicAttribute.ROMAN_BASELINE;
            baselineOffsets = new float[3];
        }
View Full Code Here

TOP

Related Classes of java.awt.font.GraphicAttribute

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.