View Issue Details

IDProjectCategoryView StatusLast Update
0011613ScribusGeneralpublic2016-11-16 08:48
ReporterJLuc Assigned Tocbradney  
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Product Version1.5.0svn 
Summary0011613: [PATCH] vertical position of line depending on text (same content, different layout)
Description2 frames with one-liner content : with same text styles, both texts having the same accenctuated uppercase letter

in one frame, accent is IN frame
in other frame, accent is OUT and line is not aligned with first one
Tagslayout
PatchYes

Relationships

related to 0012154 closedjghali "Adjust Frame Height to Text" inconsistent behaviour with Middle/Bottom Vertical Alignment 
related to 0009365 confirmed The maximum ascent of the capital czech letters with punctuation (??ŽŠ?ÁÍÉ) behaves incorrectly 

Activities

JLuc

2013-06-20 12:14

developer  

accent depasse.sla (24,740 bytes)

JLuc

2013-06-20 12:14

developer  

JLuc

2013-06-20 12:19

developer   ~0030305

Last edited: 2013-06-20 19:03

As for font : use for example "Liberation Serif" or "Liberation Sans" so as to reproduce.

AMOF, the outside-of-frame accent comes from a lowercase é letter that has the "K" to-uppercase character effect.

I tried using the "hampe" (french) parameter of the "first line effect" of the PP but with no visible effect afaict.

IMO, scribus layout should be the same with uppercase é or with É.

cezaryece

2013-10-01 08:18

updater   ~0030647

Confirmed, fixed, patched.

cezaryece

2013-10-01 08:19

updater   ~0030648

Patch uploaded

JLuc

2013-10-01 14:06

developer   ~0030650

Last edited: 2013-10-01 14:07

it looks like the patch is not uploaded cezaryece...

cezaryece

2013-10-02 07:01

updater  

11613.patch (2,067 bytes)   
diff --git a/Scribus/scribus/pageitem_textframe.cpp b/Scribus/scribus/pageitem_textframe.cpp
index 0b96a3c..9f51478 100644
--- a/Scribus/scribus/pageitem_textframe.cpp
+++ b/Scribus/scribus/pageitem_textframe.cpp
@@ -1612,9 +1612,9 @@ void PageItem_TextFrame::layout()
 				opticalMargins = style.opticalMargins();
 			CharStyle charStyle = ((hl->ch != SpecialChars::PARSEP) ? itemText.charStyle(a) : style.charStyle());
 			chstr = ExpandToken(a);
-			int chstrLen = chstr.length();
 			if (chstr.isEmpty())
 				chstr = SpecialChars::ZWNBSPACE;
+			int chstrLen = chstr.length();
 
 			curStat = SpecialChars::getCJKAttr(hl->ch);
 
@@ -1650,6 +1650,32 @@ void PageItem_TextFrame::layout()
 			style.setLineSpacing (calculateLineSpacing (style, this));
 			FlopBaseline = (current.startOfCol && firstLineOffset() == FLOPBaselineGrid);
 
