Post Reply 
Parameters of the TEXTSIZE
03-14-2024, 09:14 PM
Post: #1
Parameters of the TEXTSIZE
Does anyone know what the third and fifth parameters of TEXTSIZE are responsible for?

The basic form is TEXTSIZE(text, [font]), which returns a list {width, height} containing the size in pixels of the specified text provided as the first parameter, using the font size (allowed values from 0 [default] to 7, as described in the TEXTOUT_P help) specified in the second parameter.

For example:
TEXTSIZE("Prime",3) → {39,16}

The third parameter definitely only accepts positive integer values because for other values, it triggers a "Error: Invalid input" and I'm not sure what this parameter is responsible for.

The fourth parameter seems to be the maximum length of the field in pixels where we are trying to fit the text, and then in the width value (first element of the result list), we get the size considering as many characters as will fit in that field.

For example:
TEXTSIZE("Prime",3,0,28) → {18,16}
where 18 is the width of "Pri", because if we add one more char, we get "Prim", which has a width of 31, so it exceeds 28.

The fifth parameter - also a positive integer, but I couldn't determine what it's for.

Help opens the description for TEXTOUT, so there is a bug in the reference to the description for TEXTSIZE here.

Does anyone know more about these parameters?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Parameters of the TEXTSIZE - komame - 03-14-2024 09:14 PM
RE: Parameters of the TEXTSIZE - komame - 03-16-2024, 05:35 PM
RE: Parameters of the TEXTSIZE - komame - 03-18-2024, 06:45 AM
RE: Parameters of the TEXTSIZE - Tyann - 03-31-2024, 01:06 PM
RE: Parameters of the TEXTSIZE - komame - 03-31-2024, 06:37 PM



User(s) browsing this thread: 1 Guest(s)