htmlgoogle-apps-scriptstring-formattinggoogle-formsjustify

Google Form + Apps Script: setting HelpText and alignment --> justify


I created a Google form starting from Google Sheets and App Scripts.

I' am struggling to find a way to justify long strings when using a setHelpText for a Section Header Item:

var  sectionL = form.addSectionHeaderItem()

sectionL.setTitle('«Lorem ipsum dolor sit amet, consectetur adipisci elit, sed do eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrum exercitationem ullamco laboriosam, nisi ut aliquid ex ea commodi consequatur. Duis aute irure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.»');

I want to justify this text --> «Lorem ipsum dolor sit amet, consectetur adipisci elit, sed do eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrum exercitationem ullamco laboriosam, nisi ut aliquid ex ea commodi consequatur. Duis aute irure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.»

The aim is to visualize a justified text in the form.

I tried to use the Chrome DevTools to modify the html page but in this way the change is temporary:

element.style {
    text-align: justify;
}
setHelpText

I'm not already created a html file by using App Scripts... is it possible to justify texts using something as RichTextApps? Browsing everywhere I did not found nothing related to the help text.


Solution

  • One way to get text spacing and possibly alignment would be to use a fixed-size font like Lucida Console. It would be tedious, but it is a way to get rows of text to line up.