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

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


          CTBlipFillProperties blipFill = pic.addNewBlipFill();
          CTBlip blip = blipFill.addNewBlip();
          blip.setEmbed( picData.getPackageRelationship().getId() );
          blipFill.addNewStretch().addNewFillRect();
         
          CTShapeProperties spPr = pic.addNewSpPr();
          CTTransform2D xfrm = spPr.addNewXfrm();
         
          CTPoint2D off = xfrm.addNewOff();
          off.setX(0);
          off.setY(0);
         
          CTPositiveSize2D ext = xfrm.addNewExt();
          ext.setCx(width);
          ext.setCy(height);
         
          CTPresetGeometry2D prstGeom = spPr.addNewPrstGeom();
          prstGeom.setPrst(STShapeType.RECT);
          prstGeom.addNewAvLst();
         
          // Finish up
          XWPFPicture xwpfPicture = new XWPFPicture(pic, paragraph);
View Full Code Here


            CTBlipFillProperties blip = pic.addNewBlipFill();
            blip.addNewBlip().setEmbed("");
            blip.addNewStretch().addNewFillRect();

            CTShapeProperties sppr = pic.addNewSpPr();
            CTTransform2D t2d = sppr.addNewXfrm();
            CTPositiveSize2D ext = t2d.addNewExt();
            //should be original picture width and height expressed in EMUs
            ext.setCx(0);
            ext.setCy(0);

            CTPoint2D off = t2d.addNewOff();
            off.setX(0);
            off.setY(0);

            CTPresetGeometry2D prstGeom = sppr.addNewPrstGeom();
            prstGeom.setPrst(STShapeType.RECT);
            prstGeom.addNewAvLst();

            prototype = pic;
        }
View Full Code Here

  }

  private void extractShapeContent(StringBuilder buffy, CTGroupShape gs) {
    CTShape[] shapes = gs.getSpArray();
    for (CTShape shape : shapes) {
      CTTextBody textBody = shape.getTxBody();
      if (textBody != null) {
        CTTextParagraph[] paras = textBody.getPArray();
        for (CTTextParagraph textParagraph : paras) {
          CTRegularTextRun[] textRuns = textParagraph.getRArray();
          for (CTRegularTextRun textRun : textRuns) {
            buffy.append(textRun.getT()).append(' ');
          }
View Full Code Here

            if(rPr.isSetLatin()) rPr.unsetLatin();
            if(rPr.isSetCs()) rPr.unsetCs();
            if(rPr.isSetSym()) rPr.unsetSym();
        } else {
            if(isSymbol){
                CTTextFont font = rPr.isSetSym() ? rPr.getSym() : rPr.addNewSym();
                font.setTypeface(typeface);
            } else {
                CTTextFont latin = rPr.isSetLatin() ? rPr.getLatin() : rPr.addNewLatin();
                latin.setTypeface(typeface);
                if(charset != -1) latin.setCharset(charset);
                if(pictAndFamily != -1) latin.setPitchFamily(pictAndFamily);
            }
        }
    }
View Full Code Here

    public String getFontFamily(){
        final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();

        CharacterPropertyFetcher<String> visitor = new CharacterPropertyFetcher<String>(_p.getLevel()){
            public boolean fetch(CTTextCharacterProperties props){
                CTTextFont font = props.getLatin();
                if(font != null){
                    String typeface = font.getTypeface();
                    if("+mj-lt".equals(typeface)) {
                        typeface = theme.getMajorFont();
                    } else if ("+mn-lt".equals(typeface)){
                        typeface = theme.getMinorFont();
                    }
View Full Code Here

    public byte getPitchAndFamily(){
        final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();

        CharacterPropertyFetcher<Byte> visitor = new CharacterPropertyFetcher<Byte>(_p.getLevel()){
            public boolean fetch(CTTextCharacterProperties props){
                CTTextFont font = props.getLatin();
                if(font != null){
                    setValue(font.getPitchFamily());
                    return true;
                }
                return false;
            }
        };
View Full Code Here

            if(rPr.isSetLatin()) rPr.unsetLatin();
            if(rPr.isSetCs()) rPr.unsetCs();
            if(rPr.isSetSym()) rPr.unsetSym();
        } else {
            if(isSymbol){
                CTTextFont font = rPr.isSetSym() ? rPr.getSym() : rPr.addNewSym();
                font.setTypeface(typeface);
            } else {
                CTTextFont latin = rPr.isSetLatin() ? rPr.getLatin() : rPr.addNewLatin();
                latin.setTypeface(typeface);
                if(charset != -1) latin.setCharset(charset);
                if(pictAndFamily != -1) latin.setPitchFamily(pictAndFamily);
            }
        }
    }
View Full Code Here

    public String getFontFamily(){
        final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();

        CharacterPropertyFetcher<String> visitor = new CharacterPropertyFetcher<String>(_p.getLevel()){
            public boolean fetch(CTTextCharacterProperties props){
                CTTextFont font = props.getLatin();
                if(font != null){
                    String typeface = font.getTypeface();
                    if("+mj-lt".equals(typeface)) {
                        typeface = theme.getMajorFont();
                    } else if ("+mn-lt".equals(typeface)){
                        typeface = theme.getMinorFont();
                    }
View Full Code Here

    public byte getPitchAndFamily(){
        final XSLFTheme theme = _p.getParentShape().getSheet().getTheme();

        CharacterPropertyFetcher<Byte> visitor = new CharacterPropertyFetcher<Byte>(_p.getLevel()){
            public boolean fetch(CTTextCharacterProperties props){
                CTTextFont font = props.getLatin();
                if(font != null){
                    setValue(font.getPitchFamily());
                    return true;
                }
                return false;
            }
        };
View Full Code Here

            else if(u1 == STUnderlineValues.NONE) rPr.setU(STTextUnderlineType.NONE);
        }
        if(pr.sizeOfIArray() > 0) rPr.setI(pr.getIArray(0).getVal());

        if(pr.sizeOfRFontArray() > 0) {
            CTTextFont rFont = rPr.isSetLatin() ? rPr.getLatin() : rPr.addNewLatin();
            rFont.setTypeface(pr.getRFontArray(0).getVal());
        }

        if(pr.sizeOfSzArray() > 0) {
            int sz = (int)(pr.getSzArray(0).getVal()*100);
            rPr.setSz(sz);
View Full Code Here

TOP

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

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.