Line height not consistent with script that mixes text and variables

Font size and type are fine but the line spacing appears broken. If i only use record fields it works fine. If I add text to the results some lines appear double spaced, others appear fine.

Here’s the heart of the script:

var result = “”;
result = ‘<p style="line-height: 80%; font-size: 7pt; font-family: Gotham Narrow Book; ">’;
add(record.fields[“RETURNADDRESSLINE1”], function (value) { result += ‘PLEASE DO NOT SEND MAIL TO THIS ADDRESS<br>RETURN SERVICE ONLY<br>’ + value; });
add(record.fields[“RETURNADDRESSLINE2”], function (value) { result += “<br>” + value; });
add(record.fields[“RETURNCITY”], function (value) { result += “<br>” + value; });
add(record.fields[“RETURNSTATE”], function (value) { result += ", " + value; });
add(record.fields[“RETURNZIPCODE”], function (value) { result += " " + value + “</p>”; });
result += ‘</p>’;
results.html(result);

Hi,

I had to modify the code because I don’t have the exact fields you have in your data. The below formats fine for me.

var result = “”;
var string, string2;
result = ‘<p style="line-height: 100%; font-size: 7pt; font-family: Courier New; ">’;
string = ‘PLEASE DO NOT SEND MAIL TO THIS ADDRESS<br>RETURN SERVICE ONLY<br>’;
string2 = result + string + record.fields.RETURNADDRESSLINE2 + “<br>” + record.fields.RETURNCITY + ", " + record.fields.RETURNSTATE + " " + record.fields.RETURNZIPCODE;
results.html(string2);

https://learn.objectiflune.com/qa-blobs/2694108580845521565.gif

EDIT: I had to change the font to courier in the script since I don’t have your font.

I did find the answer. We had an entry in a remote style sheet that set the default font and line height to 125%. Both should have been overwritten by the locally applied style.

For some reason that line height was being called part way through the rendering process. We disabled the style sheet and it behaves as it should. Thanks to Nicholas in support for helping narrow down the issue.