pango/auto/
fontset_simple.rs1use glib::object::IsA;
6use glib::translate::*;
7use pango_sys;
8use std::fmt;
9use Font;
10use Fontset;
11use Language;
12
13glib_wrapper! {
14 pub struct FontsetSimple(Object<pango_sys::PangoFontsetSimple, pango_sys::PangoFontsetSimpleClass, FontsetSimpleClass>) @extends Fontset;
15
16 match fn {
17 get_type => || pango_sys::pango_fontset_simple_get_type(),
18 }
19}
20
21impl FontsetSimple {
22 pub fn new(language: &mut Language) -> FontsetSimple {
23 unsafe {
24 from_glib_full(pango_sys::pango_fontset_simple_new(
25 language.to_glib_none_mut().0,
26 ))
27 }
28 }
29
30 pub fn append<P: IsA<Font>>(&self, font: &P) {
31 unsafe {
32 pango_sys::pango_fontset_simple_append(
33 self.to_glib_none().0,
34 font.as_ref().to_glib_none().0,
35 );
36 }
37 }
38
39 pub fn size(&self) -> i32 {
40 unsafe { pango_sys::pango_fontset_simple_size(self.to_glib_none().0) }
41 }
42}
43
44impl fmt::Display for FontsetSimple {
45 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
46 write!(f, "FontsetSimple")
47 }
48}