Author Topic: Simple Italic on Shape Script  (Read 2823 times)

Rich Anderson

  • EA User
  • **
  • Posts: 142
  • Karma: +8/-0
    • View Profile
    • LinkedIn
Simple Italic on Shape Script
« on: November 08, 2019, 12:00:39 pm »
I have a rather simple shape script where I print three properties inside the shape with this...

Code: [Select]
shape name
{
h_align="center";
println("#packagename#");
println("#name#");
print("(#TAG:Code#)");
}

I would like the first line (#packagename#) to be in italics, but I don't see any way to do this by turning italics=true for just that line. I can make the whole thing italics, but not just one line.  I tried putting that part in braces, but no luck.  I tried turning italics to true, then false, but no luck.   I tried adding other subshapes, but that was pretty complex and I couldn't get the veritical spacing to work right.

Is there any way to do this without adding more subshapes?
Rich Anderson
Urgnt Limited

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Simple Italic on Shape Script
« Reply #1 on: November 08, 2019, 01:47:23 pm »
The bad news is you have to use subshapes. The good news is it's not that hard. Try starting with something like this:

Code: [Select]
shape main
{
layouttype="border";
rectangle(0,0,100,100);
addsubshape("row1","N");
addsubshape("row2","center");

shape row1
{
italic=true;
h_align="center";
preferredheight=20;
println("#packagename#");
}

shape row2
{
h_align="center";
println("#name#");
print("(#TAG:Code#)");
}
}
The Sparx Team
[email protected]