gsk4/
text_node.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::{RenderNodeType, TextNode};
4
5define_render_node!(TextNode, crate::ffi::GskTextNode, RenderNodeType::TextNode);
6
7impl std::fmt::Debug for TextNode {
8    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
9        #[cfg(feature = "v4_2")]
10        {
11            f.debug_struct("TextNode")
12                .field("color", &self.color())
13                .field("glyphs", &self.glyphs())
14                .field("num_glyphs", &self.num_glyphs())
15                .field("font", &self.font())
16                .field("offset", &self.offset())
17                .field("has_color_glyphs", &self.has_color_glyphs())
18                .finish()
19        }
20        #[cfg(not(feature = "v4_2"))]
21        {
22            f.debug_struct("TextNode")
23                .field("color", &self.color())
24                .field("glyphs", &self.glyphs())
25                .field("num_glyphs", &self.num_glyphs())
26                .field("font", &self.font())
27                .field("offset", &self.offset())
28                .finish()
29        }
30    }
31}