pango/
attr_string.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};
6
7define_attribute_struct!(AttrString, ffi::PangoAttrString, &[AttrType::Family]);
8
9impl AttrString {
10    #[doc(alias = "pango_attr_family_new")]
11    pub fn new_family(family: &str) -> Self {
12        unsafe { from_glib_full(ffi::pango_attr_family_new(family.to_glib_none().0)) }
13    }
14
15    pub fn value(&self) -> glib::GString {
16        unsafe { from_glib_none(self.inner.value) }
17    }
18}