View Issue Details

IDProjectCategoryView StatusLast Update
0003865ScribusStory Editor / Text Framespublic2016-05-14 12:35
ReporterPLucAuclair Assigned Tojghali  
Status closedResolutionfixed 
Platformx86OSSuse 10.0OS VersionCVS 1.3.4
Fixed in Version1.5.0svn 
Summary0003865: Lock first line to baseline grid.
DescriptionI don't know if any program has this but I was thinking about a new feature (to go with the text library I'm currently working on).

I was thinking of a "Lock first line to baseline grid" feature, that for example would allow to have a note in the margin and have it to align with the rest of the text but don't share the baseline apart from the first line.

See image for example.
TagsNo tags attached.


related to 0003671 confirmed Enable changing baseline grid from the properties palette 
related to 0003550 acknowledged Line spacing modes are incorrect, and lacking 
related to 0003538 feedback "snap to..." options should be placed in guideline manager and in configuration 
related to 0001150 feedback Automatic vertical lines between columns 
related to 0001485 closedcbradney Set pt as the default unit for Above and Below in the Paragraph Style dialog 
related to 0002899 acknowledged snap to baseline grid 
related to 0000461 acknowledged drop-cap position for hanging, jutting, etc 
related to 0000586 acknowledged Several baselines for one document. 
related to 0002389 new Objects anchored to a text frame 
related to 0011038 closed snap to items also for the baseline 
related to 0011037 new align (and distribute?) by the baseline 


2006-05-24 12:57


first_line_to_baseline.png (199,795 bytes)   
first_line_to_baseline.png (199,795 bytes)   


2006-05-24 19:36

administrator   ~0011450

PLucAuclair, would you mind skimmig through the related issues to see if any of the related RFEs could help you to achieve your goal?


2006-05-24 22:54

reporter   ~0011461

Not really, this would be a good compliment to 0002389: Objects anchored to a text frame, which is what's in the recommendations I have in my w.i.p. doc.


2006-05-28 21:33

developer   ~0011511

I don't know of any program that has this feature also. Quark doesn't have it and afaik ID neither.

The idea is interesting. Although to be honest I am not sure whether this is going to be that useful in a real-life production since it is very easy to achieve this with the actual tools. But only time will tell this. That said, it is indeed an interesting approach!

[Additionnal note] I am not aiming at this particular idea, please read me right! but I sometimes get to think that we have somehow to be cautious with the implementation of some good ideas because they may "crowd" the UI too much by offering more than would be necessary. It is a general thought. Again, not aimed at all at this RFE in particular. I think the challenge is to keep a good balance between simplicity and efficiency. Cheers! :)


2012-08-19 12:42

manager   ~0028837

there is no easy way to achieve this with the current tools... currently, to get it right, you have to zoom in to an insane level, manually place a guide, zoom out, zoom in to the second frame.


2012-08-20 14:33

developer   ~0028841

Quite the contrary, the way to achieve that is easy and we use it everyday for years. Put a guide on the line you want the other text to align to and then align the second frame according to need. It takes about 5 secs to complete the alignment. It would be shorter by a couple secs with the new tool (the time to create the frame and in fact position it to the right place in order for the function to work, there is no magic here).

If we could create empty text frames on the master page that we could fill with text in the document, setting up the layout in order to welcome the text in the 2nd frame at the right position would be easier, even. And this can also be accomplished by duplicating pages that have empty frames and that can be used as we use Master pages in other programs.

If zooming in is an issue, we should fix zooming as well. Zooming in and out should not be an issue at all.

If I had to layout a book that would have many of those notes, I would take lots of care doing the layout and preparing the work in order to accomplish this quickly.

All that said, if someone is ready to put some time and effort into that, why not! I don’t say it’s not a good feature to have!


2012-08-20 15:03

updater   ~0028842

From develop side it should not be so hard to do and question is if to do it? As many of us (hi Ale) are oposit to adding new UI options and complicating them more and more. But I think it can added as another option to First Line Offset dropbox.
In free time I try to do it at least in my private branch (sharing patch of course).


2012-08-20 17:03

manager   ~0028844

louis, you can't put the guide exactly on the baseline... you have to "approximate" it...
really, scribus should let you do this alignment in an exact way.

the question is: what is the correct way for most use cases!

while i was more thinking about the items snapping when i was writing my previous note, after reading you're both notes, i wonder if it should not rather (or at least also) a feature of a future frame anchoring (that way the sidenote would automatically follow the text it refers to and its baseline).

once the footnotes are in, this should not be way too hard to implement!


2012-08-20 18:52

updater   ~0028846

