[librsvg/bilelmoussaoui/new-gtk-rs-stack: 2/3] update per gtk-rs changes
- From: Bilal Elmoussaoui <bilelmoussaoui src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/bilelmoussaoui/new-gtk-rs-stack: 2/3] update per gtk-rs changes
- Date: Sat, 13 Nov 2021 10:49:05 +0000 (UTC)
commit 817c2f756b7bf7e93db403ba6650fa28ba4e1448
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date: Sat Nov 13 09:03:38 2021 +0100
update per gtk-rs changes
src/text.rs | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/text.rs b/src/text.rs
index 0fd5ac40..d54aebec 100644
--- a/src/text.rs
+++ b/src/text.rs
@@ -391,14 +391,14 @@ fn compute_text_box(
#![allow(clippy::many_single_char_names)]
let (ink, _) = layout.extents();
- if ink.width == 0 || ink.height == 0 {
+ if ink.width() == 0 || ink.height() == 0 {
return None;
}
- let ink_x = f64::from(ink.x);
- let ink_y = f64::from(ink.y);
- let ink_width = f64::from(ink.width);
- let ink_height = f64::from(ink.height);
+ let ink_x = f64::from(ink.x());
+ let ink_y = f64::from(ink.y());
+ let ink_width = f64::from(ink.width());
+ let ink_height = f64::from(ink.height());
let pango_scale = f64::from(pango::SCALE);
let (x, y, w, h) = if gravity_is_vertical(gravity) {
@@ -1239,29 +1239,29 @@ fn add_pango_attributes(
font_desc.set_size(to_pango_units(props.font_size));
- attributes.push(pango::Attribute::new_font_desc(&font_desc));
+ attributes.push(pango::AttrFontDesc::new(&font_desc));
- attributes.push(pango::Attribute::new_letter_spacing(to_pango_units(
+ attributes.push(pango::AttrInt::new_letter_spacing(to_pango_units(
props.letter_spacing,
)));
if props.text_decoration.overline {
- attributes.push(pango::Attribute::new_overline(pango::Overline::Single));
+ attributes.push(pango::AttrInt::new_overline(pango::Overline::Single));
}
if props.text_decoration.underline {
- attributes.push(pango::Attribute::new_underline(pango::Underline::Single));
+ attributes.push(pango::AttrInt::new_underline(pango::Underline::Single));
}
if props.text_decoration.strike {
- attributes.push(pango::Attribute::new_strikethrough(true));
+ attributes.push(pango::AttrInt::new_strikethrough(true));
}
// FIXME: Using the "smcp" OpenType feature only works for fonts that support it. We
// should query if the font supports small caps, and synthesize them if it doesn't.
if props.font_variant == FontVariant::SmallCaps {
// smcp - small capitals - https://docs.microsoft.com/en-ca/typography/opentype/spec/features_pt#smcp
- attributes.push(pango::Attribute::new_font_features("'smcp' 1"));
+ attributes.push(pango::AttrFontFeatures::new("'smcp' 1"));
}
// Set the range in each attribute
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]