Package org.openxmlformats.schemas.drawingml.x2006.main

Examples of org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties


    /**
     * @return  font family or null if not set
     */
    public String getFontFamily(){
        CTTextCharacterProperties rPr = getRPr();
        CTTextFont font = rPr.getLatin();
        if(font != null){
            return font.getTypeface();
        }
        return XSSFFont.DEFAULT_FONT_NAME;
    }
View Full Code Here


        }
        return XSSFFont.DEFAULT_FONT_NAME;
    }

    public byte getPitchAndFamily(){
        CTTextCharacterProperties rPr = getRPr();
        CTTextFont font = rPr.getLatin();
        if(font != null){
            return font.getPitchFamily();
        }
        return 0;
    }
View Full Code Here

    /**
     * @return whether a run of text will be formatted as strikethrough text. Default is false.
     */
    public boolean isStrikethrough() {
        CTTextCharacterProperties rPr = getRPr();
        if(rPr.isSetStrike()){
            return rPr.getStrike() != STTextStrikeType.NO_STRIKE;
        }
        return false;
    }
View Full Code Here

    /**
     * @return whether a run of text will be formatted as a superscript text. Default is false.
     */
    public boolean isSuperscript() {
        CTTextCharacterProperties rPr = getRPr();
        if(rPr.isSetBaseline()){
            return rPr.getBaseline() > 0;
        }
        return false;
    }
View Full Code Here

    /**
     * @return whether a run of text will be formatted as a superscript text. Default is false.
     */
    public boolean isSubscript() {
        CTTextCharacterProperties rPr = getRPr();
        if(rPr.isSetBaseline()){
            return rPr.getBaseline() < 0;
        }
        return false;
    }
View Full Code Here

    /**
     * @return whether a run of text will be formatted as a superscript text. Default is false.
     */
    public TextCap getTextCap() {     
        CTTextCharacterProperties rPr = getRPr();
        if(rPr.isSetCap()){
            return TextCap.values()[rPr.getCap().intValue() - 1];
        }
        return TextCap.NONE;
    }
View Full Code Here

    /**
     * @return whether this run of text is formatted as bold text
     */
    public boolean isBold(){
        CTTextCharacterProperties rPr = getRPr();
        if(rPr.isSetB()){
            return rPr.getB();
        }
        return false;
    }
View Full Code Here

    /**
     * @return whether this run of text is formatted as italic text
     */
    public boolean isItalic(){
        CTTextCharacterProperties rPr = getRPr();
        if(rPr.isSetI()){
            return rPr.getI();
        }
        return false;
    }
View Full Code Here

    /**
     * @return whether this run of text is formatted as underlined text
     */
    public boolean isUnderline(){
        CTTextCharacterProperties rPr = getRPr();
        if(rPr.isSetU()){
            return rPr.getU() != STTextUnderlineType.NONE;
        }
        return false;
    }
View Full Code Here

    public CTRegularTextRun getXmlObject(){
        return _r;
    }

    public void setFontColor(Color color){
        CTTextCharacterProperties rPr = getRPr();
        CTSolidColorFillProperties fill = rPr.isSetSolidFill() ? rPr.getSolidFill() : rPr.addNewSolidFill();
        CTSRgbColor clr = fill.isSetSrgbClr() ? fill.getSrgbClr() : fill.addNewSrgbClr();
        clr.setVal(new byte[]{(byte)color.getRed(), (byte)color.getGreen(), (byte)color.getBlue()});

        if(fill.isSetHslClr()) fill.unsetHslClr();
        if(fill.isSetPrstClr()) fill.unsetPrstClr();
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties

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.