{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

ParagraphIntrinsics

public interface ParagraphIntrinsics

Known direct subclasses
MultiParagraphIntrinsics

Calculates and provides the intrinsic width and height of text that contains ParagraphStyle.


Calculates and presents the intrinsic width and height of text.

Summary

Public methods

default boolean

Any Paragraph rendered using this ParagraphIntrinsics will be measured and drawn using stale resolved fonts.

abstract float

Returns the smallest width beyond which increasing the width never decreases the height.

abstract float

The width for text if all soft wrap opportunities were taken.

Public methods

getHasStaleResolvedFonts

default boolean getHasStaleResolvedFonts()

Any Paragraph rendered using this ParagraphIntrinsics will be measured and drawn using stale resolved fonts.

If this is false, this ParagraphIntrinsics is using the most current font resolution from FontFamily.Resolver.

If this is true, recreating this ParagraphIntrinsics will use new fonts from FontFamily.Resolver for both display and measurement. Recreating this ParagraphIntrinsics and displaying the resulting Paragraph causes user-visible reflow of the displayed text.

Once true, this will never become false without recreating this ParagraphIntrinsics.

It is discouraged, but safe, to continue to use this object after this becomes true. The only impact of using this object after hasStaleResolvedFonts becomes true is stale resolutions of async fonts for measurement and display.

getMaxIntrinsicWidth

abstract float getMaxIntrinsicWidth()

Returns the smallest width beyond which increasing the width never decreases the height.

getMinIntrinsicWidth

abstract float getMinIntrinsicWidth()

The width for text if all soft wrap opportunities were taken.