[jira] [Updated] (FOP-2044) Hyphenation of Uppercase Words, Combined with Underlines

2013-01-04 Thread Robert Meyer (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Meyer updated FOP-2044:
--

Attachment: patch.diff

I managed to spend a bit of time on this last night. The patch includes a new 
hyphenation test case.

 Hyphenation of Uppercase Words, Combined with Underlines
 

 Key: FOP-2044
 URL: https://issues.apache.org/jira/browse/FOP-2044
 Project: Fop
  Issue Type: Improvement
  Components: general
Affects Versions: 1.0
 Environment: Operating System: All
 Platform: All
Reporter: Thomas Schraitle
Assignee: Robert Meyer
 Attachments: output.pdf, patch.diff, uppercase-hyphen.fo, 
 uppercase-hyphen.pdf


 Consider the attached FO file which combines words of lowercase and uppercase 
 letters.
 As it is expected, the word expected is hyphenated correctly (example 2). 
 Also the uppercase SUCCESS. Even combined with underlines before and after 
 the word (see example 4 and 5).
 However, if there is another word (like OCF_SUCCESS) the word isn't 
 hyphenated at all anymore. I don't know if this is an expected behaviour or 
 an issue in the hyphenation patterns. Interestingly, XEP from RenderX 
 hyphenates it as OCF_SUC-CESS. As far as I know, they use also the TeX 
 hyphenation patterns as FOP.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (FOP-2174) [PATCH] When using SVG drawings, if no content-width and content-height is specified, 72 will be used instead of the source-resolution option.

2013-01-04 Thread Chris Bowditch (JIRA)

[ 
https://issues.apache.org/jira/browse/FOP-2174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13543940#comment-13543940
 ] 

Chris Bowditch commented on FOP-2174:
-

Thanks for the updates patch Rob. I have committed it however there was a minor 
checktyle issue reported related to the ? ending the line instead of starting 
a new line.

Patch applied in revision 1428918

 [PATCH] When using SVG drawings, if no content-width and content-height is 
 specified, 72 will be used instead of the source-resolution option.
 --

 Key: FOP-2174
 URL: https://issues.apache.org/jira/browse/FOP-2174
 Project: Fop
  Issue Type: Bug
  Components: images
Affects Versions: trunk
Reporter: Robert Meyer
Assignee: Chris Bowditch
Priority: Minor
 Fix For: trunk

 Attachments: basi2c08.png, output-144-expected.pdf, output-144.pdf, 
 patch2.diff, patch.diff, test.fo




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Resolved] (FOP-2174) [PATCH] When using SVG drawings, if no content-width and content-height is specified, 72 will be used instead of the source-resolution option.

