// GENERATED — DO NOT EDIT
///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/class.FontFamily.html).
pub type FontFamily
///|
pub(open) trait IFontFamily {
fn as_font_family(Self) -> FontFamily
fn get_face(Self, String?) -> FontFace? = _
fn get_name(Self) -> String = _
fn is_monospace(Self) -> Bool = _
fn is_variable(Self) -> Bool = _
fn list_faces(Self) -> Array[FontFace] = _
}
///|
pub impl IFontFamily for FontFamily with fn as_font_family(self) {
self
}
///|
#borrow(self_, name)
extern "c" fn moonbit_pango_font_family_get_face(
self_ : FontFamily,
name : @glib.Nullable[Bytes],
) -> @glib.Nullable[FontFace] = "moonbit_pango_font_family_get_face"
///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontFamily.get_face.html).
pub fn FontFamily::get_face(self : FontFamily, name : String?) -> FontFace? {
let raw_result = moonbit_pango_font_family_get_face(
self,
match name {
Some(s) => @glib.Nullable::some(@encoding/utf8.encode(s))
None => @glib.Nullable::null()
},
)
raw_result.to_option()
}
///|
#borrow(self_)
extern "c" fn moonbit_pango_font_family_get_name(self_ : FontFamily) -> Bytes = "moonbit_pango_font_family_get_name"
///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontFamily.get_name.html).
pub fn FontFamily::get_name(self : FontFamily) -> String {
@encoding/utf8.decode_lossy(moonbit_pango_font_family_get_name(self))
}
///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontFamily.is_monospace.html).
#borrow(self)
pub extern "c" fn FontFamily::is_monospace(self : FontFamily) -> Bool = "moonbit_pango_font_family_is_monospace"
///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontFamily.is_variable.html).
#borrow(self)
pub extern "c" fn FontFamily::is_variable(self : FontFamily) -> Bool = "moonbit_pango_font_family_is_variable"
///|
#borrow(self_, faces)
extern "c" fn moonbit_pango_font_family_list_faces(
self_ : FontFamily,
faces : Ref[FixedArray[FontFace]],
) = "moonbit_pango_font_family_list_faces"
///|
/// [Upstream documentation](https://gnome.pages.gitlab.gnome.org/pango/Pango/method.FontFamily.list_faces.html).
pub fn FontFamily::list_faces(self : FontFamily) -> Array[FontFace] {
let faces : Ref[FixedArray[FontFace]] = Ref([])
moonbit_pango_font_family_list_faces(self, faces)
let result : Array[FontFace] = Array::new(capacity=faces.val.length())
for i in 0.. UInt = "moonbit_pango_font_family_get_n_items"
///|
impl IFontFamily with fn get_face(self, name) -> FontFace? {
self.as_font_family().get_face(name)
}
///|
impl IFontFamily with fn get_name(self) -> String {
self.as_font_family().get_name()
}
///|
impl IFontFamily with fn is_monospace(self) -> Bool {
self.as_font_family().is_monospace()
}
///|
impl IFontFamily with fn is_variable(self) -> Bool {
self.as_font_family().is_variable()
}
///|
impl IFontFamily with fn list_faces(self) -> Array[FontFace] {
self.as_font_family().list_faces()
}
///|
pub fn FontFamily::as_gobject_object(self : FontFamily) -> @gobject.Object = "%identity"
///|
pub impl @gobject.IObject for FontFamily with fn as_object(self) {
self.as_gobject_object()
}