pub fn measure_text_system(
fonts: Res<'_, Assets<Font>>,
text_query: Query<'_, '_, (Entity, Ref<'_, TextLayout>, &mut ContentSize, &mut TextNodeFlags, &mut ComputedTextBlock, Ref<'_, ComputedUiRenderTargetInfo>, &ComputedNode), With<Node>>,
text_reader: TextReader<'_, '_, Text>,
text_pipeline: ResMut<'_, TextPipeline>,
font_system: ResMut<'_, CosmicFontSystem>,
)Expand description
Generates a new Measure for a text node on changes to its Text component.
A Measure is used by the UI’s layout algorithm to determine the appropriate amount of space
to provide for the text given the fonts, the text itself and the constraints of the layout.
- Measures are regenerated on changes to either
ComputedTextBlockorComputedUiRenderTargetInfo. - Changes that only modify the colors of a
Textdo not require a newMeasure. This system is only able to detect that aTextcomponent has changed and will regenerate theMeasureon color changes. This can be expensive, particularly for large blocks of text, and thebypass_change_detectionmethod should be called when only changing theText’s colors.