1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::FontType;
use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct FontsIter(Boxed<ffi::PopplerFontsIter>);

    match fn {
        copy => |ptr| ffi::poppler_fonts_iter_copy(mut_override(ptr)),
        free => |ptr| ffi::poppler_fonts_iter_free(ptr),
        type_ => || ffi::poppler_fonts_iter_get_type(),
    }
}

impl FontsIter {
    /// Returns the encoding of the font associated with `self`
    ///
    /// # Returns
    ///
    /// the font encoding
    #[doc(alias = "poppler_fonts_iter_get_encoding")]
    #[doc(alias = "get_encoding")]
    pub fn encoding(&mut self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_fonts_iter_get_encoding(
                self.to_glib_none_mut().0,
            ))
        }
    }

    /// The filename of the font associated with `self` or [`None`] if
    /// the font is embedded
    ///
    /// # Returns
    ///
    /// the filename of the font or [`None`] if font is embedded
    #[doc(alias = "poppler_fonts_iter_get_file_name")]
    #[doc(alias = "get_file_name")]
    pub fn file_name(&mut self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_fonts_iter_get_file_name(
                self.to_glib_none_mut().0,
            ))
        }
    }

    /// Returns the type of the font associated with `self`
    ///
    /// # Returns
    ///
    /// the font type
    #[doc(alias = "poppler_fonts_iter_get_font_type")]
    #[doc(alias = "get_font_type")]
    pub fn font_type(&mut self) -> FontType {
        unsafe {
            from_glib(ffi::poppler_fonts_iter_get_font_type(
                self.to_glib_none_mut().0,
            ))
        }
    }

    /// Returns the full name of the font associated with `self`
    ///
    /// # Returns
    ///
    /// the font full name
    #[doc(alias = "poppler_fonts_iter_get_full_name")]
    #[doc(alias = "get_full_name")]
    pub fn full_name(&mut self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_fonts_iter_get_full_name(
                self.to_glib_none_mut().0,
            ))
        }
    }

    /// Returns the name of the font associated with `self`
    ///
    /// # Returns
    ///
    /// the font name
    #[doc(alias = "poppler_fonts_iter_get_name")]
    #[doc(alias = "get_name")]
    pub fn name(&mut self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::poppler_fonts_iter_get_name(self.to_glib_none_mut().0)) }
    }

    /// The name of the substitute font of the font associated with `self` or [`None`] if
    /// the font is embedded
    ///
    /// # Returns
    ///
    /// the name of the substitute font or [`None`] if font is embedded
    #[doc(alias = "poppler_fonts_iter_get_substitute_name")]
    #[doc(alias = "get_substitute_name")]
    pub fn substitute_name(&mut self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_fonts_iter_get_substitute_name(
                self.to_glib_none_mut().0,
            ))
        }
    }

    /// Returns whether the font associated with `self` is embedded in the document
    ///
    /// # Returns
    ///
    /// [`true`] if font is embedded, [`false`] otherwise
    #[doc(alias = "poppler_fonts_iter_is_embedded")]
    pub fn is_embedded(&mut self) -> bool {
        unsafe {
            from_glib(ffi::poppler_fonts_iter_is_embedded(
                self.to_glib_none_mut().0,
            ))
        }
    }

    /// Returns whether the font associated with `self` is a subset of another font
    ///
    /// # Returns
    ///
    /// [`true`] if font is a subset, [`false`] otherwise
    #[doc(alias = "poppler_fonts_iter_is_subset")]
    pub fn is_subset(&mut self) -> bool {
        unsafe { from_glib(ffi::poppler_fonts_iter_is_subset(self.to_glib_none_mut().0)) }
    }

    /// Sets `self` to point to the next font
    ///
    /// # Returns
    ///
    /// [`true`], if `self` was set to the next font
    #[doc(alias = "poppler_fonts_iter_next")]
    pub fn next(&mut self) -> bool {
        unsafe { from_glib(ffi::poppler_fonts_iter_next(self.to_glib_none_mut().0)) }
    }
}