You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ga...@apache.org on 2012/04/12 19:31:41 UTC

svn commit: r1325394 - in /xmlgraphics/fop/trunk: src/documentation/content/xdocs/trunk/output.xml src/java/org/apache/fop/render/txt/TXTRenderer.java status.xml

Author: gadams
Date: Thu Apr 12 17:31:41 2012
New Revision: 1325394

URL: http://svn.apache.org/viewvc?rev=1325394&view=rev
Log:
Take leading derived space before/after into account when computing rows for TXT renderer.

Modified:
    xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java
    xmlgraphics/fop/trunk/status.xml

Modified: xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml?rev=1325394&r1=1325393&r2=1325394&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml (original)
+++ xmlgraphics/fop/trunk/src/documentation/content/xdocs/trunk/output.xml Thu Apr 12 17:31:41 2012
@@ -1337,8 +1337,8 @@ Note that the value of the encoding attr
   </p>
   <ul>
     <li>font-family="Courier"</li>
-    <li>font-size="7.3pt"</li>
-    <li>line-height="10.5pt"</li>
+    <li>font-size="10pt"</li>
+    <li>line-height="10pt"</li>
   </ul>
 </section>
 <section id="sandbox">
@@ -1388,4 +1388,4 @@ Note that the value of the encoding attr
 </section>
 
   </body>
-</document>
\ No newline at end of file
+</document>

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java?rev=1325394&r1=1325393&r2=1325394&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/txt/TXTRenderer.java Thu Apr 12 17:31:41 2012
@@ -72,6 +72,9 @@ public class TXTRenderer extends Abstrac
     /** Buffer for background and images. */
     private StringBuffer[] decoData;
 
+    /** Leading of line containing Courier font size of 10pt. */
+    public static final int LINE_LEADING = 1070;
+
     /** Height of one symbol in Courier font size of 10pt. */
     public static final int CHAR_HEIGHT = 7860;
 
@@ -192,7 +195,7 @@ public class TXTRenderer extends Abstrac
      */
     protected void renderText(TextArea area) {
         int col = Helper.ceilPosition(this.currentIPPosition, CHAR_WIDTH);
-        int row = Helper.ceilPosition(this.currentBPPosition, CHAR_HEIGHT);
+        int row = Helper.ceilPosition(this.currentBPPosition - LINE_LEADING, CHAR_HEIGHT + 2*LINE_LEADING);
 
         String s = area.getText();
 
@@ -216,7 +219,7 @@ public class TXTRenderer extends Abstrac
         double height = bounds.getHeight();
 
         pageWidth = Helper.ceilPosition((int) width, CHAR_WIDTH);
-        pageHeight = Helper.ceilPosition((int) height, CHAR_HEIGHT);
+        pageHeight = Helper.ceilPosition((int) height, CHAR_HEIGHT + 2*LINE_LEADING);
 
         // init buffers
         charData = new StringBuffer[pageHeight];
@@ -460,9 +463,9 @@ public class TXTRenderer extends Abstrac
      */
     public void renderImage(Image image, Rectangle2D pos) {
         int x1 = Helper.ceilPosition(currentIPPosition, CHAR_WIDTH);
-        int y1 = Helper.ceilPosition(currentBPPosition, CHAR_HEIGHT);
+        int y1 = Helper.ceilPosition(currentBPPosition - LINE_LEADING, CHAR_HEIGHT + 2*LINE_LEADING);
         int width = Helper.ceilPosition((int) pos.getWidth(), CHAR_WIDTH);
-        int height = Helper.ceilPosition((int) pos.getHeight(), CHAR_HEIGHT);
+        int height = Helper.ceilPosition((int) pos.getHeight(), CHAR_HEIGHT + 2*LINE_LEADING);
 
         fillRect(x1, y1, width, height, IMAGE_CHAR);
     }
@@ -559,9 +562,9 @@ public class TXTRenderer extends Abstrac
     protected void drawBackAndBorders(Area area, float startx, float starty,
             float width, float height) {
         bm.setWidth(Helper.ceilPosition(toMilli(width), CHAR_WIDTH));
-        bm.setHeight(Helper.ceilPosition(toMilli(height), CHAR_HEIGHT));
+        bm.setHeight(Helper.ceilPosition(toMilli(height), CHAR_HEIGHT + 2*LINE_LEADING));
         bm.setStartX(Helper.ceilPosition(toMilli(startx), CHAR_WIDTH));
-        bm.setStartY(Helper.ceilPosition(toMilli(starty), CHAR_HEIGHT));
+        bm.setStartY(Helper.ceilPosition(toMilli(starty), CHAR_HEIGHT + 2*LINE_LEADING));
 
         super.drawBackAndBorders(area, startx, starty, width, height);
     }

Modified: xmlgraphics/fop/trunk/status.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1325394&r1=1325393&r2=1325394&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Thu Apr 12 17:31:41 2012
@@ -62,9 +62,12 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
-      <action context="Code" dev="PH" type="add" fixes-bug="49893">
-        A global setting to wrap F11 images in page segments.
-    </action>
+      <action context="Code" dev="GA" type="fix" fixes-bug="52114">
+        Take leading derived space before/after into account when computing rows for TXT renderer.
+      </action>
+      <action context="Code" dev="GA" type="fix" fixes-bug="52763">
+        Support list-block in marker, thus preventing NPE.
+      </action>
       <action context="Code" dev="GA" type="fix" fixes-bug="52763">
         Support list-block in marker, thus preventing NPE.
       </action>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org