+			//change characters and/or scaling/offset due to typographic effects
+			int chst = charStyle.effects() & 1919;
+			if (chst != ScStyle_Default)
+			{
+				if (chst & ScStyle_Superscript)
+				{
+					offset += charStyle.fontSize() * m_Doc->typographicPrefs().valueSuperScript / 100.0;
+					scaleV *= qMax(m_Doc->typographicPrefs().scalingSuperScript / 100.0, 10.0 / charStyle.fontSize());
+					scaleH *= qMax(m_Doc->typographicPrefs().scalingSuperScript / 100.0, 10.0 / charStyle.fontSize());
+				}
+				else if (chst & ScStyle_Subscript)
+				{
+					offset -= charStyle.fontSize() * m_Doc->typographicPrefs().valueSubScript / 100.0;
+					scaleV *= qMax(m_Doc->typographicPrefs().scalingSubScript / 100.0, 10.0 / charStyle.fontSize());
+					scaleH *= qMax(m_Doc->typographicPrefs().scalingSubScript / 100.0, 10.0 / charStyle.fontSize());
+				}
+				if ((chst & ScStyle_AllCaps) || (chst & ScStyle_SmallCaps))
+					chstr = chstr.toUpper();
+				if (chst & ScStyle_SmallCaps)
+				{
+					double smallcapsScale = m_Doc->typographicPrefs().valueSmallCaps / 100.0;
+					scaleV *=smallcapsScale;
+					scaleH *= smallcapsScale;
+				}
+			}
+
 			// find out about par gap and dropcap
 			if (a == firstInFrame())
 			{
11613.patch (2,067 bytes)   

cezaryece

2013-10-02 07:02

updater   ~0030654

Sorry, forgot click Upload button

JLuc

2013-12-23 10:36

developer   ~0030944

Could somebody care for this patch ?

JLuc

2015-11-24 13:36

developer   ~0037646

Last edited: 2015-11-24 13:48

Cezary : i tested the patch and it's not OK.

AMOF with your patch each lines appears on same height, but it introduces a big issue : space on top of line becomes very very high and text doesnt fit anymore in textframe and textframe has to be made much higher so the text fits in it.

This needs to be fixed.

I had to update the file references in the patch so as to apply it so i upload the new version.

JLuc

2015-11-24 13:36

developer  

issue11613 updated 2015 11 24.patch (2,035 bytes)   
diff --git a/scribus/pageitem_textframe.cpp b/scribus/pageitem_textframe.cpp
index 0b96a3c..9f51478 100644
--- a/scribus/pageitem_textframe.cpp
+++ b/scribus/pageitem_textframe.cpp
@@ -1612,9 +1612,9 @@ void PageItem_TextFrame::layout()
 				opticalMargins = style.opticalMargins();
 			CharStyle charStyle = ((hl->ch != SpecialChars::PARSEP) ? itemText.charStyle(a) : style.charStyle());
 			chstr = ExpandToken(a);
-			int chstrLen = chstr.length();
 			if (chstr.isEmpty())
 				chstr = SpecialChars::ZWNBSPACE;
+			int chstrLen = chstr.length();
 
 			curStat = SpecialChars::getCJKAttr(hl->ch);
 
@@ -1650,6 +1650,32 @@ void PageItem_TextFrame::layout()
 			style.setLineSpacing (calculateLineSpacing (style, this));
 			FlopBaseline = (current.startOfCol && firstLineOffset() == FLOPBaselineGrid);
 
+			//change characters and/or scaling/offset due to typographic effects
+			int chst = charStyle.effects() & 1919;
+			if (chst != ScStyle_Default)
+			{
+				if (chst & ScStyle_Superscript)
+				{
+					offset += charStyle.fontSize() * m_Doc->typographicPrefs().valueSuperScript / 100.0;
+					scaleV *= qMax(m_Doc->typographicPrefs().scalingSuperScript / 100.0, 10.0 / charStyle.fontSize());
+					scaleH *= qMax(m_Doc->typographicPrefs().scalingSuperScript / 100.0, 10.0 / charStyle.fontSize());
+				}
+				else if (chst & ScStyle_Subscript)
+				{
+					offset -= charStyle.fontSize() * m_Doc->typographicPrefs().valueSubScript / 100.0;
+					scaleV *= qMax(m_Doc->typographicPrefs().scalingSubScript / 100.0, 10.0 / charStyle.fontSize());
+					scaleH *= qMax(m_Doc->typographicPrefs().scalingSubScript / 100.0, 10.0 / charStyle.fontSize());
+				}
+				if ((chst & ScStyle_AllCaps) || (chst & ScStyle_SmallCaps))
+					chstr = chstr.toUpper();
+				if (chst & ScStyle_SmallCaps)
+				{
+					double smallcapsScale = m_Doc->typographicPrefs().valueSmallCaps / 100.0;
+					scaleV *=smallcapsScale;
+					scaleH *= smallcapsScale;
+				}
+			}
+
 			// find out about par gap and dropcap
 			if (a == firstInFrame())
 			{

Issue History

Date Modified Username Field Change
2013-06-20 12:13 JLuc New Issue
2013-06-20 12:13 JLuc File Added: accent depasse.sla
2013-06-20 12:13 JLuc File Deleted: accent depasse.sla
2013-06-20 12:14 JLuc File Added: accent depasse.sla
2013-06-20 12:14 JLuc File Added: Screenshot test2013-06-20 14:12:14.jpg
2013-06-20 12:19 JLuc Note Added: 0030305
2013-06-20 12:26 JLuc Note Edited: 0030305
2013-06-20 19:03 JLuc Note Edited: 0030305
2013-06-20 19:03 JLuc Note Edited: 0030305
2013-06-20 21:54 christoph_s Assigned To => cezaryece
2013-06-20 21:54 christoph_s Status new => assigned
2013-10-01 08:18 cezaryece Note Added: 0030647
2013-10-01 08:19 cezaryece Assigned To cezaryece => cbradney
2013-10-01 08:19 cezaryece Note Added: 0030648
2013-10-01 08:19 cezaryece Status assigned => confirmed
2013-10-01 14:06 JLuc Note Added: 0030650
2013-10-01 14:07 JLuc Note Edited: 0030650
2013-10-01 17:39 cbradney Assigned To cbradney => cezaryece
2013-10-01 17:39 cbradney Status confirmed => assigned
2013-10-02 07:01 cezaryece File Added: 11613.patch
2013-10-02 07:02 cezaryece Note Added: 0030654
2013-10-02 07:02 cezaryece Assigned To cezaryece => cbradney
2013-10-02 07:02 cezaryece Status assigned => confirmed
2013-12-23 10:36 JLuc Note Added: 0030944
2014-04-07 15:06 JLuc Tag Attached: layout
2014-07-13 01:52 Kunda Summary Same content, different layout => [PATCH] Same content, different layout
2014-10-04 16:21 JLuc Status confirmed => feedback
2014-10-24 22:57 Kunda Patch => Yes
2015-11-24 09:10 JLuc Summary [PATCH] Same content, different layout => [PATCH] vertical position of line depending on text (same content, different layout)
2015-11-24 09:13 JLuc Relationship added related to 0012154
2015-11-24 13:36 JLuc Note Added: 0037646
2015-11-24 13:36 JLuc Status feedback => assigned
2015-11-24 13:36 JLuc File Added: issue11613 updated 2015 11 24.patch
2015-11-24 13:48 JLuc Status assigned => new
2015-11-24 13:48 JLuc Note Edited: 0037646
2016-11-16 08:43 JLuc Tag Attached: #rottenpatch
2016-11-16 08:43 JLuc Tag Attached: rot
2016-11-16 08:43 JLuc Tag Detached: rot
2016-11-16 08:47 JLuc Tag Detached: #rottenpatch
2016-11-16 08:48 JLuc Relationship added related to 0009365