Skip to content

Commit

Permalink
pango: Add bindings for Font::languages()
Browse files Browse the repository at this point in the history
Fixes #1637
  • Loading branch information
sdroege committed Jan 27, 2025
1 parent 27f64cd commit c50af66
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pango/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,6 @@ status = "generate"
[[object.function.parameter]]
name = "language"
const = true
[[object.function]]
name = "get_languages"
# TODO: requires FromGlibPtrArrayContainerAsVec implementation
ignore = true

[[object]]
name = "Pango.FontDescription"
Expand Down
12 changes: 12 additions & 0 deletions pango/src/auto/font.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ pub trait FontExt: IsA<Font> + 'static {
// unsafe { TODO: call ffi:pango_font_get_hb_font() }
//}

#[cfg(feature = "v1_50")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
#[doc(alias = "pango_font_get_languages")]
#[doc(alias = "get_languages")]
fn languages(&self) -> Vec<Language> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::pango_font_get_languages(
self.as_ref().to_glib_none().0,
))
}
}

#[doc(alias = "pango_font_get_metrics")]
#[doc(alias = "get_metrics")]
fn metrics(&self, language: Option<&Language>) -> FontMetrics {
Expand Down

0 comments on commit c50af66

Please sign in to comment.