[jira] [Updated] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3170:
---
Attachment: (was: inline-container-footnotes.fo)

> Footnotes aren't rendered in fo:inline-container
> 
>
> Key: FOP-3170
> URL: https://issues.apache.org/jira/browse/FOP-3170
> Project: FOP
>  Issue Type: Bug
>Reporter: Julien Lacour
>Priority: Major
> Attachments: inline-container-footnotes.fo, 
> inline-container-footnotes.patch
>
>
> In a flow containing a parent , children  
> aren't rendered.
> From what I've checked, in {{InlineContainerLayoutManager}}, 
>  presents in children {{KnuthBlockBox}} (gathered by 
> {{getChildKnuthElements()}}) are not transmitted to the newly created 
> {{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3170:
---
Attachment: inline-container-footnotes.fo

> Footnotes aren't rendered in fo:inline-container
> 
>
> Key: FOP-3170
> URL: https://issues.apache.org/jira/browse/FOP-3170
> Project: FOP
>  Issue Type: Bug
>Reporter: Julien Lacour
>Priority: Major
> Attachments: inline-container-footnotes.fo, 
> inline-container-footnotes.patch
>
>
> In a flow containing a parent , children  
> aren't rendered.
> From what I've checked, in {{InlineContainerLayoutManager}}, 
>  presents in children {{KnuthBlockBox}} (gathered by 
> {{getChildKnuthElements()}}) are not transmitted to the newly created 
> {{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3170:
---
Attachment: inline-container-footnotes.patch

> Footnotes aren't rendered in fo:inline-container
> 
>
> Key: FOP-3170
> URL: https://issues.apache.org/jira/browse/FOP-3170
> Project: FOP
>  Issue Type: Bug
>Reporter: Julien Lacour
>Priority: Major
> Attachments: inline-container-footnotes.fo, 
> inline-container-footnotes.patch
>
>
> In a flow containing a parent , children  
> aren't rendered.
> From what I've checked, in {{InlineContainerLayoutManager}}, 
>  presents in children {{KnuthBlockBox}} (gathered by 
> {{getChildKnuthElements()}}) are not transmitted to the newly created 
> {{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3170:
---
Attachment: (was: inline-container-footnotes.patch)

> Footnotes aren't rendered in fo:inline-container
> 
>
> Key: FOP-3170
> URL: https://issues.apache.org/jira/browse/FOP-3170
> Project: FOP
>  Issue Type: Bug
>Reporter: Julien Lacour
>Priority: Major
> Attachments: inline-container-footnotes.fo, 
> inline-container-footnotes.patch
>
>
> In a flow containing a parent , children  
> aren't rendered.
> From what I've checked, in {{InlineContainerLayoutManager}}, 
>  presents in children {{KnuthBlockBox}} (gathered by 
> {{getChildKnuthElements()}}) are not transmitted to the newly created 
> {{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17824710#comment-17824710
 ] 

Julien Lacour commented on FOP-3170:


I started a patch which mainly modifes the {{KnuthInlineBox}} class to make it 
work like {{KnuthBlockBox}} and use a footnoteList.
There are other modifications to make in {{InlineKnuthSequence}} and in all 
classes instantiating {{KnuthInlineBox}}. As I don't know all the relations 
there I think a second opinion is necessary.

> Footnotes aren't rendered in fo:inline-container
> 
>
> Key: FOP-3170
> URL: https://issues.apache.org/jira/browse/FOP-3170
> Project: FOP
>  Issue Type: Bug
>Reporter: Julien Lacour
>Priority: Major
> Attachments: inline-container-footnotes.fo, 
> inline-container-footnotes.patch
>
>
> In a flow containing a parent , children  
> aren't rendered.
> From what I've checked, in {{InlineContainerLayoutManager}}, 
>  presents in children {{KnuthBlockBox}} (gathered by 
> {{getChildKnuthElements()}}) are not transmitted to the newly created 
> {{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3170:
---
Attachment: inline-container-footnotes.patch

> Footnotes aren't rendered in fo:inline-container
> 
>
> Key: FOP-3170
> URL: https://issues.apache.org/jira/browse/FOP-3170
> Project: FOP
>  Issue Type: Bug
>Reporter: Julien Lacour
>Priority: Major
> Attachments: inline-container-footnotes.fo, 
> inline-container-footnotes.patch
>
>
> In a flow containing a parent , children  
> aren't rendered.
> From what I've checked, in {{InlineContainerLayoutManager}}, 
>  presents in children {{KnuthBlockBox}} (gathered by 
> {{getChildKnuthElements()}}) are not transmitted to the newly created 
> {{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3170:
---
Description: 
In a flow containing a parent , children  
aren't rendered.
>From what I've checked, in {{InlineContainerLayoutManager}}, 
> presents in children {{KnuthBlockBox}} (gathered by 
>{{getChildKnuthElements()}}) are not transmitted to the newly created 
>{{KnuthInlineBox}}.

  was:
In a flow containing a parent , children  
aren't rendered.
>From what I've checked, in {{InlineContainerLayoutManager}}, 
> presents in children {{KnuthBlockBox}} (gathered by 
>{{getChildKnuthElements}}) are not transmitted to the newly created 
>{{KnuthInlineBox}}.


> Footnotes aren't rendered in fo:inline-container
> 
>
> Key: FOP-3170
> URL: https://issues.apache.org/jira/browse/FOP-3170
> Project: FOP
>  Issue Type: Bug
>Reporter: Julien Lacour
>Priority: Major
> Attachments: inline-container-footnotes.fo
>
>
> In a flow containing a parent , children  
> aren't rendered.
> From what I've checked, in {{InlineContainerLayoutManager}}, 
>  presents in children {{KnuthBlockBox}} (gathered by 
> {{getChildKnuthElements()}}) are not transmitted to the newly created 
> {{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)
Julien Lacour created FOP-3170:
--

 Summary: Footnotes aren't rendered in fo:inline-container
 Key: FOP-3170
 URL: https://issues.apache.org/jira/browse/FOP-3170
 Project: FOP
  Issue Type: Bug
Reporter: Julien Lacour
 Attachments: inline-container-footnotes.fo

In a flow containing a parent , children  
aren't rendered.
>From what I've checked, in {{InlineContainerLayoutManager}}, 
> presents in children {{KnuthBlockBox}} (gathered by 
>{{getChildKnuthElements}}) are not transmitted to the newly created 
>{{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3170) Footnotes aren't rendered in fo:inline-container

2024-03-08 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3170:
---
Attachment: inline-container-footnotes.fo

> Footnotes aren't rendered in fo:inline-container
> 
>
> Key: FOP-3170
> URL: https://issues.apache.org/jira/browse/FOP-3170
> Project: FOP
>  Issue Type: Bug
>Reporter: Julien Lacour
>Priority: Major
> Attachments: inline-container-footnotes.fo
>
>
> In a flow containing a parent , children  
> aren't rendered.
> From what I've checked, in {{InlineContainerLayoutManager}}, 
>  presents in children {{KnuthBlockBox}} (gathered by 
> {{getChildKnuthElements}}) are not transmitted to the newly created 
> {{KnuthInlineBox}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-17 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17807782#comment-17807782
 ] 

Julien Lacour commented on FOP-3135:


[~jgoncalves] would you like me to put a separate issue and link them together, 
or you prefer doing it?

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour edited comment on FOP-3135 at 1/4/24 11:53 AM:
-

[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times (the font is installed on my machine):
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see [^MI-Calibri-test.pdf]).
Without the patch, I got the same display except the tspan text proportions 
changed, but in both case coordinates aren't applied.

I simply ran the {{fop -c .\conf\fop.xconf -fo ..\..\MI-test.fo -pdf 
..\..\MI-tspan.pdf}} command.


Note: I had to absolutize the path to the SVG file in the  
element or it failed with {{{}SEVERE: Image not found. URI: MI-tspan.svg. (See 
position 14:45){}}}.


was (Author: JIRAUSER300900):
[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times (the font is present on my machine):
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see [^MI-Calibri-test.pdf]).

I simply ran the {{fop -c .\conf\fop.xconf -fo ..\..\MI-test.fo -pdf 
..\..\MI-tspan.pdf}} command.


Note: I had to absolutize the path to the SVG file in the  
element or it failed with {{{}SEVERE: Image not found. URI: MI-tspan.svg. (See 
position 14:45){}}}.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour edited comment on FOP-3135 at 1/4/24 11:51 AM:
-

[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times (the font is present on my machine):
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see [^MI-Calibri-test.pdf]).

I simply ran the {{fop -c .\conf\fop.xconf -fo ..\..\MI-test.fo -pdf 
..\..\MI-tspan.pdf}} command.


Note: I had to absolutize the path to the SVG file in the  
element or it failed with {{{}SEVERE: Image not found. URI: MI-tspan.svg. (See 
position 14:45){}}}.


was (Author: JIRAUSER300900):
[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times (the font is present on my machine):
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see [^MI-Calibri-test.pdf]).

I simply ran the {{fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo 
..\test\MI-test.fo -pdf ..\test\MI-test.pdf}} command.


Note: I had to absolutize the path to the SVG file in the  
element or it failed with {{{}SEVERE: Image not found. URI: MI-tspan.svg. (See 
position 14:45){}}}.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour edited comment on FOP-3135 at 1/4/24 11:46 AM:
-

[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times (the font is present on my machine):
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see [^MI-Calibri-test.pdf]).

I simply ran the {{fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo 
..\test\MI-test.fo -pdf ..\test\MI-test.pdf}} command.


Note: I had to absolutize the path to the SVG file in the  
element or it failed with {{{}SEVERE: Image not found. URI: MI-tspan.svg. (See 
position 14:45){}}}.


was (Author: JIRAUSER300900):
[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see [^MI-Calibri-test.pdf]).

I simply ran the {{fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo 
..\test\MI-test.fo -pdf ..\test\MI-test.pdf}} command.
Note: I had to absolutize the path to the SVG file in the  
element, I got {{SEVERE: Image not found. URI: MI-tspan.svg. (See position 
14:45)}} if not. Of course the calibri font is installed on my machine.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour edited comment on FOP-3135 at 1/4/24 11:13 AM:
-

[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see [^MI-Calibri-test.pdf]).

I simply ran the {{fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo 
..\test\MI-test.fo -pdf ..\test\MI-test.pdf}} command.
Note: I had to absolutize the path to the SVG file in the  
element, I got {{SEVERE: Image not found. URI: MI-tspan.svg. (See position 
14:45)}} if not. Of course the calibri font is installed on my machine.


was (Author: JIRAUSER300900):
[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).

I simply ran the {{fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo 
..\test\MI-test.fo -pdf ..\test\MI-test.pdf}} command.
Note: I had to absolutize the path to the SVG file in the  
element, I got {{SEVERE: Image not found. URI: MI-tspan.svg. (See position 
14:45)}} if not. Of course the calibri font is installed on my machine.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour edited comment on FOP-3135 at 1/4/24 11:09 AM:
-

[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).

I simply ran the {{fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo 
..\test\MI-test.fo -pdf ..\test\MI-test.pdf}} command.
Note: I had to absolutize the path to the SVG file in the  
element, I got {{SEVERE: Image not found. URI: MI-tspan.svg. (See position 
14:45)}} if not. Of course the calibri font is installed on my machine.


was (Author: JIRAUSER300900):
[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).

I simply ran the following command {{fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo 
..\test\MI-test.fo -pdf ..\test\MI-test.pdf}}.
PS: I has to absolutize the path to the SVG file in the  
element, I got {{SEVERE: Image not found. URI: MI-tspan.svg. (See position 
14:45)}} if not..

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour edited comment on FOP-3135 at 1/4/24 11:08 AM:
-

[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).

I simply ran the following command {{fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo 
..\test\MI-test.fo -pdf ..\test\MI-test.pdf}}.
PS: I has to absolutize the path to the SVG file in the  
element, I got {{SEVERE: Image not found. URI: MI-tspan.svg. (See position 
14:45)}} if not..


was (Author: JIRAUSER300900):
[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).

I simply ran the following command: 
{code}
fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo ..\test\MI-test.fo -pdf 
..\test\MI-test.pdf
{code}
PS: I has to absolutize the path to the SVG file in the  
element.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour edited comment on FOP-3135 at 1/4/24 11:07 AM:
-

[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).

I simply ran the following command: 
{code}
fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo ..\test\MI-test.fo -pdf 
..\test\MI-test.pdf
{code}
PS: I has to absolutize the path to the SVG file in the  
element.


was (Author: JIRAUSER300900):
[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).
I simply ran the following command: 
{code}
fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo ..\test\MI-test.fo -pdf 
..\test\MI-test.pdf
{code}
PS: I has to absolutize the path to the SVG file in the  
element.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour edited comment on FOP-3135 at 1/4/24 11:07 AM:
-

[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).
I simply ran the following command: 
{code}
fop -c "..\fop-2.9\fop\conf\fop.xconf" -fo ..\test\MI-test.fo -pdf 
..\test\MI-test.pdf
{code}
PS: I has to absolutize the path to the SVG file in the  
element.


was (Author: JIRAUSER300900):
[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ https://issues.apache.org/jira/browse/FOP-3135 ]


Julien Lacour deleted comment on FOP-3135:


was (Author: JIRAUSER300900):
We have found in {{PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath)}} 
that we can process each value of 'x' or 'y' separately. Maybe there's 
something to do on this class too to obtain a correct rendering.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17802908#comment-17802908
 ] 

Julien Lacour commented on FOP-3135:


[~jgoncalves] I did a small modification to the SVG file to use Calibri instead 
of Times:
{code:xml}

http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;>
http://www.w3.org/2000/svg; width="3in" height="2in">

ADATA
ADATA
ADATA
ADATA

{code}
And when I run FOP 2.9 with WIP.patch applied on fop-core classes, all the 
tspan text is displayed on a single line (see MI-Calibri-test.pdf).

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3135) SVG content is displayed on a single line without spaces

2024-01-04 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3135:
---
Attachment: MI-Calibri-test.pdf

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-Calibri-test.pdf, MI-out-patch.pdf, MI-out.pdf, 
> MI-test.fo, MI-tspan.svg, MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2023-11-28 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17790522#comment-17790522
 ] 

Julien Lacour edited comment on FOP-3135 at 11/28/23 11:59 AM:
---

We have found in {{PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath)}} 
that we can process each value of 'x' or 'y' separately. Maybe there's 
something to do on this class too to obtain a correct rendering.


was (Author: JIRAUSER300900):
We have found in {{PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath)}} 
that we can process each value of 'x' or 'y' separately.
Maybe there's something to do on this class too to obtain a correct rendering.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-out-patch.pdf, MI-out.pdf, MI-test.fo, MI-tspan.svg, 
> MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2023-11-28 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17790522#comment-17790522
 ] 

Julien Lacour edited comment on FOP-3135 at 11/28/23 11:59 AM:
---

We have found in {{PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath)}} 
that we can process each value of 'x' or 'y' separately.
Maybe there's something to do on this class too to obtain a correct rendering.


was (Author: JIRAUSER300900):
We have found in {{PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath)}} 
that we can process each value of 'x' separately.
Maybe there's something to do on this class too to obtain a correct rendering.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-out-patch.pdf, MI-out.pdf, MI-test.fo, MI-tspan.svg, 
> MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (FOP-3135) SVG content is displayed on a single line without spaces

2023-11-28 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17790522#comment-17790522
 ] 

Julien Lacour commented on FOP-3135:


We have found in {{PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath)}} 
that we can process each value of 'x' separately.
Maybe there's something to do on this class too to obtain a correct rendering.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-out-patch.pdf, MI-out.pdf, MI-test.fo, MI-tspan.svg, 
> MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (FOP-3135) SVG content is displayed on a single line without spaces

2023-11-28 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17790519#comment-17790519
 ] 

Julien Lacour commented on FOP-3135:


Hi [~daveroxburgh], 

I tested to apply both patches on my side, the MI-tspan.svg file is correctly 
rendered but if I set another font the display isn't correct
I tried with the following content in my SVG:
{code:xml}
ADATA
ADATA
{code}


> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: MI-out-patch.pdf, MI-out.pdf, MI-test.fo, MI-tspan.svg, 
> MI.patch, WIP-out.pdf, WIP.patch, tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Comment Edited] (FOP-3135) SVG content is displayed on a single line without spaces

2023-06-28 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17738102#comment-17738102
 ] 

Julien Lacour edited comment on FOP-3135 at 6/28/23 12:52 PM:
--

The problem remaining using FOP 2.8 is that the SVG doesn't look the same in a 
browser vs in a PDF and the last  text is cropped.


was (Author: JIRAUSER300900):
The problem remaining using FOP-2.8 is that the SVG doesn't look the same in a 
browser vs in a PDF and the last  text is cropped.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (FOP-3135) SVG content is displayed on a single line without spaces

2023-06-28 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17738102#comment-17738102
 ] 

Julien Lacour commented on FOP-3135:


The problem remaining using FOP-2.8 is that the SVG doesn't look the same in a 
browser vs in a PDF and the last  text is cropped.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Commented] (FOP-3135) SVG content is displayed on a single line without spaces

2023-06-27 Thread Julien Lacour (Jira)


[ 
https://issues.apache.org/jira/browse/FOP-3135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17737556#comment-17737556
 ] 

Julien Lacour commented on FOP-3135:


I've tested with FOP 2.8 with {{fop -fo ..\test\tspan.fo ..\test\tspan.pdf}} 
ant the following FO:
{code:xml}
 
http://www.w3.org/1999/XSL/Format;>













{code}
But the output seems quite correct, just a little truncated in the bottom part.
I will analyze on my side again to see if I find the problem, maybe I use a 
different batik.

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3135) SVG content is displayed on a single line without spaces

2023-06-19 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3135:
---
Attachment: tspan.svg

> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
> Attachments: tspan.svg
>
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc = x + pa[2];
> yc = y + pa[3];
> xoLast = x;
> yoLast = y;
> } else {
> double  xo  = xc + pa[0];
> double  yo  = yc + pa[1];
> double  xa  = f.getWidth(gc);
> double  ya  = 0;
> double  xd  = (xo - xoLast) / 1000f;
> double  yd  = (yo - yoLast) / 1000f;
>
> textUtil.writeTd(xd, yd);
> textUtil.writeTj((char) gc, true, false);
> xc += xa + pa[2];
> yc += ya + pa[3];
> xoLast = xo;
> yoLast = yo;
> }
> }
> {code}
> I also attached an example for testing, it can be opened in Batik for 
> comparison.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (FOP-3135) SVG content is displayed on a single line without spaces

2023-06-19 Thread Julien Lacour (Jira)


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

Julien Lacour updated FOP-3135:
---
Description: 
We have found an issue in FOP when transforming PDFs with SVGs containing 
 with multiple @x and/or @y attributes values.
The problem is located in 
org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath), 
the positions given by x and y are never used when set.
A possible fix for this issue is the following:
{code:java}
for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
int gc  = gv.getGlyphCode(i);
int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? paZero 
: dp[i];
if (gv.getGlyphPosition(i) != null) {
Point2D gp  = gv.getGlyphPosition(i);
double x= gp.getX() - initialPos.getX();
double y= -(gp.getY() - initialPos.getY());
double xd   = x - xoLast;
double yd   = y - yoLast;

textUtil.writeTd(xd, yd);
textUtil.writeTj((char) gc, true, false);
xc = x + pa[2];
yc = y + pa[3];
xoLast = x;
yoLast = y;
} else {
double  xo  = xc + pa[0];
double  yo  = yc + pa[1];
double  xa  = f.getWidth(gc);
double  ya  = 0;
double  xd  = (xo - xoLast) / 1000f;
double  yd  = (yo - yoLast) / 1000f;
   
textUtil.writeTd(xd, yd);
textUtil.writeTj((char) gc, true, false);
xc += xa + pa[2];
yc += ya + pa[3];
xoLast = xo;
yoLast = yo;
}
}
{code}
I also attached an example for testing, it can be opened in Batik for 
comparison.

  was:
