MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / decode_font_op_layout

Method decode_font_op_layout

canvas/src/decoding.rs:1402–1411  ·  view source on GitHub ↗

Decides a text layout instruction

(chr: char, font_id: FontId, string: DecodeString)

Source from the content-addressed store, hash-verified

1400 /// Decides a text layout instruction
1401 ///
1402 fn decode_font_op_layout(chr: char, font_id: FontId, string: DecodeString) -> Result<(DecoderState, Option<Draw>), DecoderError>{
1403 let string = string.decode(chr)?;
1404
1405 if string.ready() {
1406 let string = string.to_string()?;
1407 Ok((DecoderState::None, Some(Draw::Font(font_id, FontOp::LayoutText(string)))))
1408 } else {
1409 Ok((DecoderState::FontOpLayoutText(font_id, string), None))
1410 }
1411 }
1412
1413 ///
1414 /// Decides a text layout instruction

Callers

nothing calls this directly

Calls 3

decodeMethod · 0.80
readyMethod · 0.80
to_stringMethod · 0.80

Tested by

no test coverage detected