Search in sources :

Example 1 with CTVerticalAlignRun

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVerticalAlignRun in project poi by apache.

the class XWPFRun method setSubscript.

/**
     * Specifies the alignment which shall be applied to the contents of this
     * run in relation to the default appearance of the run's text. This allows
     * the text to be repositioned as subscript or superscript without altering
     * the font size of the run properties.
     * <p/>
     * If this element is not present, the default value is to leave the
     * formatting applied at previous level in the style hierarchy. If this
     * element is never applied in the style hierarchy, then the text shall not
     * be subscript or superscript relative to the default baseline location for
     * the contents of this run.
     * </p>
     *
     * @param valign
     * @see VerticalAlign
     */
public void setSubscript(VerticalAlign valign) {
    CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
    CTVerticalAlignRun ctValign = pr.isSetVertAlign() ? pr.getVertAlign() : pr.addNewVertAlign();
    ctValign.setVal(STVerticalAlignRun.Enum.forInt(valign.getValue()));
}
Also used : CTRPr(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr) CTVerticalAlignRun(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVerticalAlignRun)

Aggregations

CTRPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr)1 CTVerticalAlignRun (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTVerticalAlignRun)1