The only way I know how is to do it one Ramp for each line of text. But to make things easier. Just create a Ramp and a Text layer. Parent one to the other.
For subsequent text lines, just create a copy of the text layer and type in the new characters. Duplicate the Ramp layer and change parenthood accordingly.
Not too tedious once you get the hang of it. Having said all these, Aharon’s got a tutorial on multigradients, not too sure if it’ll be able to handle your initial requirements with a single gradient layer.
Cheers