2013-01-04 Thread Chris Bowditch (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chris Bowditch resolved FOP-2174.
-

Resolution: Fixed

 [PATCH] When using SVG drawings, if no content-width and content-height is 
 specified, 72 will be used instead of the source-resolution option.
 --

 Key: FOP-2174
 URL: https://issues.apache.org/jira/browse/FOP-2174
 Project: Fop
  Issue Type: Bug
  Components: images
Affects Versions: trunk
Reporter: Robert Meyer
Assignee: Chris Bowditch
Priority: Minor
 Fix For: trunk

 Attachments: basi2c08.png, output-144-expected.pdf, output-144.pdf, 
 patch2.diff, patch.diff, test.fo




--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: svn commit: r1428918 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java status.xml

2013-01-04 Thread Glenn Adams
are there any new tests to go along with this?

On Fri, Jan 4, 2013 at 9:11 AM, cbowdi...@apache.org wrote:

 Author: cbowditch
 Date: Fri Jan  4 15:11:52 2013
 New Revision: 1428918

 URL: http://svn.apache.org/viewvc?rev=1428918view=rev
 Log:
 Jira FOP-2174: When using SVG drawings, if no content-width and
 content-height is specified, 72 will be used instead of the
 source-resolution option
 Patch submitted by Robert Meyer (rmeyer at hotmail dot co dot uk)

 Modified:

 xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
 xmlgraphics/fop/trunk/status.xml

 Modified:
 xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
 URL:
 http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java?rev=1428918r1=1428917r2=1428918view=diff

 ==
 ---
 xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
 (original)
 +++
 xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
 Fri Jan  4 15:11:52 2013
 @@ -25,10 +25,14 @@ import java.awt.Rectangle;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;

 +import org.apache.xmlgraphics.util.UnitConv;
 +
  import org.apache.fop.datatypes.Length;
  import org.apache.fop.datatypes.PercentBaseContext;
  import org.apache.fop.fo.Constants;
  import org.apache.fop.fo.GraphicsProperties;
 +import org.apache.fop.fo.expr.PropertyException;
 +import org.apache.fop.fo.flow.AbstractGraphics;
  import org.apache.fop.fo.properties.LengthRangeProperty;

  /**
 @@ -98,9 +102,9 @@ public class ImageLayout implements Cons
  boolean constrainIntrinsicSize = false;
  int cwidth = -1;
  int cheight = -1;
 -len = props.getContentWidth();
 -if (len.getEnum() != EN_AUTO) {
 -switch (len.getEnum()) {
 +Length lenWidth = props.getContentWidth();
 +if (lenWidth.getEnum() != EN_AUTO) {
 +switch (lenWidth.getEnum()) {
  case EN_SCALE_TO_FIT:
  if (ipd != -1) {
  cwidth = ipd;
 @@ -120,12 +124,12 @@ public class ImageLayout implements Cons
  constrainIntrinsicSize = true;
  break;
  default:
 -cwidth = len.getValue(percentBaseContext);
 +cwidth = lenWidth.getValue(percentBaseContext);
  }
  }
 -len = props.getContentHeight();
 -if (len.getEnum() != EN_AUTO) {
 -switch (len.getEnum()) {
 +Length lenHeight = props.getContentHeight();
 +if (lenHeight.getEnum() != EN_AUTO) {
 +switch (lenHeight.getEnum()) {
  case EN_SCALE_TO_FIT:
  if (bpd != -1) {
  cheight = bpd;
 @@ -145,10 +149,21 @@ public class ImageLayout implements Cons
  constrainIntrinsicSize = true;
  break;
  default:
 -cheight = len.getValue(percentBaseContext);
 +cheight = lenHeight.getValue(percentBaseContext);
  }
  }

 +//If no content-width or height is specified, adjust dimensions
 based upon the source resolution
 +int sourceResolution = 72;
 +if (props instanceof AbstractGraphics) {
 +sourceResolution = (int)
 ((AbstractGraphics)props).getUserAgent().getSourceResolution();
 +}
 +boolean foundNonAuto = (lenWidth.getEnum() != EN_AUTO ||
 lenHeight.getEnum() != EN_AUTO);
 +if (!foundNonAuto) {
 +cwidth = intrinsicSize.width / (sourceResolution /
 UnitConv.IN2PT);
 +cheight = intrinsicSize.height / (sourceResolution /
 UnitConv.IN2PT);
 +}
 +
  Dimension constrainedIntrinsicSize;
  if (constrainIntrinsicSize) {
  constrainedIntrinsicSize = constrain(intrinsicSize);
 @@ -164,11 +179,13 @@ public class ImageLayout implements Cons
  //Adjust viewport if not explicit
  if (ipd == -1) {
  ipd = constrainExtent(cwidth,
 -props.getInlineProgressionDimension(),
 props.getContentWidth());
 +props.getInlineProgressionDimension(), (foundNonAuto)
 +? props.getContentWidth() : new DefaultLength());
  }
  if (bpd == -1) {
  bpd = constrainExtent(cheight,
 -props.getBlockProgressionDimension(),
 props.getContentHeight());
 +props.getBlockProgressionDimension(), (foundNonAuto)
 +? props.getContentHeight() : new DefaultLength());
  }

  this.clip = false;
 @@ -191,6 +208,36 @@ public class ImageLayout implements Cons
  this.placement = new Rectangle(xoffset, yoffset, cwidth, cheight);
  }

 +private static class DefaultLength implements Length {
 +   

Re: svn commit: r1428918 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java status.xml

2013-01-04 Thread Chris Bowditch

Hi Glenn,

Rob didn't submit one, but since the change affects layout that is a 
reasonable request.


Thanks,

Chris

On 04/01/2013 16:25, Glenn Adams wrote:

are there any new tests to go along with this?

On Fri, Jan 4, 2013 at 9:11 AM, cbowdi...@apache.org 
mailto:cbowdi...@apache.org wrote:


Author: cbowditch
Date: Fri Jan  4 15:11:52 2013
New Revision: 1428918

URL: http://svn.apache.org/viewvc?rev=1428918view=rev
Log:
Jira FOP-2174: When using SVG drawings, if no content-width and
content-height is specified, 72 will be used instead of the
source-resolution option
Patch submitted by Robert Meyer (rmeyer at hotmail dot co dot uk)

Modified:

xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
xmlgraphics/fop/trunk/status.xml

Modified:

xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
URL:

http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java?rev=1428918r1=1428917r2=1428918view=diff

==
---

xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
(original)
+++

xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
Fri Jan  4 15:11:52 2013
@@ -25,10 +25,14 @@ import java.awt.Rectangle;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;

+import org.apache.xmlgraphics.util.UnitConv;
+
 import org.apache.fop.datatypes.Length;
 import org.apache.fop.datatypes.PercentBaseContext;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.GraphicsProperties;
+import org.apache.fop.fo.expr.PropertyException;
+import org.apache.fop.fo.flow.AbstractGraphics;
 import org.apache.fop.fo.properties.LengthRangeProperty;

 /**
@@ -98,9 +102,9 @@ public class ImageLayout implements Cons
 boolean constrainIntrinsicSize = false;
 int cwidth = -1;
 int cheight = -1;
-len = props.getContentWidth();
-if (len.getEnum() != EN_AUTO) {
-switch (len.getEnum()) {
+Length lenWidth = props.getContentWidth();
+if (lenWidth.getEnum() != EN_AUTO) {
+switch (lenWidth.getEnum()) {
 case EN_SCALE_TO_FIT:
 if (ipd != -1) {
 cwidth = ipd;
@@ -120,12 +124,12 @@ public class ImageLayout implements Cons
 constrainIntrinsicSize = true;
 break;
 default:
-cwidth = len.getValue(percentBaseContext);
+cwidth = lenWidth.getValue(percentBaseContext);
 }
 }
-len = props.getContentHeight();
-if (len.getEnum() != EN_AUTO) {
-switch (len.getEnum()) {
+Length lenHeight = props.getContentHeight();
+if (lenHeight.getEnum() != EN_AUTO) {
+switch (lenHeight.getEnum()) {
 case EN_SCALE_TO_FIT:
 if (bpd != -1) {
 cheight = bpd;
@@ -145,10 +149,21 @@ public class ImageLayout implements Cons
 constrainIntrinsicSize = true;
 break;
 default:
-cheight = len.getValue(percentBaseContext);
+cheight = lenHeight.getValue(percentBaseContext);
 }
 }

+//If no content-width or height is specified, adjust
dimensions based upon the source resolution
+int sourceResolution = 72;
+if (props instanceof AbstractGraphics) {
+sourceResolution = (int)
((AbstractGraphics)props).getUserAgent().getSourceResolution();
+}
+boolean foundNonAuto = (lenWidth.getEnum() != EN_AUTO ||
lenHeight.getEnum() != EN_AUTO);
+if (!foundNonAuto) {
+cwidth = intrinsicSize.width / (sourceResolution /
UnitConv.IN2PT);
+cheight = intrinsicSize.height / (sourceResolution /
UnitConv.IN2PT);
+}
+
 Dimension constrainedIntrinsicSize;
 if (constrainIntrinsicSize) {
 constrainedIntrinsicSize = constrain(intrinsicSize);
@@ -164,11 +179,13 @@ public class ImageLayout implements Cons
 //Adjust viewport if not explicit
 if (ipd == -1) {
 ipd = constrainExtent(cwidth,
-props.getInlineProgressionDimension(),
props.getContentWidth());
+props.getInlineProgressionDimension(),
(foundNonAuto)
+? props.getContentWidth() : new DefaultLength());
 }
 if (bpd == -1) {
 bpd = 

RE: svn commit: r1428918 - in /xmlgraphics/fop/trunk: src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java status.xml

2013-01-04 Thread Robert Meyer
Hi,

I'll look into creating an AT test and / or junit test next week for this. I'll 
update the existing jira issue if that's possible, but if not then I'll create 
a new one.

Regards,

Robert

 Date: Fri, 4 Jan 2013 16:43:12 +
 From: bowditch_ch...@hotmail.com
 To: fop-dev@xmlgraphics.apache.org
 Subject: Re: svn commit: r1428918 - in /xmlgraphics/fop/trunk: 
 src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java status.xml
 
 Hi Glenn,
 
 Rob didn't submit one, but since the change affects layout that is a 
 reasonable request.
 
 Thanks,
 
 Chris
 
 On 04/01/2013 16:25, Glenn Adams wrote:
  are there any new tests to go along with this?
 
  On Fri, Jan 4, 2013 at 9:11 AM, cbowdi...@apache.org 
  mailto:cbowdi...@apache.org wrote:
 
  Author: cbowditch
  Date: Fri Jan  4 15:11:52 2013
  New Revision: 1428918
 
  URL: http://svn.apache.org/viewvc?rev=1428918view=rev
  Log:
  Jira FOP-2174: When using SVG drawings, if no content-width and
  content-height is specified, 72 will be used instead of the
  source-resolution option
  Patch submitted by Robert Meyer (rmeyer at hotmail dot co dot uk)
 
  Modified:
  
  xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
  xmlgraphics/fop/trunk/status.xml
 
  Modified:
  
  xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
  URL:
  
  http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java?rev=1428918r1=1428917r2=1428918view=diff
  
  ==
  ---
  
  xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
  (original)
  +++
  
  xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/inline/ImageLayout.java
  Fri Jan  4 15:11:52 2013
  @@ -25,10 +25,14 @@ import java.awt.Rectangle;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
 
  +import org.apache.xmlgraphics.util.UnitConv;
  +
   import org.apache.fop.datatypes.Length;
   import org.apache.fop.datatypes.PercentBaseContext;
   import org.apache.fop.fo.Constants;
   import org.apache.fop.fo.GraphicsProperties;
  +import org.apache.fop.fo.expr.PropertyException;
  +import org.apache.fop.fo.flow.AbstractGraphics;
   import org.apache.fop.fo.properties.LengthRangeProperty;
 
   /**
  @@ -98,9 +102,9 @@ public class ImageLayout implements Cons
   boolean constrainIntrinsicSize = false;
   int cwidth = -1;
   int cheight = -1;
  -len = props.getContentWidth();
  -if (len.getEnum() != EN_AUTO) {
  -switch (len.getEnum()) {
  +Length lenWidth = props.getContentWidth();
  +if (lenWidth.getEnum() != EN_AUTO) {
  +switch (lenWidth.getEnum()) {
   case EN_SCALE_TO_FIT:
   if (ipd != -1) {
   cwidth = ipd;
  @@ -120,12 +124,12 @@ public class ImageLayout implements Cons
   constrainIntrinsicSize = true;
   break;
   default:
  -cwidth = len.getValue(percentBaseContext);
  +cwidth = lenWidth.getValue(percentBaseContext);
   }
   }
  -len = props.getContentHeight();
  -if (len.getEnum() != EN_AUTO) {
  -switch (len.getEnum()) {
  +Length lenHeight = props.getContentHeight();
  +if (lenHeight.getEnum() != EN_AUTO) {
  +switch (lenHeight.getEnum()) {
   case EN_SCALE_TO_FIT:
   if (bpd != -1) {
   cheight = bpd;
  @@ -145,10 +149,21 @@ public class ImageLayout implements Cons
   constrainIntrinsicSize = true;
   break;
   default:
  -cheight = len.getValue(percentBaseContext);
  +cheight = lenHeight.getValue(percentBaseContext);
   }
   }
 
  +//If no content-width or height is specified, adjust
  dimensions based upon the source resolution
  +int sourceResolution = 72;
  +if (props instanceof AbstractGraphics) {
  +sourceResolution = (int)
  ((AbstractGraphics)props).getUserAgent().getSourceResolution();
  +}
  +boolean foundNonAuto = (lenWidth.getEnum() != EN_AUTO ||
  lenHeight.getEnum() != EN_AUTO);
  +if (!foundNonAuto) {
  +cwidth = intrinsicSize.width / (sourceResolution /
  UnitConv.IN2PT);
  +cheight = intrinsicSize.height / (sourceResolution /
  UnitConv.IN2PT);
  +}
  +
   Dimension 

[jira] [Created] (FOP-2180) [PATCH] TTFReader: Output bounding box information for glyphs

2013-01-04 Thread Alexey Neyman (JIRA)
Alexey Neyman created FOP-2180:
--

 Summary: [PATCH] TTFReader: Output bounding box information for 
glyphs
 Key: FOP-2180
 URL: https://issues.apache.org/jira/browse/FOP-2180
 Project: Fop
  Issue Type: Wish
  Components: fonts
Affects Versions: 1.1
Reporter: Alexey Neyman
Priority: Minor


As I mentioned in another email, I am trying to constrain FOP to use only 
local fonts (i.e. ones described in fop.cfg). For SVGs, I have a workaround:
- Generate fonts in SVG format using ttf2svg utility from Batik;
- Use an XSL stylesheet to embed all the fonts used by an SVG image into the 
image itself;
- Use such preprocessed SVG image as the input to FOP.

This does not work well with JEuclid, though. When JEuclid generates SVG from 
MathML, it performs font rendering - that is, replaces characters by actual 
paths. And again, it uses system fonts, not the fonts available in FOP - even 
if running as FOP plugin.

To work around this issue for MathML, I am currently switching from JEuclid to 
pMML2SVG (http://pmml2svg.sourceforge.net). It generates SVGs with text 
characters, not paths. But in order to do so, it needs font metrics. 
Unfortunately, font metrics produced by stock FOP TTFReader are not sufficient 
- this stylesheet also needs bounding box for each glyph. To obtain these, 
pMML2SVG currently packages an augmented TTFReader Java sources which are to 
be compiled and used in lieu of the stock one.

Given that the patch is very small and as far as I can tell, compatible with 
current users of font metrics (it just adds 4 attributes to glyph 
description), is it possible to integrate this support into stock FOP?

Patch from pMML2SVG, slightly modified to apply to FOP 1.1 sources, attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (FOP-2180) [PATCH] TTFReader: Output bounding box information for glyphs

2013-01-04 Thread Alexey Neyman (JIRA)

 [ 
https://issues.apache.org/jira/browse/FOP-2180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alexey Neyman updated FOP-2180:
---

Attachment: ttfreader.diff

Patch for FOP 1.1 to output bounding box info.

 [PATCH] TTFReader: Output bounding box information for glyphs
 -

 Key: FOP-2180
 URL: https://issues.apache.org/jira/browse/FOP-2180
 Project: Fop
  Issue Type: Wish
  Components: fonts
Affects Versions: 1.1
Reporter: Alexey Neyman
Priority: Minor
 Attachments: ttfreader.diff


 As I mentioned in another email, I am trying to constrain FOP to use only 
 local fonts (i.e. ones described in fop.cfg). For SVGs, I have a workaround:
 - Generate fonts in SVG format using ttf2svg utility from Batik;
 - Use an XSL stylesheet to embed all the fonts used by an SVG image into the 
 image itself;
 - Use such preprocessed SVG image as the input to FOP.
 This does not work well with JEuclid, though. When JEuclid generates SVG from 
 MathML, it performs font rendering - that is, replaces characters by actual 
 paths. And again, it uses system fonts, not the fonts available in FOP - even 
 if running as FOP plugin.
 To work around this issue for MathML, I am currently switching from JEuclid 
 to 
 pMML2SVG (http://pmml2svg.sourceforge.net). It generates SVGs with text 
 characters, not paths. But in order to do so, it needs font metrics. 
 Unfortunately, font metrics produced by stock FOP TTFReader are not 
 sufficient 
 - this stylesheet also needs bounding box for each glyph. To obtain these, 
 pMML2SVG currently packages an augmented TTFReader Java sources which are to 
 be compiled and used in lieu of the stock one.
 Given that the patch is very small and as far as I can tell, compatible with 
 current users of font metrics (it just adds 4 attributes to glyph 
 description), is it possible to integrate this support into stock FOP?
 Patch from pMML2SVG, slightly modified to apply to FOP 1.1 sources, attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira