[pango/pango2: 137/301] Drop some underline variants
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/pango2: 137/301] Drop some underline variants
- Date: Wed, 22 Jun 2022 15:53:37 +0000 (UTC)
commit a9d47962e05dbd9973a203116f83e5092f2af5c8
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 6 23:52:09 2022 -0500
Drop some underline variants
Make them always behave like _LINE.
pango/pango-attr-list.c | 2 +-
pango/pango-attributes.h | 14 +-------------
pango/pango-item.c | 3 ---
pango/pango-renderer.c | 14 +++-----------
pango/serializer.c | 3 ---
tests/testattributes.c | 4 ++--
6 files changed, 7 insertions(+), 33 deletions(-)
---
diff --git a/pango/pango-attr-list.c b/pango/pango-attr-list.c
index 4c46cbc8d..873b0d280 100644
--- a/pango/pango-attr-list.c
+++ b/pango/pango-attr-list.c
@@ -1141,7 +1141,7 @@ pango_attr_list_from_string (const char *text)
break;
case PANGO_ATTR_UNDERLINE:
- ENUM_ATTR(underline, PangoUnderline, PANGO_UNDERLINE_NONE, PANGO_UNDERLINE_ERROR_LINE);
+ ENUM_ATTR(underline, PangoUnderline, PANGO_UNDERLINE_NONE, PANGO_UNDERLINE_ERROR);
break;
case PANGO_ATTR_STRIKETHROUGH:
diff --git a/pango/pango-attributes.h b/pango/pango-attributes.h
index 954cda838..57d961257 100644
--- a/pango/pango-attributes.h
+++ b/pango/pango-attributes.h
@@ -165,15 +165,6 @@ PangoAttribute * pango_attr_font_desc_new (const PangoFont
* as a possible mispelling; in some cases a contrasting color
* may automatically be used. This type of underlining is
* available since Pango 1.4.
- * @PANGO_UNDERLINE_SINGLE_LINE: Like @PANGO_UNDERLINE_SINGLE, but
- * drawn continuously across multiple runs. This type
- * of underlining is available since Pango 1.46.
- * @PANGO_UNDERLINE_DOUBLE_LINE: Like @PANGO_UNDERLINE_DOUBLE, but
- * drawn continuously across multiple runs. This type
- * of underlining is available since Pango 1.46.
- * @PANGO_UNDERLINE_ERROR_LINE: Like @PANGO_UNDERLINE_ERROR, but
- * drawn continuously across multiple runs. This type
- * of underlining is available since Pango 1.46.
*
* The `PangoUnderline` enumeration is used to specify whether text
* should be underlined, and if so, the type of underlining.
@@ -183,10 +174,7 @@ typedef enum {
PANGO_UNDERLINE_SINGLE,
PANGO_UNDERLINE_DOUBLE,
PANGO_UNDERLINE_LOW,
- PANGO_UNDERLINE_ERROR,
- PANGO_UNDERLINE_SINGLE_LINE,
- PANGO_UNDERLINE_DOUBLE_LINE,
- PANGO_UNDERLINE_ERROR_LINE
+ PANGO_UNDERLINE_ERROR
} PangoUnderline;
PANGO_AVAILABLE_IN_ALL
diff --git a/pango/pango-item.c b/pango/pango-item.c
index 50b9e7c88..b977d4c5e 100644
--- a/pango/pango-item.c
+++ b/pango/pango-item.c
@@ -401,18 +401,15 @@ pango_item_get_properties (PangoItem *item,
case PANGO_UNDERLINE_NONE:
break;
case PANGO_UNDERLINE_SINGLE:
- case PANGO_UNDERLINE_SINGLE_LINE:
properties->uline_single = TRUE;
break;
case PANGO_UNDERLINE_DOUBLE:
- case PANGO_UNDERLINE_DOUBLE_LINE:
properties->uline_double = TRUE;
break;
case PANGO_UNDERLINE_LOW:
properties->uline_low = TRUE;
break;
case PANGO_UNDERLINE_ERROR:
- case PANGO_UNDERLINE_ERROR_LINE:
properties->uline_error = TRUE;
break;
default:
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index 3908378a1..2234807f9 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -179,7 +179,6 @@ draw_underline (PangoRenderer *renderer,
case PANGO_UNDERLINE_NONE:
break;
case PANGO_UNDERLINE_DOUBLE:
- case PANGO_UNDERLINE_DOUBLE_LINE:
pango_renderer_draw_rectangle (renderer,
PANGO_RENDER_PART_UNDERLINE,
rect->x,
@@ -189,7 +188,6 @@ draw_underline (PangoRenderer *renderer,
G_GNUC_FALLTHROUGH;
case PANGO_UNDERLINE_SINGLE:
case PANGO_UNDERLINE_LOW:
- case PANGO_UNDERLINE_SINGLE_LINE:
pango_renderer_draw_rectangle (renderer,
PANGO_RENDER_PART_UNDERLINE,
rect->x,
@@ -198,7 +196,6 @@ draw_underline (PangoRenderer *renderer,
rect->height);
break;
case PANGO_UNDERLINE_ERROR:
- case PANGO_UNDERLINE_ERROR_LINE:
pango_renderer_draw_error_underline (renderer,
rect->x,
rect->y,
@@ -327,17 +324,12 @@ add_underline (PangoRenderer *renderer,
case PANGO_UNDERLINE_NONE:
g_assert_not_reached ();
break;
- case PANGO_UNDERLINE_SINGLE:
- case PANGO_UNDERLINE_DOUBLE:
- case PANGO_UNDERLINE_ERROR:
- new_rect.y -= underline_position;
- break;
case PANGO_UNDERLINE_LOW:
new_rect.y += ink_rect->y + ink_rect->height + underline_thickness;
break;
- case PANGO_UNDERLINE_SINGLE_LINE:
- case PANGO_UNDERLINE_DOUBLE_LINE:
- case PANGO_UNDERLINE_ERROR_LINE:
+ case PANGO_UNDERLINE_SINGLE:
+ case PANGO_UNDERLINE_DOUBLE:
+ case PANGO_UNDERLINE_ERROR:
new_rect.y -= underline_position;
if (state->underline == renderer->underline)
{
diff --git a/pango/serializer.c b/pango/serializer.c
index c37744f91..62700344a 100644
--- a/pango/serializer.c
+++ b/pango/serializer.c
@@ -79,9 +79,6 @@ static const char *underline_names[] = {
"double",
"low",
"error",
- "single-line",
- "double-line",
- "error-line",
NULL
};
diff --git a/tests/testattributes.c b/tests/testattributes.c
index 6c46f1569..ec1a8a5a8 100644
--- a/tests/testattributes.c
+++ b/tests/testattributes.c
@@ -51,7 +51,7 @@ test_attributes_basic (void)
test_copy (pango_attr_font_desc_new (desc));
pango_font_description_free (desc);
test_copy (pango_attr_underline_new (PANGO_UNDERLINE_LOW));
- test_copy (pango_attr_underline_new (PANGO_UNDERLINE_ERROR_LINE));
+ test_copy (pango_attr_underline_new (PANGO_UNDERLINE_ERROR));
test_copy (pango_attr_underline_color_new (&(PangoColor){100, 200, 300}));
test_copy (pango_attr_overline_new (PANGO_OVERLINE_SINGLE));
test_copy (pango_attr_overline_color_new (&(PangoColor){100, 200, 300}));
@@ -231,7 +231,7 @@ test_binding_helpers (void)
test_binding (pango_attr_font_desc_new (desc));
pango_font_description_free (desc);
test_binding (pango_attr_underline_new (PANGO_UNDERLINE_LOW));
- test_binding (pango_attr_underline_new (PANGO_UNDERLINE_ERROR_LINE));
+ test_binding (pango_attr_underline_new (PANGO_UNDERLINE_ERROR));
test_binding (pango_attr_underline_color_new (&(PangoColor){100, 200, 300}));
test_binding (pango_attr_overline_new (PANGO_OVERLINE_SINGLE));
test_binding (pango_attr_overline_color_new (&(PangoColor){100, 200, 300}));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]