MCPcopy Create free account
hub / github.com/TheRedDeveloper/ply-engine / get

Method get

src/renderer.rs:143–152  ·  view source on GitHub ↗

Get a cached font by its asset key.

(&mut self, asset: &'static FontAsset)

Source from the content-addressed store, hash-verified

141
142 /// Get a cached font by its asset key.
143 pub fn get(&mut self, asset: &'static FontAsset) -> Option<&Font> {
144 let key = asset.key();
145 if let Some(data) = self.fonts.get_mut(key) {
146 return Some(&data.font);
147 }
148 // Fall back to the default font if the key matches
149 self.default_font.as_ref()
150 .filter(|d| d.key == key)
151 .map(|d| &d.font)
152 }
153
154 /// Get the default font (set via [`load_default`](FontManager::load_default)).
155 /// Returns `None` if no default font has been set.

Callers 15

uFunction · 0.80
lFunction · 0.80
sync_accessibility_treeFunction · 0.80
beginMethod · 0.80
render_styled_textFunction · 0.80
close_elementMethod · 0.80
font_heightMethod · 0.80
set_pointer_stateMethod · 0.80
focused_elementMethod · 0.80

Calls 2

keyMethod · 0.80
textureMethod · 0.80

Tested by

no test coverage detected