[librsvg: 4/22] Comment on how we parse line-height, but don't use it, for Pango reasons
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 4/22] Comment on how we parse line-height, but don't use it, for Pango reasons
- Date: Wed, 1 Jul 2020 00:03:22 +0000 (UTC)
commit 3d09ceada8e19aa373136706cb4a45910a43bffe
Author: Federico Mena Quintero <federico gnome org>
Date: Wed Jun 24 19:57:25 2020 -0500
Comment on how we parse line-height, but don't use it, for Pango reasons
rsvg_internals/src/text.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/rsvg_internals/src/text.rs b/rsvg_internals/src/text.rs
index d93a9773..be037a26 100644
--- a/rsvg_internals/src/text.rs
+++ b/rsvg_internals/src/text.rs
@@ -974,6 +974,18 @@ fn create_pango_layout(
layout.set_auto_dir(false);
layout.set_font_description(Some(&font_desc));
+ // FIXME: For now we ignore the `line-height` property, even though we parse it.
+ // We would need to do something like this:
+ //
+ // layout.set_line_spacing(0.0); // "actually use the spacing I'll give you"
+ // layout.set_spacing(to_pango_units(???));
+ //
+ // However, Layout::set_spacing() takes an inter-line spacing (from the baseline of
+ // one line to the top of the next line), not the line height (from baseline to
+ // baseline).
+ //
+ // Maybe we need to implement layout of individual lines by hand.
+
let attr_list = pango::AttrList::new();
attr_list.insert(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]