[librsvg] rsvg-text.c: Create pango attributes inline; no need to specify their extents
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] rsvg-text.c: Create pango attributes inline; no need to specify their extents
- Date: Fri, 15 Dec 2017 18:53:52 +0000 (UTC)
commit f7ef0c508a14defb362d9ac60edf5d9200a8616a
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Dec 15 11:00:56 2017 -0600
rsvg-text.c: Create pango attributes inline; no need to specify their extents
Attributes get created to span the whole text by default.
rsvg-text.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/rsvg-text.c b/rsvg-text.c
index ee52b98..ce122be 100644
--- a/rsvg-text.c
+++ b/rsvg-text.c
@@ -557,7 +557,6 @@ rsvg_text_create_layout (RsvgDrawingCtx *ctx, const char *text)
PangoFontDescription *font_desc;
PangoLayout *layout;
PangoAttrList *attr_list;
- PangoAttribute *attribute;
double dpi_y;
const char *lang;
UnicodeBidi unicode_bidi;
@@ -599,23 +598,17 @@ rsvg_text_create_layout (RsvgDrawingCtx *ctx, const char *text)
attr_list = pango_attr_list_new ();
letter_spacing = rsvg_state_get_letter_spacing (state);
- attribute = pango_attr_letter_spacing_new (rsvg_length_normalize (&letter_spacing, ctx) * PANGO_SCALE);
- attribute->start_index = 0;
- attribute->end_index = G_MAXINT;
- pango_attr_list_insert (attr_list, attribute);
+ pango_attr_list_insert (attr_list,
+ pango_attr_letter_spacing_new (rsvg_length_normalize (&letter_spacing, ctx) *
PANGO_SCALE));
if (state->has_font_decor && text) {
if (state->font_decor & TEXT_UNDERLINE) {
- attribute = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
- attribute->start_index = 0;
- attribute->end_index = -1;
- pango_attr_list_insert (attr_list, attribute);
+ pango_attr_list_insert (attr_list,
+ pango_attr_underline_new (PANGO_UNDERLINE_SINGLE));
}
if (state->font_decor & TEXT_STRIKE) {
- attribute = pango_attr_strikethrough_new (TRUE);
- attribute->start_index = 0;
- attribute->end_index = -1;
- pango_attr_list_insert (attr_list, attribute);
+ pango_attr_list_insert (attr_list,
+ pango_attr_strikethrough_new (TRUE));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]