OK, folks - let you get branch 'ece15' from and check if it is what you are talking about...


2012-08-21 06:42


baselineOffset.diff (5,393 bytes)   
diff --git Scribus/scribus/pageitem_textframe.cpp Scribus/scribus/pageitem_textframe.cpp
index a784ad8..7e31bb5 100644
--- Scribus/scribus/pageitem_textframe.cpp
+++ Scribus/scribus/pageitem_textframe.cpp
@@ -1427,6 +1427,8 @@ void PageItem_TextFrame::layout()
 			hl = itemText.item(firstInFrame());
 			style = itemText.paragraphStyle(firstInFrame());
+			if (firstLineOffset() == FLOPBaseGrid)
+				style.setLineSpacingMode(ParagraphStyle::BaselineGridLineSpacing);
 			style.setLineSpacing (calculateLineSpacing (style, this));
 //			qDebug() << QString("style @0: %1 -- %2, %4/%5 char: %3").arg(style.leftMargin()).arg(style.rightMargin())
@@ -1485,6 +1487,8 @@ void PageItem_TextFrame::layout()
 			if (chstr.isEmpty())
 				chstr = SpecialChars::ZWNBSPACE;
+			if (current.startOfCol && firstLineOffset() == FLOPBaseGrid)
+				style.setLineSpacingMode(ParagraphStyle::BaselineGridLineSpacing);
 			style.setLineSpacing (calculateLineSpacing (style, this));
 			// find out about par gap and dropcap
 			if (a == firstInFrame())
diff --git Scribus/scribus/sctextstruct.h Scribus/scribus/sctextstruct.h
index bfede86..733f5b0 100644
--- Scribus/scribus/sctextstruct.h
+++ Scribus/scribus/sctextstruct.h
@@ -151,7 +151,8 @@ enum FirstLineOffsetPolicy
     FLOPRealGlyphHeight = 0, // Historical
     FLOPFontAscent	= 1,
-    FLOPLineSpacing	= 2
+    FLOPLineSpacing	= 2,
+	FLOPBaseGrid = 3
diff --git Scribus/scribus/ui/propertiespalette_text.cpp Scribus/scribus/ui/propertiespalette_text.cpp
index 9f768ae..2486854 100644
--- Scribus/scribus/ui/propertiespalette_text.cpp
+++ Scribus/scribus/ui/propertiespalette_text.cpp
@@ -444,8 +444,10 @@ void PropertiesPalette_Text::displayFirstLinePolicy( FirstLineOffsetPolicy f )
 	else if(f == FLOPLineSpacing)
-	else
+	else if (f == FLOPRealGlyphHeight)
 		flopBox->flopRealHeight->setChecked(true); //It’s historical behaviour.
+	else // if (f == FLOPBaseGrid)
+		flopBox->flopBaseGrid->setChecked(true);
 void PropertiesPalette_Text::setupLineSpacingSpinbox(int mode, double value)
@@ -725,6 +727,8 @@ void PropertiesPalette_Text::handleFirstLinePolicy(int radioFlop)
 		else if( radioFlop == PropertyWidget_Flop::LineSpacingID)
+		else if( radioFlop == PropertyWidget_Flop::BaseGridID)
+			i2->setFirstLineOffset(FLOPBaseGrid);
 		if (m_doc->appMode == modeEditTable)
diff --git Scribus/scribus/ui/propertywidget_flop.cpp Scribus/scribus/ui/propertywidget_flop.cpp
index a6a715b..b7c958f 100644
--- Scribus/scribus/ui/propertywidget_flop.cpp
+++ Scribus/scribus/ui/propertywidget_flop.cpp
@@ -24,6 +24,7 @@ PropertyWidget_Flop::PropertyWidget_Flop(QWidget* parent) : QFrame(parent)
 	flopGroup->setId(flopRealHeight,  RealHeightID);
     flopGroup->setId(flopFontAscent,  FontAscentID);
     flopGroup->setId(flopLineSpacing, LineSpacingID);
+	flopGroup->setId(flopBaseGrid, BaseGridID);
@@ -54,8 +55,10 @@ void PropertyWidget_Flop::languageChange()
 	flopRealHeight->setText( tr("Maximum Ascent") );
 	flopFontAscent->setText( tr("Font Ascent") );
 	flopLineSpacing->setText( tr("Line Spacing") );
+	flopBaseGrid->setText( tr("Baseline Grid") );
 	flopRealHeight->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to use the tallest height of the included characters") + "</qt>" );
 	flopFontAscent->setToolTip( "<qt>" + tr("Set the height of the first line of text frame to use the full ascent of the font(s) in use") + "</qt>" );
 	flopLineSpacing->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to the specified line height") + "</qt>" );
