INPUT /  OUTPUT /  LANGUAGE






height, width fields

Category: vector fields

The height and width fields get or set the rendered on-screen dimensions of a presentation tag.

Applies to...

Sample usage

<box height=3,{em}>

Behaviour

Specifying a distance value for this field

This field takes a distance value specified with either one or two value elements.

If the units are not specified, the distance is interpreted in pixels {px} by default.
Unit specifierDescriptionExampleInterpretation
None Pixels (default units)55 pixels
{px} Pixels (explicitly stated)5,{px} 5 pixels
{%} Percentage units20,{%} 5%
{pt} Typesetting point units12,{pt} 12pt text size
{em} Multiple of current font size1.2,{em} 1.2 × current font size
Some programming languages use % symbols as placeholders when printing output to the console. In such cases, you might need to ouput the % character in a different way. For example, in C's printf function, you would need to specify 50,{%} as 50,{%%}.

Getting a value from this field

When getting a value for this field, a single numerical value in pixels is produced.

For the height and width fields, getting the current value of the field enables you to check the actual rendered dimensions of the tag in pixels.


Note: when applied to the console tag instance, you can get the values from the height and width fields in order to check the current size of the console in pixels, but you cannot change these values.

Programs cannot resize their own parent consoles.