View Issue Details

IDProjectCategoryView StatusLast Update
0014921ScribusTypographypublic2019-12-08 21:24
Reportereudoxos Assigned Tojghali  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformLinuxOSUbuntuOS Version16.04
Fixed in Version1.5.6.svn 
Summary0014921: Text-on-path should be able to wrap around on closed paths
DescriptionText along path on closed paths (with coincident endpoints) does not let the text pass over the endpoint. When offset is set too high, extra glyphs which don't fit are flushed, instead of continuing from the beginning.
Steps To ReproduceCreate closed path (e.g. ellipse shape), but text on it, and try to make it go accross the endpoint.
Additional InformationThis was implemented as pull request in https://github.com/scribusproject/scribus/pull/90 but it seems that github is not receiving any attention. The Travis build failure does not originate in the patch, the main branch also fails to build. The image attached shows the text wrapping around on the ellipse but being discarded on the end of open curve.
Tagspatch, text to path
PatchYes

Activities

eudoxos

2017-07-21 09:52

reporter  

aa.png (23,065 bytes)   
aa.png (23,065 bytes)   

ale

2018-03-20 15:15

manager   ~0045063

hey, this ticket links to a patch that is rotting on github...

https://github.com/scribusproject/scribus/pull/90

can somebody have a look to it and comment?

JLuc

2018-06-28 12:54

developer   ~0045325

Any news ?

eudoxos

2018-08-17 11:42

reporter   ~0045387

Patch against trunk (against the mirror at github, which should be up-to-date) is attached, please process it. Thanks!
scribus-text-on-cyclic-path.diff (2,659 bytes)   
diff --git a/scribus/fpointarray.cpp b/scribus/fpointarray.cpp
index bbca34c68..962178481 100644
--- a/scribus/fpointarray.cpp
+++ b/scribus/fpointarray.cpp
@@ -466,12 +466,6 @@ void FPointArray::pointDerivativesAt( int seg, double t, FPoint* p, FPoint* d1,
 	return;
 }
 
