The height and width fields get or set the rendered on-screen dimensions of a presentation tag.
<box height=3,{em}>
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 specifier | Description | Example | Interpretation |
---|---|---|---|
None | Pixels (default units) | 5 | 5 pixels |
{px} | Pixels (explicitly stated) | 5,{px} | 5 pixels |
{%} | Percentage units | 20,{%} | 5% |
{pt} | Typesetting point units | 12,{pt} | 12pt text size |
{em} | Multiple of current font size | 1.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 specify50,{%}
as50,{%%}
.
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.