summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
Diffstat (limited to 'pango')
-rw-r--r--pango/pango-bidi-type.c7
-rw-r--r--pango/pango-bidi-type.h12
-rw-r--r--pango/pango-markup.c32
-rw-r--r--pango/pango-matrix.c13
-rw-r--r--pango/pango-tabs.c2
-rw-r--r--pango/pango-utils.c2
6 files changed, 36 insertions, 32 deletions
diff --git a/pango/pango-bidi-type.c b/pango/pango-bidi-type.c
index 8700836b..a5a13a9a 100644
--- a/pango/pango-bidi-type.c
+++ b/pango/pango-bidi-type.c
@@ -79,10 +79,11 @@ pango_bidi_type_for_unichar (gunichar ch)
case FRIBIDI_TYPE_SS: return PANGO_BIDI_TYPE_S;
case FRIBIDI_TYPE_WS: return PANGO_BIDI_TYPE_WS;
case FRIBIDI_TYPE_ON: return PANGO_BIDI_TYPE_ON;
+ case FRIBIDI_TYPE_LRI: return PANGO_BIDI_TYPE_LRI;
+ case FRIBIDI_TYPE_RLI: return PANGO_BIDI_TYPE_RLI;
+ case FRIBIDI_TYPE_FSI: return PANGO_BIDI_TYPE_FSI;
+ case FRIBIDI_TYPE_PDI: return PANGO_BIDI_TYPE_PDI;
default:
- /* TODO
- * This function has not been updated for latest FriBidi.
- * Should add new types and / or deprecate this function. */
return PANGO_BIDI_TYPE_ON;
}
}
diff --git a/pango/pango-bidi-type.h b/pango/pango-bidi-type.h
index 2f1dfd1d..a1fd0c69 100644
--- a/pango/pango-bidi-type.h
+++ b/pango/pango-bidi-type.h
@@ -51,6 +51,10 @@ G_BEGIN_DECLS
* @PANGO_BIDI_TYPE_S: Segment Separator
* @PANGO_BIDI_TYPE_WS: Whitespace
* @PANGO_BIDI_TYPE_ON: Other Neutrals
+ * @PANGO_BIDI_TYPE_LRI: Left-to-Right isolate. Since 1.48.6
+ * @PANGO_BIDI_TYPE_RLI: Right-to-Left isolate. Since 1.48.6
+ * @PANGO_BIDI_TYPE_FSI: First strong isolate. Since 1.48.6
+ * @PANGO_BIDI_TYPE_PDI: Pop directional isolate. Since 1.48.6
*
* `PangoBidiType` represents the bidirectional character
* type of a Unicode character as specified by the
@@ -83,7 +87,13 @@ typedef enum {
PANGO_BIDI_TYPE_B,
PANGO_BIDI_TYPE_S,
PANGO_BIDI_TYPE_WS,
- PANGO_BIDI_TYPE_ON
+ PANGO_BIDI_TYPE_ON,
+
+ /* Explicit formatting */
+ PANGO_BIDI_TYPE_LRI,
+ PANGO_BIDI_TYPE_RLI,
+ PANGO_BIDI_TYPE_FSI,
+ PANGO_BIDI_TYPE_PDI
} PangoBidiType;
PANGO_DEPRECATED_IN_1_44
diff --git a/pango/pango-markup.c b/pango/pango-markup.c
index 258ca717..38e908c5 100644
--- a/pango/pango-markup.c
+++ b/pango/pango-markup.c
@@ -584,17 +584,10 @@ pango_markup_parser_new_internal (char accel_marker,
0, md,
(GDestroyNotify)destroy_markup_data);
- if (!g_markup_parse_context_parse (context,
- "<markup>",
- -1,
- error))
- goto error;
+ if (!g_markup_parse_context_parse (context, "<markup>", -1, error))
+ g_clear_pointer (&context, g_markup_parse_context_free);
return context;
-
- error:
- g_markup_parse_context_free (context);
- return NULL;
}
/**
@@ -654,8 +647,6 @@ pango_parse_markup (const char *markup_text,
context = pango_markup_parser_new_internal (accel_marker,
error,
(attr_list != NULL));
- if (context == NULL)
- goto out;
if (!g_markup_parse_context_parse (context,
markup_text,
@@ -711,16 +702,9 @@ pango_parse_markup (const char *markup_text,
* Since: 1.31.0
**/
GMarkupParseContext *
-pango_markup_parser_new (gunichar accel_marker)
+pango_markup_parser_new (gunichar accel_marker)
{
- GError *error = NULL;
- GMarkupParseContext *context;
- context = pango_markup_parser_new_internal (accel_marker, &error, TRUE);
-
- if (context == NULL)
- g_critical ("Had error when making markup parser: %s\n", error->message);
-
- return context;
+ return pango_markup_parser_new_internal (accel_marker, NULL, TRUE);
}
/**
@@ -1245,11 +1229,16 @@ span_parse_func (MarkupData *md G_GNUC_UNUSED,
CHECK_ATTRIBUTE (underline);
CHECK_ATTRIBUTE (underline_color);
break;
- default:
+ case 'r':
CHECK_ATTRIBUTE (rise);
+ break;
+ case 'v':
CHECK_ATTRIBUTE (variant);
+ break;
+ case 'w':
CHECK_ATTRIBUTE (weight);
break;
+ default:;
}
if (!found)
@@ -1657,6 +1646,7 @@ markup_parse_func (MarkupData *md G_GNUC_UNUSED,
GError **error G_GNUC_UNUSED)
{
/* We don't do anything with this tag at the moment. */
+ CHECK_NO_ATTRS("markup");
return TRUE;
}
diff --git a/pango/pango-matrix.c b/pango/pango-matrix.c
index 666fe55a..a066eb57 100644
--- a/pango/pango-matrix.c
+++ b/pango/pango-matrix.c
@@ -461,17 +461,18 @@ pango_matrix_transform_pixel_rectangle (const PangoMatrix *matrix,
min_x = max_x = quad_x[0];
min_y = max_y = quad_y[0];
- for (i=1; i < 4; i++) {
+ for (i=1; i < 4; i++)
+ {
if (quad_x[i] < min_x)
- min_x = quad_x[i];
+ min_x = quad_x[i];
else if (quad_x[i] > max_x)
- max_x = quad_x[i];
+ max_x = quad_x[i];
if (quad_y[i] < min_y)
- min_y = quad_y[i];
+ min_y = quad_y[i];
else if (quad_y[i] > max_y)
- max_y = quad_y[i];
- }
+ max_y = quad_y[i];
+ }
rect->x = floor (min_x);
rect->y = floor (min_y);
diff --git a/pango/pango-tabs.c b/pango/pango-tabs.c
index 0792cd5a..28027454 100644
--- a/pango/pango-tabs.c
+++ b/pango/pango-tabs.c
@@ -113,7 +113,7 @@ pango_tab_array_new (gint initial_size,
* @first_position: position of first tab stop
* @...: additional alignment/position pairs
*
- * Creates * a `PangoTabArray` and allows you to specify the alignment
+ * Creates a `PangoTabArray` and allows you to specify the alignment
* and position of each tab stop.
*
* You **must** provide an alignment and position for @size tab stops.
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 0057859e..c90b4c86 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -127,6 +127,8 @@ pango_version_check (int required_major,
gint pango_effective_micro = 100 * PANGO_VERSION_MINOR + PANGO_VERSION_MICRO;
gint required_effective_micro = 100 * required_minor + required_micro;
+ if (required_major > PANGO_VERSION_MAJOR)
+ return "Pango version too old (major mismatch)";
if (required_major < PANGO_VERSION_MAJOR)
return "Pango version too new (major mismatch)";
if (required_effective_micro < pango_effective_micro - PANGO_BINARY_AGE)