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 ac...@apache.org on 2008/11/18 15:01:49 UTC

svn commit: r718594 - in /xmlgraphics/fop/branches/Temp_AFPGOCAResources: ./ lib/ src/documentation/ src/documentation/content/xdocs/ src/java/org/apache/fop/render/afp/ src/java/org/apache/fop/render/ps/

Author: acumiskey
Date: Tue Nov 18 06:01:48 2008
New Revision: 718594

URL: http://svn.apache.org/viewvc?rev=718594&view=rev
Log:
Merged revisions 718557,718570,718591 via svnmerge from 
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

........
  r718557 | vhennebert | 2008-11-18 11:10:19 +0000 (Tue, 18 Nov 2008) | 2 lines
  
  Improved the FAQ by creating a separate entry for the problem about keep-together on table-cell, and the added support for inline keeps in 0.95
........
  r718570 | jeremias | 2008-11-18 13:16:32 +0000 (Tue, 18 Nov 2008) | 1 line
  
  Update conference ads.
........
  r718591 | acumiskey | 2008-11-18 13:56:52 +0000 (Tue, 18 Nov 2008) | 2 lines
  
  TextHandler interface changes, the Graphics2D implementation is now passed to drawString().
........

Modified:
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/   (props changed)
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/lib/xmlgraphics-commons-1.4svn.jar
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/faq.xml
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/skinconf.xml
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java   (props changed)
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java
    xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/PSSVGHandler.java

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 18 06:01:48 2008
@@ -1,2 +1,2 @@
 /xmlgraphics/fop/branches/fop-0_95:684572,688085,688696
-/xmlgraphics/fop/trunk:693433-698670,699739,704008-704909,705529-706135,706272-706276,706319-707083,707627,707631-708012,708192-708851,711781,718309-718502
+/xmlgraphics/fop/trunk:693433-698670,699739,704008-704909,705529-706135,706272-706276,706319-707083,707627,707631-708012,708192-708851,711781,718309-718502,718557-718591

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Nov 18 06:01:48 2008
@@ -1 +1 @@
-/xmlgraphics/fop/trunk:1-718536
+/xmlgraphics/fop/trunk:1-718592

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/lib/xmlgraphics-commons-1.4svn.jar
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/lib/xmlgraphics-commons-1.4svn.jar?rev=718594&r1=718593&r2=718594&view=diff
==============================================================================
Binary files - no diff available.

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/faq.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/faq.xml?rev=718594&r1=718593&r2=718594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/faq.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/content/xdocs/faq.xml Tue Nov 18 06:01:48 2008
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
@@ -639,15 +639,25 @@
           <link href="http://www.mulberrytech.com/xsl/xsl-list/">XSL list
           archive</link> for how to perform these tasks.
         </p>