-bool FPointArray::isBezierClosed() const
-{
-	return size() >= 4 && (pointQF(0) == pointQF(size()-2));
-}
-
-
 
 struct SVGState
 {
diff --git a/scribus/fpointarray.h b/scribus/fpointarray.h
index 30996fac7..5bcb6f971 100644
--- a/scribus/fpointarray.h
+++ b/scribus/fpointarray.h
@@ -77,7 +77,6 @@ public:
 	double lenPathDist(int seg, double t1, double t2) const;
 	void pointTangentNormalAt( int seg, double t, FPoint* p, FPoint* tn, FPoint* n ) const;
 	void pointDerivativesAt( int seg, double t, FPoint* p, FPoint* d1, FPoint* d2 ) const;
-	bool isBezierClosed() const;
 	~FPointArray();
 	void svgInit();
 	void svgMoveTo(double x, double y);
diff --git a/scribus/pageitem_pathtext.cpp b/scribus/pageitem_pathtext.cpp
index d4d636c71..b33ab2ace 100644
--- a/scribus/pageitem_pathtext.cpp
+++ b/scribus/pageitem_pathtext.cpp
@@ -172,9 +172,6 @@ void PageItem_PathText::DrawObj_Item(ScPainter *p, QRectF cullingArea)
 	if (glyphRuns.isEmpty())
 		return;
 
-	// enable seamless crossing past the endpoint for closed curve
-	bool curveClosed=PoLine.isBezierClosed();
-
 	foreach (const GlyphCluster& run, glyphRuns)
 	{
 		totalTextLen += run.width();
@@ -212,7 +209,7 @@ void PageItem_PathText::DrawObj_Item(ScPainter *p, QRectF cullingArea)
 			extraOffset = (totalCurveLen - m_textDistanceMargins.left() - totalTextLen) / static_cast<double>(itemText.length());
 	}
 	int firstRun = 0;
-	if (!curveClosed && totalTextLen + m_textDistanceMargins.left() > totalCurveLen && itemText.paragraphStyle(0).direction() == ParagraphStyle::RTL)
+	if (totalTextLen + m_textDistanceMargins.left() > totalCurveLen && itemText.paragraphStyle(0).direction() == ParagraphStyle::RTL)
 	{
 		double totalLenDiff = totalTextLen + m_textDistanceMargins.left() - totalCurveLen;
 		while (firstRun < glyphRuns.count())
@@ -236,21 +233,13 @@ void PageItem_PathText::DrawObj_Item(ScPainter *p, QRectF cullingArea)
 		CurX += dx;
 		CurY = 0;
 		double currPerc = currPath.percentAtLength(CurX);
-		// sticks out to the next segment
 		if (currPerc >= 0.9999999)
 		{
 			currPathIndex++;
 			if (currPathIndex == pathList.count())
 			{
-				if (curveClosed)
-				{
-					currPathIndex=0; // start from beginning again
-				}
-				else
-				{
-					MaxChars = run.firstChar();
-					break;
-				}
+				MaxChars = run.firstChar();
+				break;
 			}
 			currPath = pathList[currPathIndex];
 			CurX = dx;

ale

2018-08-17 13:28

manager   ~0045389

this patch is done the wrong way round... added lines are removed and the removed ones are added : - )

eudoxos

2018-08-17 14:38

reporter   ~0045390

Funny. That's how I got it from "git diff -u", yet I had to apply it (to test) via "patch -R" ... ??

ale

2018-08-17 14:54

manager   ~0045392

i cannot find what -u does...

iirc, "git diff" should do...

if you have github branches with the patches, you can push them and i will be able to clone them and test them...

eudoxos

2018-08-17 15:05

reporter   ~0045393

It is these two commits. By appending .patch or .diff to the URL you get the raw diff (which is also reversed...?!)

https://github.com/eudoxos/scribus/commit/61e2c108c8e03dd8579fe4cae795abed5695b45d
https://github.com/eudoxos/scribus/commit/4aba5e1b8890d742c953570805fd223e8350a4b8

ale

2018-08-17 16:30

manager   ~0045399

for your own sanity, you should learn about creating branches for doing patches : - )
it's explained in lot of tutorials in the internets so i won't explain you here how to manage it...
but if you need interactive help, you can showup in the irc channel and if i'm around, i can help you try it out!

btw, if i add a .diff at the end of the linkes you provided i get diffs that have the + and - at the right places : - )

jghali

2019-08-24 11:45

administrator   ~0046533

Sorry for the delay. Your patch has now been committed fix a few fixes from me.

eudoxos

2019-08-31 05:59

reporter   ~0046594

Thanks. Sorry for the two changesets in one branch. I think I know now better, for the future. Cheers!

Issue History

Date Modified Username Field Change
2017-07-21 09:52 eudoxos New Issue
2017-07-21 09:52 eudoxos File Added: aa.png
2017-07-21 09:52 eudoxos Tag Attached: patch
2017-07-21 09:52 eudoxos Tag Attached: text to path
2018-03-20 15:14 ale Summary Text-on-path should be able to wrap around on closed paths => [PATCH] Text-on-path should be able to wrap around on closed paths
2018-03-20 15:15 ale Note Added: 0045063
2018-06-28 12:54 JLuc Note Added: 0045325
2018-08-17 11:42 eudoxos File Added: scribus-text-on-cyclic-path.diff
2018-08-17 11:42 eudoxos Note Added: 0045387
2018-08-17 13:28 ale Note Added: 0045389
2018-08-17 14:38 eudoxos Note Added: 0045390
2018-08-17 14:54 ale Note Added: 0045392
2018-08-17 15:05 eudoxos Note Added: 0045393
2018-08-17 16:30 ale Note Added: 0045399
2019-08-24 11:45 jghali Summary [PATCH] Text-on-path should be able to wrap around on closed paths => Text-on-path should be able to wrap around on closed paths
2019-08-24 11:45 jghali Assigned To => jghali
2019-08-24 11:45 jghali Status new => resolved
2019-08-24 11:45 jghali Resolution open => fixed
2019-08-24 11:45 jghali Fixed in Version => 1.5.6.svn
2019-08-24 11:45 jghali Note Added: 0046533
2019-08-31 05:59 eudoxos Note Added: 0046594
2019-12-08 21:24 cbradney Status resolved => closed