Author Topic: Determine text size  (Read 126 times)

Gymbo

  • Jr. Member
  • **
  • Posts: 68
Determine text size
« on: March 17, 2018, 04:31:11 PM »
Is there a SYS$ function to determine the actual (2D) text size?
Regards,

Jim

Lar

  • Hero Member
  • *****
  • Posts: 2745
Re: Determine text size
« Reply #1 on: March 17, 2018, 10:40:26 PM »

sys(12) - Default text size [0<=x<=10e6],    no $ (the sys$ functions would deal with the written text, normal sys deal with the text size)

Gymbo

  • Jr. Member
  • **
  • Posts: 68
Re: Determine text size
« Reply #2 on: March 18, 2018, 08:25:16 AM »
Thanks Lar, I know you set the test size with sys(12), how do you read it? I tried ts = sys(12) and it returned 0. Tried it again just now and it worked, don't know what I did wrong the first time.
Regards,

Jim

Pearco

  • Hero Member
  • *****
  • Posts: 852
Re: Determine text size
« Reply #3 on: March 18, 2018, 08:46:38 AM »
Gymbo;

That line of code would be  Sys(12) = x
x being the size you want and it needs to be in the Text command section.

As      >Text
         {
         Sys(12) = x
         rest of code
        }
Jim
User since ProDesign 1.5

Gymbo

  • Jr. Member
  • **
  • Posts: 68
Re: Determine text size
« Reply #4 on: March 18, 2018, 09:15:51 AM »
Actually, the way I use it is to read the text size into ts, change the text size, use the new size, then reset it back to ts.

ts = sys(12)
>text2D
{
  <size 1.5   
  <text [sys$(3),sys$(8)]
}
sys(12) = ts

Regards,

Jim

Lar

  • Hero Member
  • *****
  • Posts: 2745
Re: Determine text size
« Reply #5 on: March 18, 2018, 09:25:08 AM »

... and it needs to be in the Text command section.
It should work both ways (like in Gimbo's example above).




Lar
ps: Gimbo, best to cick the # button above the writing area ("insert code" button) when writing code in a post (enter the code between the sets of square brackets), so you don't get those smiley faces...
8) ;)