本文整理汇总了Java中org.docx4j.wml.Style.setRPr方法的典型用法代码示例。如果您正苦于以下问题:Java Style.setRPr方法的具体用法?Java Style.setRPr怎么用?Java Style.setRPr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.docx4j.wml.Style
的用法示例。
在下文中一共展示了Style.setRPr方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStyleMLA
import org.docx4j.wml.Style; //导入方法依赖的package包/类
void setStyleMLA(Style style, boolean justify) {
ObjectFactory factory = Context.getWmlObjectFactory();
PPr paragraphProperties = factory.createPPr();
Jc justification = factory.createJc();
if (justify)
justification.setVal(JcEnumeration.BOTH);
else
justification.setVal(JcEnumeration.CENTER);
paragraphProperties.setJc(justification);
Spacing sp = factory.createPPrBaseSpacing();
sp.setAfter(BigInteger.ZERO);
sp.setBefore(BigInteger.ZERO);
sp.setLine(BigInteger.valueOf(482));
sp.setLineRule(STLineSpacingRule.AUTO);
paragraphProperties.setSpacing(sp);
style.setPPr(paragraphProperties);
RPr rpr = new RPr();
changeFont(rpr, "Times New Roman");
style.setRPr(rpr);
}
示例2: alterNormalStyle
import org.docx4j.wml.Style; //导入方法依赖的package包/类
/**
* First we create a run properties object as we want to remove nearly all of
* the existing styling. Then we change the font and font size and set the
* run properties on the given style. As in previous examples, the font size
* is defined to be in half-point size.
*/
private static void alterNormalStyle(Style style) {
// we want to change (or remove) almost all the run properties of the
// normal style, so we create a new one.
RPr rpr = new RPr();
changeFontToArial(rpr);
changeFontSize(rpr, 20);
style.setRPr(rpr);
}
示例3: createParagraphStyle
import org.docx4j.wml.Style; //导入方法依赖的package包/类
private Style createParagraphStyle(final String styleId, final PPr ppr, final RPr rpr) {
final Style style = this.wmlObjectFactory.createStyle();
style.setType("paragraph");
style.setStyleId(styleId);
final Style.Name name = this.wmlObjectFactory.createStyleName();
name.setVal(styleId);
style.setName(name);
style.setPPr(ppr);
style.setRPr(rpr);
return style;
}
示例4: createCharacterStyle
import org.docx4j.wml.Style; //导入方法依赖的package包/类
private Style createCharacterStyle(final String styleId, final RPr rpr) {
final Style style = this.wmlObjectFactory.createStyle();
style.setType("character");
style.setStyleId(styleId);
final Style.Name name = this.wmlObjectFactory.createStyleName();
name.setVal(styleId);
style.setName(name);
style.setRPr(rpr);
return style;
}