Package org.openxmlformats.schemas.spreadsheetml.x2006.main

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize


     * get the font height in point.
     *
     * @return short - height in point
     */
    public short getFontHeight() {
        CTFontSize size = _ctFont.sizeOfSzArray() == 0 ? null : _ctFont.getSzArray(0);
        if (size != null) {
            double fontHeight = size.getVal();
            return (short)(fontHeight*20);
        }
        return (short)(DEFAULT_FONT_SIZE*20);
    }
View Full Code Here


     * set the font height in points.
     *
     * @param height - height in points
     */
    public void setFontHeight(double height) {
        CTFontSize fontSize = _ctFont.sizeOfSzArray() == 0 ? _ctFont.addNewSz() : _ctFont.getSzArray(0);
        fontSize.setVal(height);
    }
View Full Code Here

     * @return fontheight (in points/20); or -1 if not modified
     */
    public int getFontHeight(){
        if(_font.sizeOfSzArray() == 0) return -1;

        CTFontSize sz = _font.getSzArray(0);
        return (short)(20*sz.getVal());
    }
View Full Code Here

    assertEquals(true,ctFont.getStrikeArray(0).getVal());
  }

  public void testFontHeight() {
    CTFont ctFont=CTFont.Factory.newInstance();
    CTFontSize size=ctFont.addNewSz();
    size.setVal(11);
    ctFont.setSzArray(0,size);

    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(11,xssfFont.getFontHeightInPoints());
View Full Code Here

    assertEquals(20.0, ctFont.getSzArray(0).getVal(), 0.0);
  }

  public void testFontHeightInPoint() {
    CTFont ctFont=CTFont.Factory.newInstance();
    CTFontSize size=ctFont.addNewSz();
    size.setVal(14);
    ctFont.setSzArray(0,size);

    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(14,xssfFont.getFontHeightInPoints());
View Full Code Here

    assertEquals(true,ctFont.getStrikeArray(0).getVal());
  }

  public void testFontHeight() {
    CTFont ctFont=CTFont.Factory.newInstance();
    CTFontSize size=ctFont.addNewSz();
    size.setVal(11);
    ctFont.setSzArray(0,size);

    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(11,xssfFont.getFontHeightInPoints());
View Full Code Here

    assertEquals(20.0, ctFont.getSzArray(0).getVal(), 0.0);
  }

  public void testFontHeightInPoint() {
    CTFont ctFont=CTFont.Factory.newInstance();
    CTFontSize size=ctFont.addNewSz();
    size.setVal(14);
    ctFont.setSzArray(0,size);

    XSSFFont xssfFont=new XSSFFont(ctFont);
    assertEquals(14,xssfFont.getFontHeightInPoints());
View Full Code Here

         return (short)index;
     }


    public short getFontHeight() {
         CTFontSize size=ctFont.sizeOfSzArray()==0?null: ctFont.getSzArray(0);
         if(size!=null){
             double fontHeight= size.getVal()/20;
            return (short)fontHeight;
        }
        else
            return DEFAULT_FONT_SIZE/20;
    }
View Full Code Here

        else
            return DEFAULT_FONT_SIZE/20;
    }

    public short getFontHeightInPoints() {
         CTFontSize size=ctFont.sizeOfSzArray()==0?null: ctFont.getSzArray(0);
         if(size!=null){
             double fontHeight= size.getVal();
             return (short)fontHeight;
          }
        else
            return DEFAULT_FONT_SIZE;
    }
View Full Code Here

    }



    public void setFontHeight(short height) {
        CTFontSize fontSize=ctFont.sizeOfSzArray()==0?ctFont.addNewSz():ctFont.getSzArray(0);
          fontSize.setVal(height*20);
    }
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize

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.