Can "Font" node produce multiline text?

   4006   4   2
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
May I ask how to print multi-line text by using the “Font” SOP?

e.g. I want to put a text on a polygon with the 1st line showing its name, the 2nd line showing its area, and the 3rd line showing its perimeter value.

Is there a way to do this by using Hscript for the “text content”? or by using Hscript you can only get one line of text?

Thanks!
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
You just need to use a newline character ‘\n’ to create a new line.
Frame: $F\nHello\nLine 3
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
Thank you very much, graham!

This is the long Hscript of multi-line text output:

opinput (“../input_geo”, 0)
+\n+
“A.P.R.=”
+
prim(“../attribcreate1”, 0, “area_to_perimeter_ratio”, 0)
+\n+
“Con.I.=”
+
(prim(“../convolution_index”, 0, “convolution_index”, 0)*100)
+“%”
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
I believe if you alt-e on the string field and use the Expression editor, putting in carriage returns (just hit enter to add lines) in there will give you the \n and multi-line support without typing \n for carriage returns when you close the Expression Editor.
There's at least one school like the old school!
User Avatar
Member
479 posts
Joined: Dec. 2009
Offline
Dear jeff, thank you very much for your advice!
  • Quick Links