1
0
Fork 0
forked from wry/wry

autocommit 2022-04-10 18:26:13 CEST

This commit is contained in:
Julian Orth 2022-04-10 18:26:13 +02:00
parent af152f7f3e
commit 6b3316e920
26 changed files with 514 additions and 82 deletions

View file

@ -72,6 +72,7 @@ extern "C" {
desc: *const PangoFontDescription_,
);
fn pango_layout_set_text(layout: *mut PangoLayout_, text: *const c::c_char, length: c::c_int);
fn pango_layout_set_markup(layout: *mut PangoLayout_, text: *const c::c_char, length: c::c_int);
fn pango_layout_get_pixel_size(
layout: *mut PangoLayout_,
width: *mut c::c_int,
@ -295,6 +296,12 @@ impl PangoLayout {
}
}
pub fn set_markup(&self, text: &str) {
unsafe {
pango_layout_set_markup(self.l, text.as_ptr() as _, text.len() as _);
}
}
pub fn pixel_size(&self) -> (i32, i32) {
unsafe {
let mut w = 0;