pango/
attr_font_desc.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::translate::*;
4
5use crate::{ffi, AttrType, FontDescription};
6
7define_attribute_struct!(AttrFontDesc, ffi::PangoAttrFontDesc, &[AttrType::FontDesc]);
8
9impl AttrFontDesc {
10    #[doc(alias = "pango_attr_font_desc_new")]
11    pub fn new(desc: &FontDescription) -> Self {
12        unsafe { from_glib_full(ffi::pango_attr_font_desc_new(desc.to_glib_none().0)) }
13    }
14
15    pub fn desc(&self) -> FontDescription {
16        unsafe { from_glib_none(self.inner.desc) }
17    }
18}