当前位置: 首页>>代码示例>>Java>>正文


Java Style.setRPr方法代码示例

本文整理汇总了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);
}
 
开发者ID:anubiann00b,项目名称:TextToDocx,代码行数:27,代码来源:Generator.java

示例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);
}
 
开发者ID:vindell,项目名称:docx4j-template,代码行数:15,代码来源:ChangingTheStyleSheet.java

示例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;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:16,代码来源:DocXReportSummaryWriter.java

示例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;
}
 
开发者ID:mizitch,项目名称:story-inspector,代码行数:15,代码来源:DocXReportSummaryWriter.java


注:本文中的org.docx4j.wml.Style.setRPr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。