[librsvg: 11/22] Provide an accessor to FontFamily's inner string
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 11/22] Provide an accessor to FontFamily's inner string
- Date: Wed, 1 Jul 2020 00:03:59 +0000 (UTC)
commit 5d04d5293287f8947bc185bed7ec0d763b613be2
Author: Federico Mena Quintero <federico gnome org>
Date: Thu Jun 25 19:23:54 2020 -0500
Provide an accessor to FontFamily's inner string
rsvg_internals/src/font_props.rs | 6 ++++++
rsvg_internals/src/text.rs | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/rsvg_internals/src/font_props.rs b/rsvg_internals/src/font_props.rs
index 4f5e73cd..1ea52f90 100644
--- a/rsvg_internals/src/font_props.rs
+++ b/rsvg_internals/src/font_props.rs
@@ -337,6 +337,12 @@ impl Parse for FontFamily {
}
}
+impl FontFamily {
+ pub fn as_str(&self) -> &str {
+ &self.0
+ }
+}
+
#[cfg(test)]
mod tests {
use super::*;
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index a6f3a8e0..1888d044 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -958,7 +958,7 @@ fn create_pango_layout(
}
let mut font_desc = pango_context.get_font_description().unwrap();
- font_desc.set_family(&(values.font_family()).0);
+ font_desc.set_family(values.font_family().as_str());
font_desc.set_style(pango::Style::from(values.font_style()));
font_desc.set_variant(pango::Variant::from(values.font_variant()));
font_desc.set_weight(pango::Weight::from(values.font_weight()));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]