pango/
glyph_geometry.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use std::fmt;
4
5glib::wrapper! {
6    #[doc(alias = "PangoGlyphGeometry")]
7    pub struct GlyphGeometry(BoxedInline<crate::ffi::PangoGlyphGeometry>);
8}
9
10impl GlyphGeometry {
11    #[inline]
12    pub fn width(&self) -> i32 {
13        self.inner.width
14    }
15
16    #[inline]
17    pub fn set_width(&mut self, width: i32) {
18        self.inner.width = width;
19    }
20
21    #[inline]
22    pub fn x_offset(&self) -> i32 {
23        self.inner.x_offset
24    }
25
26    #[inline]
27    pub fn set_x_offset(&mut self, x_offset: i32) {
28        self.inner.x_offset = x_offset;
29    }
30
31    #[inline]
32    pub fn y_offset(&self) -> i32 {
33        self.inner.y_offset
34    }
35
36    #[inline]
37    pub fn set_y_offset(&mut self, y_offset: i32) {
38        self.inner.y_offset = y_offset;
39    }
40}
41
42impl fmt::Debug for GlyphGeometry {
43    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
44        f.debug_struct("GlyphGeometry")
45            .field("x_offset", &self.x_offset())
46            .field("y_offset", &self.y_offset())
47            .field("width", &self.width())
48            .finish()
49    }
50}