TextProperties implements TagParameters { public static TextPropertiesBuilder builder() { return new TextPropertiesBuilder(); } TextProperties(final Color fontColor, final String fontName, final String fontWeight,
                   final String fontStyle, final double fontSizePercentage,
                   final Length fontSizeLength, final Color fontUnderlineColor,
                   final Underline fontUnderlineStyle); static TextPropertiesBuilder builder(); @Override void appendXMLContent(final XMLUtil util, final Appendable appendable); boolean isNotEmpty(); FontFace getFontFace(); TextPropertiesBuilder toBuilder();  }
@Test public final void testBadSize() throws IOException { final TextProperties prop = TextProperties.builder().fontSize(SimpleLength.cm(10)).build(); TestHelper.assertXMLEquals( "<style:text-properties fo:font-size=\"10cm\" style:font-size-asian=\"10cm\" " + "style:font-size-complex=\"10cm\"/>", prop); }
@Test public final void testColorNameSize() throws IOException { final TextProperties prop = TextProperties.builder().fontColor(SimpleColor.ALICEBLUE) .fontName(LOFonts.LIBERATION_SERIF).fontSizePercentage(10.8).build(); TestHelper.assertXMLEquals( "<style:text-properties fo:color=\"#f0f8ff\" style:font-name=\"Liberation Serif\"" + " fo:font-size=\"10.8%\" " + "style:font-size-asian=\"10.8%\" style:font-size-complex=\"10.8%\"/>", prop); }
@Test public final void testDefault() throws IOException { final TextProperties prop = TextProperties.builder().build(); TestHelper.assertXMLEquals("<style:text-properties/>", prop); }
@Test public final void testItalicBold() throws IOException { final TextProperties prop = TextProperties.builder().fontStyleItalic().fontWeightBold().build(); TestHelper.assertXMLEquals( "<style:text-properties fo:font-weight=\"bold\" style:font-weight-asian=\"bold\" " + "style:font-weight-complex=\"bold\" fo:font-style=\"italic\" " + "style:font-style-asian=\"italic\" style:font-style-complex=\"italic\"/>", prop); }
@Test public final void testUnderline() throws IOException { final TextProperties prop = TextProperties.builder().fontUnderlineStyle(TextProperties.Underline.DASH) .fontUnderlineColor(SimpleColor.RED).build(); TestHelper.assertXMLEquals("<style:text-properties style:text-underline-style=\"dash\" " + "style:text-underline-width=\"auto\" " + "style:text-underline-color" + "=\"#ff0000\"/>", prop); }