+	flopBaseGrid->setToolTip( "<qt>" + tr("Set the base line of the first line of the text frame to the base line grid") + "</qt>" );
\ No newline at end of file
diff --git Scribus/scribus/ui/propertywidget_flop.h Scribus/scribus/ui/propertywidget_flop.h
index 261e4bb..e1406f6 100644
--- Scribus/scribus/ui/propertywidget_flop.h
+++ Scribus/scribus/ui/propertywidget_flop.h
@@ -23,7 +23,8 @@ public:
         RealHeightID  = 0,
         FontAscentID  = 1,
-        LineSpacingID = 2
+        LineSpacingID = 2,
+		BaseGridID    = 3
 	PropertyWidget_Flop(QWidget* parent);
diff --git Scribus/scribus/ui/propertywidget_flopbase.ui Scribus/scribus/ui/propertywidget_flopbase.ui
index 5370174..875217b 100644
--- Scribus/scribus/ui/propertywidget_flopbase.ui
+++ Scribus/scribus/ui/propertywidget_flopbase.ui
@@ -41,7 +41,7 @@
-    <widget class="QRadioButton" name="flopLineSpacing">
+    <widget class="QRadioButton" name="flopLineSpacing">(firstLineOffset() != FLOPBaseGrid)
      <property name="text">
       <string>Line Spacing</string>
@@ -50,6 +50,16 @@
+   <item>
+    <widget class="QRadioButton" name="flopBaseGrid">
+     <property name="text">
+      <string>Baseline Grid</string>
+     </property>
+     <attribute name="buttonGroup">
+      <string>flopGroup</string>
+     </attribute>
+    </widget>
+   </item>
baselineOffset.diff (5,393 bytes)   


2012-08-21 06:43

updater   ~0028848

And now patch is attached.


2012-08-21 07:01

manager   ~0028849

imo: the patch goes in the right direction!

we can do more for aligning text frames to each other, but it's already a step in the good direction!


2012-08-22 13:04

administrator   ~0028853

I applied the patch with some modifications as it introduced issues with drop caps when applied as is.


2012-08-22 14:00

developer   ~0028854

Génial ! Merci Jean ! Merci Cezary ! Merci Ale ! :-)

Issue History

Date Modified Username Field Change
2006-05-24 12:57 PLucAuclair New Issue
2006-05-24 12:57 PLucAuclair File Added: first_line_to_baseline.png
2006-05-24 19:28 christoph_s Relationship added related to 0003671
2006-05-24 19:29 christoph_s Relationship added related to 0003550
2006-05-24 19:30 christoph_s Relationship added related to 0003538
2006-05-24 19:30 christoph_s Relationship added related to 0001150
2006-05-24 19:31 christoph_s Relationship added related to 0001485
2006-05-24 19:31 christoph_s Relationship added related to 0002899
2006-05-24 19:32 christoph_s Relationship added related to 0000461
2006-05-24 19:32 christoph_s Relationship added related to 0000586
2006-05-24 19:34 christoph_s Relationship added related to 0002389
2006-05-24 19:36 christoph_s Note Added: 0011450
2006-05-24 22:54 PLucAuclair Note Added: 0011461
2006-05-28 21:33 louisdesjardins Note Added: 0011511
2012-08-19 12:42 ale Note Added: 0028837
2012-08-20 14:33 louisdesjardins Note Added: 0028841
2012-08-20 15:03 cezaryece Note Added: 0028842
2012-08-20 17:03 ale Note Added: 0028844
2012-08-20 18:52 cezaryece Note Added: 0028846
2012-08-21 06:42 cezaryece File Added: baselineOffset.diff
2012-08-21 06:43 cezaryece Note Added: 0028848
2012-08-21 07:01 ale Note Added: 0028849
2012-08-22 13:04 jghali Note Added: 0028853
2012-08-22 13:04 jghali Status new => resolved
2012-08-22 13:04 jghali Fixed in Version => 1.5.0svn
2012-08-22 13:04 jghali Resolution open => fixed
2012-08-22 13:04 jghali Assigned To => jghali
2012-08-22 14:00 louisdesjardins Note Added: 0028854
2012-11-13 20:38 cbradney Status resolved => closed
2015-09-17 20:08 Kunda Category Story Editor / Text Frames => Story Ed/Txt Frames
2015-09-17 20:12 Kunda Category Story Ed/Txt Frames => Story Editor / Text Frames
2016-05-14 12:35 Kunda Relationship added related to 0011038
2016-05-14 12:35 Kunda Relationship added related to 0011037