pango/auto/
fontset_simple.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{ffi, Font, Fontset, Language};
6use glib::{prelude::*, translate::*};
7
8glib::wrapper! {
9    #[doc(alias = "PangoFontsetSimple")]
10    pub struct FontsetSimple(Object<ffi::PangoFontsetSimple, ffi::PangoFontsetSimpleClass>) @extends Fontset;
11
12    match fn {
13        type_ => || ffi::pango_fontset_simple_get_type(),
14    }
15}
16
17impl FontsetSimple {
18    #[doc(alias = "pango_fontset_simple_new")]
19    pub fn new(language: &mut Language) -> FontsetSimple {
20        unsafe { from_glib_full(ffi::pango_fontset_simple_new(language.to_glib_none_mut().0)) }
21    }
22
23    #[doc(alias = "pango_fontset_simple_append")]
24    pub fn append(&self, font: impl IsA<Font>) {
25        unsafe {
26            ffi::pango_fontset_simple_append(self.to_glib_none().0, font.upcast().into_glib_ptr());
27        }
28    }
29
30    #[doc(alias = "pango_fontset_simple_size")]
31    pub fn size(&self) -> i32 {
32        unsafe { ffi::pango_fontset_simple_size(self.to_glib_none().0) }
33    }
34}