Examples of TextSpanLayout


Examples of org.apache.batik.gvt.text.TextSpanLayout

                   
            int [] subCharMap = new int[end-start];
            for (int i=0; i<subCharMap.length; i++) {
                subCharMap[i] = charMap[i+start-begin];
            }
            TextSpanLayout layout = getTextLayoutFactory().
                createTextLayout(runaci, subCharMap,
                                 offset, fontRenderContext);
            TextRun run = new TextRun(layout, runaci, isChunkStart);
            textRuns.add(run);
            Point2D layoutAdvance = layout.getAdvance2D();
            if (isChunkStart)
                location = layout.getOffset();

            // System.out.println("layoutAdv: " + layoutAdvance);

            advance = new Point2D.Float(
                                        (float) (advance.getX()+layoutAdvance.getX()),
                                        (float) (advance.getY()+layoutAdvance.getY()));
            ++endChunk;
            prevTextPath = textPath;
            prevTextPathAdvance = layout.getTextPathAdvance();
            if (aci.setIndex(end) == CharacterIterator.DONE) break;
            isChunkStart = false;
        } while (true);
        // System.out.println("Adv: " + advance);
        return new TextChunk(beginChunk, endChunk, location, advance);
View Full Code Here

Examples of org.apache.flex.forks.batik.gvt.text.TextSpanLayout

                if (list != null){
                    for (int i = 0 ; i < list.size(); i++) {
                        StrokingTextPainter.TextRun run =
                            (StrokingTextPainter.TextRun)list.get(i);
                        AttributedCharacterIterator aci = run.getACI();
                        TextSpanLayout layout = run.getLayout();
                        float x = (float)pt.getX();
                        float y = (float)pt.getY();
                        TextHit textHit = layout.hitTestChar(x, y);
                        Rectangle2D bounds = layout.getBounds2D();
                        if ((textHit != null) &&
                            (bounds != null) && bounds.contains(x, y)) {
                            Object delimiter = aci.getAttribute
                                (GVTAttributedCharacterIterator.TextAttribute.TEXT_COMPOUND_DELIMITER);
                            if (delimiter instanceof Element) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.