ContentPadding

ContentPadding

is an option for objects that can be displayed with frames that specifies whether the vertical margins should shrink wrap tightly around the contents.

Details

  • With the setting ContentPadding->True, the height of the content area of a framed object will be at least one full line height, even if the contents of a given line do not span the full height of the line.
  • A setting of ContentPadding->False shrinks the content area tightly around the contents instead of rounding out to at least one full line height.
  • The internal margin of a framed object is set by adding the value of FrameMargins to the margin area controlled by ContentPadding.

Examples

open allclose all

Basic Examples  (3)

By default, a button spans the full line height of the font used to populate its contents:

Create a button that is shorter than the line height for the font it uses:

Compare margins for labels with and without ascenders and descenders:

If the content area is already taller than one line height, ContentPaddingTrue will do nothing:

Properties & Relations  (1)

ContentPaddingTrue pads the full ascender and descender height:

If the baseline is moved by BaselinePosition, this may require extra padding to compensate:

Wolfram Research (2010), ContentPadding, Wolfram Language function, https://reference.wolfram.com/language/ref/ContentPadding.html (updated 2021).

Text

Wolfram Research (2010), ContentPadding, Wolfram Language function, https://reference.wolfram.com/language/ref/ContentPadding.html (updated 2021).

CMS

Wolfram Language. 2010. "ContentPadding." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ContentPadding.html.

APA

Wolfram Language. (2010). ContentPadding. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ContentPadding.html

BibTeX

@misc{reference.wolfram_2024_contentpadding, author="Wolfram Research", title="{ContentPadding}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ContentPadding.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_contentpadding, organization={Wolfram Research}, title={ContentPadding}, year={2021}, url={https://reference.wolfram.com/language/ref/ContentPadding.html}, note=[Accessed: 22-December-2024 ]}