We have found an issue in FOP when transforming PDFs with SVGs containing 
 with multiple @x and/or @y attributes values.
The problem is located in 
org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath), 
the positions given by x and y are never used when set.
A possible fix for this issue is the following:
{code:java}
for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
int gc  = gv.getGlyphCode(i);
int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? paZero 
: dp[i];
if (gv.getGlyphPosition(i) != null) {
Point2D gp  = gv.getGlyphPosition(i);
double x= gp.getX() - initialPos.getX();
double y= -(gp.getY() - initialPos.getY());
double xd   = x - xoLast;
double yd   = y - yoLast;

textUtil.writeTd(xd, yd);
textUtil.writeTj((char) gc, true, false);
xc = x + pa[2];
yc = y + pa[3];
xoLast = x;
yoLast = y;
} else {
double  xo  = xc + pa[0];
double  yo  = yc + pa[1];
double  xa  = f.getWidth(gc);
double  ya  = 0;
double  xd  = (xo - xoLast) / 1000f;
double  yd  = (yo - yoLast) / 1000f;
   
textUtil.writeTd(xd, yd);
textUtil.writeTj((char) gc, true, false);
xc += xa + pa[2];
yc += ya + pa[3];
xoLast = xo;
yoLast = yo;
}
}
{code}


> SVG  content is displayed on a single line without spaces
> 
>
> Key: FOP-3135
> URL: https://issues.apache.org/jira/browse/FOP-3135
> Project: FOP
>  Issue Type: Bug
>  Components: image/svg
>Reporter: Julien Lacour
>Priority: Minor
>
> We have found an issue in FOP when transforming PDFs with SVGs containing 
>  with multiple @x and/or @y attributes values.
> The problem is located in 
> org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, 
> GeneralPath), the positions given by x and y are never used when set.
> A possible fix for this issue is the following:
> {code:java}
> for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
> int gc  = gv.getGlyphCode(i);
> int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? 
> paZero : dp[i];
> if (gv.getGlyphPosition(i) != null) {
> Point2D gp  = gv.getGlyphPosition(i);
> double x= gp.getX() - initialPos.getX();
> double y= -(gp.getY() - initialPos.getY());
> double xd   = x - xoLast;
> double yd   = y - yoLast;
> textUtil.writeTd(xd, yd);
> 

[jira] [Created] (FOP-3135) SVG content is displayed on a single line without spaces

2023-06-19 Thread Julien Lacour (Jira)
Julien Lacour created FOP-3135:
--

 Summary: SVG  content is displayed on a single line without 
spaces
 Key: FOP-3135
 URL: https://issues.apache.org/jira/browse/FOP-3135
 Project: FOP
  Issue Type: Bug
  Components: image/svg
Reporter: Julien Lacour


We have found an issue in FOP when transforming PDFs with SVGs containing 
 with multiple @x and/or @y attributes values.
The problem is located in 
org.apache.fop.svg.PDFTextPainter.writeGlyphs(FOPGVTGlyphVector, GeneralPath), 
the positions given by x and y are never used when set.
A possible fix for this issue is the following:
{code:java}
for (int i = 0, n = gv.getNumGlyphs(); i < n; i++) {
int gc  = gv.getGlyphCode(i);
int[]   pa  = ((i > dp.length) || (dp[i] == null)) ? paZero 
: dp[i];
if (gv.getGlyphPosition(i) != null) {
Point2D gp  = gv.getGlyphPosition(i);
double x= gp.getX() - initialPos.getX();
double y= -(gp.getY() - initialPos.getY());
double xd   = x - xoLast;
double yd   = y - yoLast;

textUtil.writeTd(xd, yd);
textUtil.writeTj((char) gc, true, false);
xc = x + pa[2];
yc = y + pa[3];
xoLast = x;
yoLast = y;
} else {
double  xo  = xc + pa[0];
double  yo  = yc + pa[1];
double  xa  = f.getWidth(gc);
double  ya  = 0;
double  xd  = (xo - xoLast) / 1000f;
double  yd  = (yo - yoLast) / 1000f;
   
textUtil.writeTd(xd, yd);
textUtil.writeTj((char) gc, true, false);
xc += xa + pa[2];
yc += ya + pa[3];
xoLast = xo;
yoLast = yo;
}
}
{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)