Examples of RPr


Examples of org.docx4j.wml.RPr

 
   
  public static RPr getWmlRPr(CTTextCharacterProperties in) {
   
    ObjectFactory factory = Context.getWmlObjectFactory();
    RPr rPr = factory.createRPr();

    if (in==null) {
      System.out.println("Was passed null");
      return rPr;
    }
   
//        <a:rPr  i="true" />   
    if (in.isI()!=null && in.isI()) {
      rPr.setI( new BooleanDefaultTrue() );
    }
   
//        <a:rPr  b="true"
    if (in.isB()!=null && in.isB()) {
      rPr.setB( new BooleanDefaultTrue() );
    }
   
//        <a:rPr  u="sng"
    if (in.getU()!=null) {
      U u = factory.createU();
      u.setVal(UnderlineEnumeration.SINGLE);
      rPr.setU(u);
    }
//        <a:rPr  sz="4000"
    if (in.getSz()!=null) {
      rPr.setSz(
          convertFontSize(in.getSz() ) );
    }
   
    return rPr;
View Full Code Here

Examples of org.docx4j.wml.RPr

      d.appendChild(span);

      CTTextCharacterProperties textCharProps = (CTTextCharacterProperties) nodeToObjectModel(
          rPrNodeIt.nextNode(), CTTextCharacterProperties.class);

      RPr rPr = TextStyles.getWmlRPr(textCharProps);

      // Does our rPr contain anything else?
      StringBuilder inlineStyle = new StringBuilder();
      HtmlCssHelper.createCss(context.getPmlPackage(), rPr, inlineStyle);
      if (!inlineStyle.toString().equals("")) {
View Full Code Here

Examples of org.docx4j.wml.RPr

          // TODO - follow inheritance
         
          Font iTextFont = null;
         
          RPr rPr = run.getRPr();
          RFonts rFonts = rPr.getRFonts();
          String documentFont = Mapper.FONT_FALLBACK;
          if (rFonts !=null ) {
           
            documentFont = rFonts.getAscii();
           
View Full Code Here

Examples of org.docx4j.wml.RPr

      // Since default font size might be in there.
   
    fillRPrStack(defaultCharacterStyleId, rPrStack);
    rPrStack.push(documentDefaultRPr);
     
    RPr effectiveRPr = factory.createRPr();
   
    // Now, apply the properties starting at the top of the stack
    while (!rPrStack.empty() ) {
      RPr rPr = rPrStack.pop();
      applyRPr(rPr, effectiveRPr);
    }
    resolvedStyleRPrComponent.put(defaultCharacterStyleId, effectiveRPr);   
  }
View Full Code Here

Examples of org.docx4j.wml.RPr

      if (pPr.getPStyle()==null) {
//          log.warn("No pstyle:");
//          log.debug(XmlUtils.marshaltoString(pPr, true, true));
      } else {
        log.debug("pstyle:" + pPr.getPStyle().getVal());
        RPr pPrLevelRunStyle = getEffectiveRPr(pPr.getPStyle().getVal());
        // .. and apply those
       
        return getEffectiveRPrUsingPStyleRPr(expressRPr, pPrLevelRunStyle);
      }
      // Check Paragraph rPr (our special hack of using ParaRPr to format a fo:block)
View Full Code Here

Examples of org.docx4j.wml.RPr

//      // walking the hierarchy will include this if it is needed
//      if (expressRPr == null || expressRPr.getRStyle() == null ) {
//        applyRPr(resolvedStyleRPrComponent.get(defaultCharacterStyleId), effectiveRPr);               
//      }
   
    RPr effectiveRPr = null;   
    if (rPrFromPStyle==null) {
      effectiveRPr = Context.getWmlObjectFactory().createRPr();
    } else {
      effectiveRPr=(RPr)XmlUtils.deepCopy(rPrFromPStyle);
    }   
   
   
//      System.out.println("start\n" + XmlUtils.marshaltoString(effectiveRPr, true, true));
   
   
    //  Next, the table style properties are applied to each table in the document,
    //  following the conditional formatting inclusions and exclusions specified
    //  per table.
   
      // TODO - if the paragraph is in a table?
       
    //  Next, numbered item and paragraph properties are applied to each paragraph
    //  formatted with a *numbering *style**.
   
//       TODO - who uses numbering styles (as opposed to numbering
      // via a paragraph style or direct formatting)?
   
    //  Next, paragraph and run properties are
    //  applied to each paragraph as defined by the paragraph style
    // (this includes run properties defined in a paragraph style,
    //  but not run properties directly included in a pPr in the
    //  document (those only apply to a paragraph mark).
//    applyRPr(pPrLevelRunStyle, effectiveRPr);
         
    //  Next, run properties are applied to each run with a specific character style
    //  applied.    
    RPr resolvedRPr = null;
    String runStyleId;
    if (expressRPr != null && expressRPr.getRStyle() != null ) {
      runStyleId = expressRPr.getRStyle().getVal();
      resolvedRPr = getEffectiveRPr(runStyleId);
      StyleUtil.apply(resolvedRPr, effectiveRPr);
View Full Code Here

Examples of org.docx4j.wml.RPr

   */
  public RPr getEffectiveRPr(String styleId) {
    // styleId passed in could be a run style
    // or a *paragraph* style
   
    RPr resolvedRPr = resolvedStyleRPrComponent.get(styleId);
   
    if (resolvedRPr!=null) {
      return resolvedRPr;
    }
   
    // Hmm, have to do the work
    Style s = liveStyles.get(styleId);
   
    if (s==null) {     
      log.error("Couldn't find style: " + styleId);
      log.debug("Couldn't find style: " + styleId, new Throwable());
      return null;
    }

    // Comment out - this style might not have rPr,
    // but an ancestor might!
   
//    RPr expressRPr = s.getRPr();
//    if (expressRPr==null) {
//      log.error("style: " + runStyleId + " has no RPr");
//      resolvedRPr = resolvedStyleRPrComponent.get(defaultCharacterStyleId);
//      return resolvedRPr;
//    }

   
    //  Next, run properties are applied to each run with a specific character style
    //  applied.    
    Stack<RPr> rPrStack = new Stack<RPr>();
    // Haven't done this one yet       
    fillRPrStack(styleId, rPrStack);
    // Finally, on top
    rPrStack.push(documentDefaultRPr); // is this necessary? didn't we make these into a style?
           
    resolvedRPr = factory.createRPr();     
    // Now, apply the properties starting at the top of the stack
    while (!rPrStack.empty() ) {
      RPr rPr = rPrStack.pop();
      log.debug("applying " + XmlUtils.marshaltoString(rPr));
      applyRPr(rPr, resolvedRPr);
    }
    resolvedStyleRPrComponent.put(styleId, resolvedRPr);
    return resolvedRPr;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.