use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize in project poi by apache.
the class TestXSSFFont method testFontHeight.
@Test
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());
xssfFont.setFontHeight(20);
assertEquals(20.0, ctFont.getSzArray(0).getVal(), 0.0);
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize in project poi by apache.
the class TestXSSFFont method testFontHeightInPoint.
@Test
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());
xssfFont.setFontHeightInPoints((short) 20);
assertEquals(20.0, ctFont.getSzArray(0).getVal(), 0.0);
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFontSize in project poi by apache.
the class XSSFFont method setFontHeight.
/**
* 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);
}
Aggregations