Skip to content

Commit 5156d56

Browse files
committed
pango: Add bindings for Font::languages()
Fixes #1637
1 parent 48b8e97 commit 5156d56

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

pango/Gir.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,6 @@ status = "generate"
253253
[[object.function.parameter]]
254254
name = "language"
255255
const = true
256-
[[object.function]]
257-
name = "get_languages"
258-
# TODO: requires FromGlibPtrArrayContainerAsVec implementation
259-
ignore = true
260256

261257
[[object]]
262258
name = "Pango.FontDescription"

pango/src/auto/font.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ pub trait FontExt: IsA<Font> + sealed::Sealed + 'static {
123123
// unsafe { TODO: call ffi:pango_font_get_hb_font() }
124124
//}
125125

126+
#[cfg(feature = "v1_50")]
127+
#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
128+
#[doc(alias = "pango_font_get_languages")]
129+
#[doc(alias = "get_languages")]
130+
fn languages(&self) -> Vec<Language> {
131+
unsafe {
132+
FromGlibPtrContainer::from_glib_none(ffi::pango_font_get_languages(
133+
self.as_ref().to_glib_none().0,
134+
))
135+
}
136+
}
137+
126138
#[doc(alias = "pango_font_get_metrics")]
127139
#[doc(alias = "get_metrics")]
128140
fn metrics(&self, language: Option<&Language>) -> FontMetrics {

0 commit comments

Comments
 (0)