-        <p>
-          If your text is not hyphenated at all and overflows the cell, please check
-          if you've specified <code>keep-together="always"</code> on the table-cell
-          or one of its parent elements. <code>keep-together="always"</code> implicitely
-          also sets <code>keep-together.within-line="always"</code> which forbids FOP
-          to break the text into multiple lines. This is important as FOP supports inline-level
-          keeps since version 0.94. It's a good idea not to use the shorthand
-          <code>keep-together="always"</code> at all!
-        </p>
+      </answer>
+    </faq>
+    <faq id="table-cell-wrap">
+      <question>The contents of table cells don’t wrap</question>
+      <answer>
+        <p>You probably have <code>keep-together="always"</code> set on the table cell. See <link 
+            href="#keep-together">next question</link>.</p>
+      </answer>
+    </faq>
+    <faq id="keep-together">
+      <question>FOP 0.95 and FOP 0.94 behave differently when <code>keep-together="always"</code> 
+        is set on table cells</question>
+      <answer>
+        <p>Support for inline-level keeps has been added in FOP 0.95, and setting 
+          <code>keep-together="always"</code> also implicitly sets 
+          <code>keep-together.within-line="always"</code>, which forbids FOP
+          to break the text into multiple lines. Set 
+          <code>keep-together.within-column="always"</code> on table-cell instead. It’s a good idea 
+          not to use the shorthand <code>keep-together="always"</code> at all!</p>
       </answer>
     </faq>
     <faq id="row-height-constraint">

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/skinconf.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/skinconf.xml?rev=718594&r1=718593&r2=718594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/skinconf.xml (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/documentation/skinconf.xml Tue Nov 18 06:01:48 2008
@@ -369,19 +369,17 @@
       <width>88</width>
       <height>31</height>
     </credit>
-    <!--
     <credit box-location="alt2">
-      <name>ApacheCon Europe 2008</name>
+      <name>ApacheCon Europe 2009</name>
       <url>http://eu.apachecon.com/</url>
-      <image>http://apache.org/ads/ApacheCon/2008-europe-125x125.png</image>
+      <image>http://apache.org/ads/ApacheCon/2009-europe-125x125.png</image>
       <width>125</width>
       <height>125</height>
     </credit>
-    -->
     <credit box-location="alt2">
-      <name>ApacheCon US 2008</name>
+      <name>ApacheCon US 2009</name>
       <url>http://us.apachecon.com/</url>
-      <image>http://apache.org/ads/ApacheCon/2008-usa-125x125.png</image>
+      <image>http://apache.org/ads/ApacheCon/2009-usa-125x125.png</image>
       <width>125</width>
       <height>125</height>
     </credit>

Propchange: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 18 06:01:48 2008
@@ -1,2 +1,2 @@
 /xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java:684572,688085,688696
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java:693433-698670,699739,704008-704909,705529-706135,706272-706276,706319-707083,707627,711781,718309-718502
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPForeignAttributeReader.java:693433-698670,699739,704008-704909,705529-706135,706272-706276,706319-707083,707627,711781,718309-718502,718557-718591

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java?rev=718594&r1=718593&r2=718594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java Tue Nov 18 06:01:48 2008
@@ -25,21 +25,20 @@
 import java.io.IOException;
 import java.io.OutputStream;
 
-import org.w3c.dom.Document;
-import org.w3c.dom.svg.SVGLength;
-
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.batik.bridge.BridgeContext;
 import org.apache.batik.bridge.UnitProcessor;
 import org.apache.batik.transcoder.TranscoderException;
 import org.apache.batik.transcoder.TranscoderOutput;
 import org.apache.batik.transcoder.image.ImageTranscoder;
-import org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D;
-import org.apache.xmlgraphics.java2d.TextHandler;
-
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.fonts.FontSetup;
 import org.apache.fop.svg.AbstractFOPTranscoder;
+import org.apache.xmlgraphics.java2d.TextHandler;
+import org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D;
+import org.apache.xmlgraphics.ps.PSGenerator;
+import org.w3c.dom.Document;
+import org.w3c.dom.svg.SVGLength;
 
 /**
  * This class enables to transcode an input to a PostScript document.
@@ -70,7 +69,7 @@
  */
 public abstract class AbstractPSTranscoder extends AbstractFOPTranscoder {
 
-    private   Configuration                cfg      = null;
+    private final   Configuration                cfg      = null;
     protected AbstractPSDocumentGraphics2D graphics = null;
 
     /**
@@ -99,7 +98,8 @@
             FontInfo fontInfo = new FontInfo();
             //TODO Do custom font configuration here somewhere/somehow
             FontSetup.setup(fontInfo);
-            graphics.setCustomTextHandler(new NativeTextHandler(graphics, fontInfo));
+            PSGenerator generator = graphics.getPSGenerator();
+            graphics.setCustomTextHandler(new NativeTextHandler(generator, fontInfo));
         }
 
         super.transcode(document, uri, output);

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java?rev=718594&r1=718593&r2=718594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/NativeTextHandler.java Tue Nov 18 06:01:48 2008
@@ -19,6 +19,7 @@
 
 package org.apache.fop.render.ps;
 
+import java.awt.Graphics2D;
 import java.awt.Shape;
 import java.awt.geom.AffineTransform;
 import java.io.IOException;
@@ -37,7 +38,7 @@
  */
 public class NativeTextHandler implements PSTextHandler {
 
-    private PSGraphics2D g2d;
+    private final PSGenerator gen;
 
     /** FontInfo containing all available fonts */
     protected FontInfo fontInfo;
@@ -59,8 +60,8 @@
      * @param g2d the PSGraphics2D instance this instances is used by
      * @param fontInfo the FontInfo object with all available fonts
      */
-    public NativeTextHandler(PSGraphics2D g2d, FontInfo fontInfo) {
-        this.g2d = g2d;
+    public NativeTextHandler(PSGenerator gen, FontInfo fontInfo) {
+        this.gen = gen;
         if (fontInfo != null) {
             this.fontInfo = fontInfo;
         } else {
@@ -83,7 +84,7 @@
     }
 
     private PSGenerator getPSGenerator() {
-        return this.g2d.getPSGenerator();
+        return this.gen;
     }
 
     /** {@inheritDoc} */
@@ -98,12 +99,19 @@
         //nop
     }
 
+    /** {@inheritDoc} */
+    public void drawString(String text, float x, float y) throws IOException {
+        // TODO Remove me after removing the deprecated method in TextHandler.
+        throw new UnsupportedOperationException("Deprecated method!");
+    }
+
     /**
      * Draw a string to the PostScript document. The text is painted using
      * text operations.
      * {@inheritDoc}
      */
-    public void drawString(String s, float x, float y) throws IOException {
+    public void drawString(Graphics2D g, String s, float x, float y) throws IOException {
+        PSGraphics2D g2d = (PSGraphics2D)g;
         g2d.preparePainting();
         if (this.overrideFont == null) {
             java.awt.Font awtFont = g2d.getFont();

Modified: xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/PSSVGHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/PSSVGHandler.java?rev=718594&r1=718593&r2=718594&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/PSSVGHandler.java (original)
+++ xmlgraphics/fop/branches/Temp_AFPGOCAResources/src/java/org/apache/fop/render/ps/PSSVGHandler.java Tue Nov 18 06:01:48 2008
@@ -24,18 +24,12 @@
 import java.io.IOException;
 import java.util.Map;
 
-import org.w3c.dom.Document;
-
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.batik.bridge.BridgeContext;
 import org.apache.batik.bridge.GVTBuilder;
 import org.apache.batik.gvt.GraphicsNode;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
-import org.apache.xmlgraphics.ps.PSGenerator;
-
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.render.AbstractGenericSVGHandler;
 import org.apache.fop.render.Renderer;
@@ -43,6 +37,9 @@
 import org.apache.fop.render.RendererContextConstants;
 import org.apache.fop.svg.SVGEventProducer;
 import org.apache.fop.svg.SVGUserAgent;
+import org.apache.xmlgraphics.java2d.ps.PSGraphics2D;
+import org.apache.xmlgraphics.ps.PSGenerator;
+import org.w3c.dom.Document;
 
 /**
  * PostScript XML handler for SVG. Uses Apache Batik for SVG processing.
@@ -262,7 +259,9 @@
         NativeTextHandler nativeTextHandler = null;
         BridgeContext ctx = new BridgeContext(ua);
         if (!strokeText) {
-            nativeTextHandler = new NativeTextHandler(graphics, psInfo.getFontInfo());
+            PSGenerator generator = graphics.getPSGenerator();
+            FontInfo fontInfo = psInfo.getFontInfo();
+            nativeTextHandler = new NativeTextHandler(generator, fontInfo);
             graphics.setCustomTextHandler(nativeTextHandler);
             PSTextPainter textPainter = new PSTextPainter(nativeTextHandler);
             ctx.setTextPainter(textPainter);
@@ -283,8 +282,8 @@
         float w = (float)ctx.getDocumentSize().getWidth() * 1000f;
         float h = (float)ctx.getDocumentSize().getHeight() * 1000f;
 
-        float sx = psInfo.getWidth() / (float)w;
-        float sy = psInfo.getHeight() / (float)h;
+        float sx = psInfo.getWidth() / w;
+        float sy = psInfo.getHeight() / h;
 
         ctx = null;
         builder = null;



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