TextProperties { public void setFontName(String fontName) { mElement.setStyleFontNameAttribute(fontName); } protected  TextProperties(); protected  TextProperties(StyleTextPropertiesElement textProperties); StyleTypeDefinitions.FontStyle getFontStyle(); StyleTypeDefinitions.TextLinePosition getTextLineStyle(); StyleTypeDefinitions.FontStyle getFontStyle(Document.ScriptType type); void setFontStyle(StyleTypeDefinitions.FontStyle style); void setTextLineStyle(StyleTypeDefinitions.TextLinePosition style); void setFontStyle(StyleTypeDefinitions.FontStyle style, Document.ScriptType type); double getFontSizeInPoint(); double getFontSizeInPoint(Document.ScriptType type); void setFontSizeInPoint(double size); void setFontSizeInPoint(double size, Document.ScriptType type); String getLanguage(); String getLanguage(Document.ScriptType type); void setLanguage(String language); void setLanguage(String language, Document.ScriptType type); String getCountry(); String getCountry(Document.ScriptType type); void setCountry(String country); void setCountry(String country, Document.ScriptType type); Color getFontColor(); void setFontColor(Color fontColor); String getFontName(); String getFontName(Document.ScriptType type); void setFontName(String fontName); void setFontName(String fontName, Document.ScriptType type); Font getFont(); Font getFont(Document.ScriptType type); void setFont(Font font); void setFont(Font font, Locale language); String getFontFamilyName(Document.ScriptType type); static TextProperties getOrCreateTextProperties(OdfStyleBase style); static TextProperties getTextProperties(OdfStyleBase style); void setSubscripted(Integer fontsizePercent); void setSuperscripted(Integer fontsizePercent); Integer getSubscripted(); Integer getSuperscripted(); void setBackgroundColorAttribute(Color bkColor); String getBackgroundColorAttribute();  }
@Test public void testSetFontName() { try { SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument(); Table table = document.getTableByName("Sheet1"); Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH); Cell cell = table.getCellByPosition("A1"); font.setFamilyName("Chinese"); cell.setStringValue("testGetFontStyle."); TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite(); textProperties.setFont(font); String fontname = textProperties.getFontName(); Assert.assertEquals("Chinese", fontname); document.save(ResourceUtilities.newTestOutputFile("testFontOutput1.ods")); } catch (Exception e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); Assert.fail(e.getMessage()); } }