Scribus Forums

Scribus => Beginner Talk => Topic started by: sunmarsh on August 06, 2024, 06:44:11 AM

Title: [SOLVED] Help adding a color gradient to text
Post by: sunmarsh on August 06, 2024, 06:44:11 AM
I am using Scribus 1.6.2 on Windows 11 Pro. I have had previous success using the workflow outlined here (https://wiki.scribus.net/canvas/Text_Gradients) to apply a gradient to text. My aim is to apply a single gradient across the entire text string, as shown in the bottom example at that wiki link.

This is the procedure I'm following:
1. Select Text Frame
2. Item > Convert to > Outlines
3. Item > Grouping > Ungroup
4. Item > Path Tools > Combine Polygons

At the end of Step #4, the text looks very different from how it began. Can anyone help me understand why this happens? I should note that each letter in the text box has different outline properties, and it seems to me like it is choosing one of the letter's outline properties and applying them to all of the letters, which causes them to seemingly change in thickness. Also it seems that letters that overlap will turn 'white' in the overlap spaces...

Is there maybe another way to create a text gradient? Or could someone tell me what I'm doing wrong?
Title: Re: Help adding a color gradient to text
Post by: PatJr on August 06, 2024, 02:57:30 PM
maybe use the Union in Inkscape ?
Title: Re: Help adding a color gradient to text
Post by: AdmFubar on August 07, 2024, 04:09:12 AM
It can be done!
There are some extra steps involved that can be tedious if you have a long line of text to do.

same set of steps, omit step #4 and replace it with

#4 Select the first and second character.
#5  Goto the Item drop down menu and select Path Tools/Path Operations
in the window that opens the fist icon in the operations section is auto selected, it is combine shapes. click ok, and those two you selected are combined into one.
repeat for each letter, selecting the previous combined letters and adding the next.
When you have all the letters combined
Step #6 Item/Path Tools/Flatten Path

You are now ready to add the gradient.
Title: Re: Help adding a color gradient to text
Post by: PatJr on August 07, 2024, 02:10:43 PM
Quote from: AdmFubar on August 07, 2024, 04:09:12 AMIt can be done!
There are some extra steps involved that can be tedious if you have a long line of text to do.

....


all good, but still have to deal with the outline, I don't know of a function in scribus that does
 Outline to Path like in Inkscape
Title: Re: Help adding a color gradient to text
Post by: AdmFubar on August 07, 2024, 08:46:59 PM
It is the tools/path operations that does what you are looking for.
Title: Re: Help adding a color gradient to text
Post by: sunmarsh on August 09, 2024, 08:35:32 AM
Quote from: AdmFubar on August 07, 2024, 04:09:12 AMIt can be done!
There are some extra steps involved that can be tedious if you have a long line of text to do.

same set of steps, omit step #4 and replace it with

#4 Select the first and second character.
#5  Goto the Item drop down menu and select Path Tools/Path Operations
in the window that opens the fist icon in the operations section is auto selected, it is combine shapes. click ok, and those two you selected are combined into one.
repeat for each letter, selecting the previous combined letters and adding the next.
When you have all the letters combined
Step #6 Item/Path Tools/Flatten Path

You are now ready to add the gradient.


There is still an issue with the outline. The result must take the color of one of the parents (including outline color), and only one of the letters has an outline, the other does not, so the result is undesirable. (the entire text string has a lot of outline variation) 
Title: Re: Help adding a color gradient to text
Post by: PatJr on August 09, 2024, 04:38:49 PM
AdmFubar is right, there is a function under the Item>Path Tools that can convert the object outline to a path. Then you just need to do the combining and welding or whatever to get the graphic you want.
Title: Re: [SOLVED] Help adding a color gradient to text
Post by: sunmarsh on August 11, 2024, 03:20:33 AM
Thank you both for your help! Finally got it.

To anyone in the future reading this, I solved this in Scribus 1.6.2 by:
1. Selecting the text box
2. Item > Convert to > Outlines
3. Item > Grouping > Ungroup
4. Select all letters with an outline
5. CTRL + C (copy)
6. Select all letters
7. Item > Path Tools > Combine Polygons
8. CTRL + V (paste)
9. Select each pasted letter and do the following for each: Item > Path Tools > Create Path from Stroke
10. Select all the newly created paths from step 9 FIRST (very important)
11. Add the combined polygon text created in step 7 to the selection from step 10 (SHIFT + click)
12. Item > Path Tools > Combine Polygons

Now the text is fully combined taking into account the outlines of each letter. The final shape will have the outline properties of one of the paths created in step 9. I think it may be the first path selected in step 10 but I'm not sure. It might be helpful to copy/paste a copy of the initial text box before starting the conversion process in order to have it later to compare it to the final product/ make adjustments to the final shape outline accordingly.
Title: Re: [SOLVED] Help adding a color gradient to text
Post by: a.l.e on August 11, 2024, 03:32:06 PM
I made a ticket asking for allowing the union of multiple items:

https://bugs.scribus.net/view.php?id=17254

While waiting for it, with the current version of Scribus, it also might slightly easier for you to make unions of pairs of letters.

But, from my tries, the real solution seems to be to change the fill rule (in Properties > Shape) to be "nonzero" after having combined all the shapes: you will get the result you're expecting.
(so: convert to outline + ungroup + combine + non zero fill rule)

I don't know if this a an error or an expected behavior, but in the current stable the fill rule looks like a setting, in the development version 1.7 it's a property specific to the item... i will also fill a ticket for this)