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

Method from_bytes

canvas/src/font_face.rs:68–72  ·  view source on GitHub ↗

Creates a new font by loading the fonts from a byte array

(bytes: Vec<u8>)

Source from the content-addressed store, hash-verified

66 /// Creates a new font by loading the fonts from a byte array
67 ///
68 pub fn from_bytes(bytes: Vec<u8>) -> Arc<CanvasFontFace> {
69 // Pin the data for this font face
70 let data = bytes.into_boxed_slice();
71 Arc::new(Self::from_pinned(Arc::new(data.into()), 0))
72 }
73
74 #[cfg(not(feature = "outline-fonts"))]
75 fn from_pinned(data: Arc<Pin<Box<[u8]>>>, _font_index: u32) -> CanvasFontFace {

Callers

nothing calls this directly

Calls 1

intoMethod · 0.45

Tested by

no test coverage detected