summaryrefslogtreecommitdiffstats
path: root/graphics/src/renderer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-11 02:47:24 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-09-11 02:47:24 +0200
commit346af3f8b0baa418fd37b878bc2930ff0bd57cc0 (patch)
treeb11cde03595fb28bddb055507d272dd973634ab5 /graphics/src/renderer.rs
parent9245423c5d82f88c99adecaaf5dd2ac3559a05a8 (diff)
downloadiced-346af3f8b0baa418fd37b878bc2930ff0bd57cc0.tar.gz
iced-346af3f8b0baa418fd37b878bc2930ff0bd57cc0.tar.bz2
iced-346af3f8b0baa418fd37b878bc2930ff0bd57cc0.zip
Make `FontSystem` global and simplify `Paragraph` API
Diffstat (limited to 'graphics/src/renderer.rs')
-rw-r--r--graphics/src/renderer.rs35
1 files changed, 0 insertions, 35 deletions
diff --git a/graphics/src/renderer.rs b/graphics/src/renderer.rs
index d4df29a5..c5033d36 100644
--- a/graphics/src/renderer.rs
+++ b/graphics/src/renderer.rs
@@ -158,41 +158,6 @@ where
self.backend.load_font(bytes);
}
- fn create_paragraph(&self, text: Text<'_, Self::Font>) -> text::Paragraph {
- text::Paragraph::with_text(text, self.backend.font_system())
- }
-
- fn update_paragraph(
- &self,
- paragraph: &mut Self::Paragraph,
- text: Text<'_, Self::Font>,
- ) {
- let font_system = self.backend.font_system();
-
- if paragraph.version() != font_system.version() {
- // The font system has changed, paragraph fonts may be outdated
- *paragraph = self.create_paragraph(text);
- } else {
- match core::text::compare(paragraph, text) {
- core::text::Difference::None => {}
- core::text::Difference::Bounds => {
- self.resize_paragraph(paragraph, text.bounds);
- }
- core::text::Difference::Shape => {
- *paragraph = self.create_paragraph(text);
- }
- }
- }
- }
-
- fn resize_paragraph(
- &self,
- paragraph: &mut Self::Paragraph,
- new_bounds: Size,
- ) {
- paragraph.resize(new_bounds, self.backend.font_system());
- }
-
fn fill_paragraph(
&mut self,
paragraph: &Self::Paragraph,