vmote       2003/09/09 07:31:08

  Modified:    src/java/org/apache/fop/rtf/renderer RTFHandler.java
  Log:
  add support for font-size and font-weight, as per patch from Peter Herweg 
(mailto:[EMAIL PROTECTED])
  
  Revision  Changes    Path
  1.17      +18 -0     xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java
  
  Index: RTFHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/rtf/renderer/RTFHandler.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- RTFHandler.java   1 Sep 2003 01:28:51 -0000       1.16
  +++ RTFHandler.java   9 Sep 2003 14:31:08 -0000       1.17
  @@ -186,6 +186,9 @@
               RtfAttributes rtfAttr = new RtfAttributes();
               attrBlockTextAlign(bl, rtfAttr);
               attrBlockBackgroundColor(bl, rtfAttr);
  +            attrBlockFontSize(bl, rtfAttr);
  +            attrBlockFontWeight(bl, rtfAttr);
  +
               para = sect.newParagraph(rtfAttr);
           } catch (IOException ioe) {
               // FIXME could we throw Exception in all FOInputHandler events?
  @@ -397,6 +400,21 @@
            } catch (IOException ioe) {
               // FIXME could we throw Exception in all FOInputHandler events?
               throw new Error("IOException: " + ioe);
  +        }
  +    }
  +
  +    private void attrBlockFontSize(Block bl, RtfAttributes rtfAttr){
  +        int fopValue = bl.properties.get("font-size").getLength().getValue()/500;
  +        rtfAttr.set("fs",fopValue);
  +    }
  +
  +    private void attrBlockFontWeight(Block bl, RtfAttributes rtfAttr){
  +        String fopValue = bl.properties.get("font-weight").getString();
  +        if(fopValue=="bold" || fopValue=="700"){
  +            rtfAttr.set("b",1);
  +        }
  +        else{
  +            rtfAttr.set("b",0);
           }
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to