summaryrefslogtreecommitdiffstats
path: root/core/src/renderer
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 /core/src/renderer
parent9245423c5d82f88c99adecaaf5dd2ac3559a05a8 (diff)
downloadiced-346af3f8b0baa418fd37b878bc2930ff0bd57cc0.tar.gz
iced-346af3f8b0baa418fd37b878bc2930ff0bd57cc0.tar.bz2
iced-346af3f8b0baa418fd37b878bc2930ff0bd57cc0.zip
Make `FontSystem` global and simplify `Paragraph` API
Diffstat (limited to 'core/src/renderer')
-rw-r--r--core/src/renderer/null.rs34
1 files changed, 4 insertions, 30 deletions
diff --git a/core/src/renderer/null.rs b/core/src/renderer/null.rs
index 55d58a59..0ffd3649 100644
--- a/core/src/renderer/null.rs
+++ b/core/src/renderer/null.rs
@@ -58,16 +58,6 @@ impl text::Renderer for Null {
fn load_font(&mut self, _font: Cow<'static, [u8]>) {}
- fn create_paragraph(&self, _text: Text<'_, Self::Font>) -> Self::Paragraph {
- }
-
- fn resize_paragraph(
- &self,
- _paragraph: &mut Self::Paragraph,
- _new_bounds: Size,
- ) {
- }
-
fn fill_paragraph(
&mut self,
_paragraph: &Self::Paragraph,
@@ -88,24 +78,12 @@ impl text::Renderer for Null {
impl text::Paragraph for () {
type Font = Font;
- fn content(&self) -> &str {
- ""
- }
-
- fn text_size(&self) -> Pixels {
- Pixels(16.0)
- }
-
- fn font(&self) -> Self::Font {
- Font::default()
- }
+ fn with_text(_text: Text<'_, Self::Font>) -> Self {}
- fn line_height(&self) -> text::LineHeight {
- text::LineHeight::default()
- }
+ fn resize(&mut self, _new_bounds: Size) {}
- fn shaping(&self) -> text::Shaping {
- text::Shaping::default()
+ fn compare(&self, _text: Text<'_, Self::Font>) -> text::Difference {
+ text::Difference::None
}
fn horizontal_alignment(&self) -> alignment::Horizontal {
@@ -120,10 +98,6 @@ impl text::Paragraph for () {
None
}
- fn bounds(&self) -> Size {
- Size::ZERO
- }
-
fn min_bounds(&self) -> Size {
Size::ZERO
}