Source set: Common
public class MultiParagraphIntrinsics(
public val annotatedString: AnnotatedString,
style: TextStyle,
public val placeholders: List<AnnotatedString.Range<Placeholder>>,
density: Density,
fontFamilyResolver: FontFamily.Resolver,
softWrap: Boolean,
) : ParagraphIntrinsics
Calculates and provides the intrinsic width and height of text that contains ParagraphStyle.
Parameters
| annotatedString | the text to be laid out |
| style | the TextStyle to be applied to the whole text |
| placeholders | a list of Placeholders that specify ranges of text which will be skipped during layout and replaced with Placeholder. It's required that the range of each Placeholder doesn't cross paragraph boundary, otherwise IllegalArgumentException is thrown. |
| density | density of the device |
| fontFamilyResolver | Font.ResourceLoader to be used to load the font given in SpanStyles |
| softWrap | Whether the text should break at soft line breaks. When the intention is to lay out text as a single line, setting softWrap to false enables optimizations that avoid certain expensive calculations |
Throws: IllegalArgumentException
if ParagraphStyle.textDirection is not set, or any of the placeholders crosses paragraph boundary.
Properties
minIntrinsicWidth
Source set: Common
public override val minIntrinsicWidth: Float by
lazy(LazyThreadSafetyMode.NONE) {
infoList.fastMaxBy { it.intrinsics.minIntrinsicWidth }?.intrinsics?.minIntrinsicWidth
?: 0f
}
maxIntrinsicWidth
Source set: Common
public override val maxIntrinsicWidth: Float by
lazy(LazyThreadSafetyMode.NONE) {
infoList.fastMaxBy { it.intrinsics.maxIntrinsicWidth }?.intrinsics?.maxIntrinsicWidth
?: 0f
}
hasStaleResolvedFonts
Source set: Common
public override val hasStaleResolvedFonts: Boolean