Package org.apache.fop.area.inline

Examples of org.apache.fop.area.inline.AbstractTextArea


            public void endElement() {
                int offset = getAttributeAsInteger(lastAttributes, "offset", 0);
                int[] letterAdjust = toIntArray(lastAttributes.getValue("letter-adjust"));
                String txt = content.toString();
                WordArea word = new WordArea(txt, offset, letterAdjust);
                AbstractTextArea text = getCurrentText();
                word.setParentArea(text);
                text.addChildArea(word);
            }           
View Full Code Here


                String txt = content.toString();
                //TODO the isAdjustable parameter is currently not used/implemented
                if (txt.length() > 0) {
                    boolean adjustable = getAttributeAsBoolean(lastAttributes, "adj", true);
                    SpaceArea space = new SpaceArea(txt.charAt(0), offset, adjustable);
                    AbstractTextArea text = getCurrentText();
                    space.setParentArea(text);
                    text.addChildArea(space);
                } else {
                    Space space = new Space();
                    setAreaAttributes(lastAttributes, space);
                    setTraits(lastAttributes, space, SUBSET_COMMON);
                    setTraits(lastAttributes, space, SUBSET_BOX);
View Full Code Here

                int[] letterAdjust
                        = ConversionUtils.toIntArray(
                            lastAttributes.getValue("letter-adjust"), "\\s");
                content.flip();
                WordArea word = new WordArea(content.toString().trim(), offset, letterAdjust);
                AbstractTextArea text = getCurrentText();
                word.setParentArea(text);
                text.addChildArea(word);
            }
View Full Code Here

                //TODO the isAdjustable parameter is currently not used/implemented
                if (content.position() > 0) {
                    content.flip();
                    boolean adjustable = XMLUtil.getAttributeAsBoolean(lastAttributes, "adj", true);
                    SpaceArea space = new SpaceArea(content.charAt(0), offset, adjustable);
                    AbstractTextArea text = getCurrentText();
                    space.setParentArea(text);
                    text.addChildArea(space);
                } else {
                    Space space = new Space();
                    setAreaAttributes(lastAttributes, space);
                    setTraits(lastAttributes, space, SUBSET_COMMON);
                    setTraits(lastAttributes, space, SUBSET_BOX);
View Full Code Here

    /** {@inheritDoc} */
    protected void renderSpace(SpaceArea space) {
        Font font = getFontFromArea(space.getParentArea());
        String s = space.getSpace();

        AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
        renderText(s, null, font, textArea);

        if (textUtil.combined && space.isAdjustable()) {
            //Used for justified text, for example
            int tws = textArea.getTextWordSpaceAdjust()
                         + 2 * textArea.getTextLetterSpaceAdjust();
            if (tws != 0) {
                textUtil.adjust(tws);
            }
        }
        super.renderSpace(space);
View Full Code Here

            public void endElement() {
                int offset = getAttributeAsInteger(lastAttributes, "offset", 0);
                int[] letterAdjust = toIntArray(lastAttributes.getValue("letter-adjust"));
                String txt = content.toString();
                WordArea word = new WordArea(txt, offset, letterAdjust);
                AbstractTextArea text = getCurrentText();
                word.setParentArea(text);
                text.addChildArea(word);
            }           
View Full Code Here

                String txt = content.toString();
                //TODO the isAdjustable parameter is currently not used/implemented
                if (txt.length() > 0) {
                    boolean adjustable = getAttributeAsBoolean(lastAttributes, "adj", true);
                    SpaceArea space = new SpaceArea(txt.charAt(0), offset, adjustable);
                    AbstractTextArea text = getCurrentText();
                    space.setParentArea(text);
                    text.addChildArea(space);
                } else {
                    Space space = new Space();
                    setAreaAttributes(lastAttributes, space);
                    setTraits(lastAttributes, space, SUBSET_COMMON);
                    setTraits(lastAttributes, space, SUBSET_BOX);
View Full Code Here

    /**
     * @see org.apache.fop.render.AbstractRenderer#renderSpace(org.apache.fop.area.inline.SpaceArea)
     */
    protected void renderSpace(SpaceArea space) {
        AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
        String s = space.getSpace();
        char sp = s.charAt(0);
        Font font = getFontFromArea(textArea);
       
        int tws = (space.isAdjustable()
                ? ((TextArea) space.getParentArea()).getTextWordSpaceAdjust()
                        + 2 * textArea.getTextLetterSpaceAdjust()
                : 0);

        rmoveTo((font.getCharWidth(sp) + tws) / 1000f, 0);
        super.renderSpace(space);
    }
View Full Code Here

        String s = space.getSpace();
       
        StringBuffer pdf = new StringBuffer();

        AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
        escapeText(s, null, font, textArea, useMultiByte, pdf);

        if (space.isAdjustable()) {
            int tws = -((TextArea) space.getParentArea()).getTextWordSpaceAdjust()
                         - 2 * textArea.getTextLetterSpaceAdjust();
                   
            if (tws != 0) {
                pdf.append(format(tws / (font.getFontSize() / 1000f)));
                pdf.append(" ");
            }
View Full Code Here

TOP

Related Classes of org.apache.fop.area.inline.AbstractTextArea

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.