summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS14
-rw-r--r--meson.build19
-rw-r--r--meson_options.txt4
-rw-r--r--pango/fonts.c2
-rw-r--r--pango/meson.build1
-rw-r--r--pango/pango-attributes.c4
-rw-r--r--pango/pango-layout.c3
-rw-r--r--pango/pango-renderer.c23
-rw-r--r--pango/pango-renderer.h1
-rw-r--r--pango/pango-trace-private.h53
-rw-r--r--pango/pango-trace.c40
-rw-r--r--pango/pangocairo-fcfontmap.c2
-rw-r--r--pango/pangofc-fontmap.c24
-rw-r--r--pango/pangowin32.c2
-rw-r--r--subprojects/freetype2.wrap2
-rw-r--r--subprojects/fribidi.wrap1
-rw-r--r--subprojects/glib.wrap1
-rw-r--r--subprojects/harfbuzz.wrap1
-rw-r--r--subprojects/sysprof.wrap5
-rw-r--r--tests/test-break.c23
20 files changed, 195 insertions, 30 deletions
diff --git a/NEWS b/NEWS
index 6ae47d0b..525aec14 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,17 @@
+Overview of changes in 1.46.1
+=============================
+- Revert an unintentional PangoRenderer abi break in 1.46.0
+- Various small fixes
+
+Overview of changes in 1.46.0
+=============================
+- Bump version to 1.46
+
+Overview of changes in 1.45.5
+=============================
+- Export pango_color_parse_with_alpha
+- Stop using hb-glib
+
Overview of changes in 1.45.4
=============================
- Fix build on Windows
diff --git a/meson.build b/meson.build
index 57704c6e..9708f826 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('pango', 'c', 'cpp',
- version: '1.45.5',
+ version: '1.46.1',
license: 'LGPLv2.1+',
default_options: [
'buildtype=debugoptimized',
@@ -538,6 +538,23 @@ if cairo_dep.found()
endif
endif
+# libsysprof-capture support
+libsysprof_capture_dep = dependency('sysprof-capture-4',
+ required: get_option('sysprof'),
+ default_options: [
+ 'enable_examples=false',
+ 'enable_gtk=false',
+ 'enable_tests=false',
+ 'enable_tools=false',
+ 'libsysprof=false',
+ 'with_sysprofd=none',
+ 'help=false',
+ ],
+ fallback: ['sysprof', 'libsysprof_capture_dep'],
+)
+pango_conf.set('HAVE_SYSPROF', libsysprof_capture_dep.found())
+pango_deps += libsysprof_capture_dep
+
gnome = import('gnome')
pkgconfig = import('pkgconfig')
diff --git a/meson_options.txt b/meson_options.txt
index 7a59fa2b..b0395b5e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -14,3 +14,7 @@ option('use_fontconfig',
description : 'Force using FontConfig where it is optional, on Windows and macOS. This is ignored on platforms where it is required',
type: 'boolean',
value: 'false')
+option('sysprof',
+ type : 'feature',
+ value : 'disabled',
+ description : 'include tracing support for sysprof')
diff --git a/pango/fonts.c b/pango/fonts.c
index e83abbbe..1695366b 100644
--- a/pango/fonts.c
+++ b/pango/fonts.c
@@ -1799,7 +1799,7 @@ pango_font_get_glyph_extents (PangoFont *font,
}
if (logical_rect)
{
- logical_rect->x = logical_rect->y = 0;
+ logical_rect->x = 0;
logical_rect->y = - PANGO_UNKNOWN_GLYPH_HEIGHT * PANGO_SCALE;
logical_rect->height = PANGO_UNKNOWN_GLYPH_HEIGHT * PANGO_SCALE;
logical_rect->width = PANGO_UNKNOWN_GLYPH_WIDTH * PANGO_SCALE;
diff --git a/pango/meson.build b/pango/meson.build
index 11578ddf..4c055f52 100644
--- a/pango/meson.build
+++ b/pango/meson.build
@@ -177,6 +177,7 @@ if build_pangoft2
'pangofc-font.c',
'pangofc-fontmap.c',
'pangofc-decoder.c',
+ 'pango-trace.c',
]
pangoot_headers = [
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index 5f844639..12942043 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -1253,7 +1253,7 @@ pango_attr_show_new (PangoShowFlags flags)
* Return value: (transfer full): the newly allocated #PangoAttribute,
* which should be freed with pango_attribute_destroy().
*
- * Since: 1.45
+ * Since: 1.46
**/
PangoAttribute *
pango_attr_overline_new (PangoOverline overline)
@@ -1281,7 +1281,7 @@ pango_attr_overline_new (PangoOverline overline)
* Return value: (transfer full): the newly allocated #PangoAttribute,
* which should be freed with pango_attribute_destroy().
*
- * Since: 1.45
+ * Since: 1.46
**/
PangoAttribute *
pango_attr_overline_color_new (guint16 red,
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 92d858b2..7d5b9b10 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3609,6 +3609,9 @@ find_hyphen_width (PangoItem *item)
hb_font_t *hb_font;
hb_codepoint_t glyph;
+ if (!item->analysis.font)
+ return 0;
+
/* This is not technically correct, since
* a) we may end up inserting a different hyphen
* b) we should reshape the entire run
diff --git a/pango/pango-renderer.c b/pango/pango-renderer.c
index 07f81a88..432875a4 100644
--- a/pango/pango-renderer.c
+++ b/pango/pango-renderer.c
@@ -62,6 +62,7 @@ struct _PangoRendererPrivate
PangoLayoutLine *line;
LineState *line_state;
+ PangoOverline overline;
};
static void pango_renderer_finalize (GObject *gobject);
@@ -319,7 +320,7 @@ handle_line_state_change (PangoRenderer *renderer,
rect->width = state->logical_rect_end - rect->x;
draw_overline (renderer, state);
- state->overline = renderer->overline;
+ state->overline = renderer->priv->overline;
rect->x = state->logical_rect_end;
rect->width = 0;
}
@@ -418,14 +419,14 @@ add_overline (PangoRenderer *renderer,
new_rect.height = underline_thickness;
new_rect.y = base_y;
- switch (renderer->overline)
+ switch (renderer->priv->overline)
{
case PANGO_OVERLINE_NONE:
g_assert_not_reached ();
break;
case PANGO_OVERLINE_SINGLE:
new_rect.y -= ascent;
- if (state->overline == renderer->overline)
+ if (state->overline == renderer->priv->overline)
{
new_rect.y = MIN (current_rect->y, new_rect.y);
new_rect.height = MAX (current_rect->height, new_rect.height);
@@ -435,7 +436,7 @@ add_overline (PangoRenderer *renderer,
break;
}
- if (renderer->overline == state->overline &&
+ if (renderer->priv->overline == state->overline &&
new_rect.y == current_rect->y &&
new_rect.height == current_rect->height)
{
@@ -446,7 +447,7 @@ add_overline (PangoRenderer *renderer,
draw_overline (renderer, state);
*current_rect = new_rect;
- state->overline = renderer->overline;
+ state->overline = renderer->priv->overline;
}
}
@@ -626,7 +627,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer,
else
{
if (renderer->underline != PANGO_UNDERLINE_NONE ||
- renderer->overline != PANGO_OVERLINE_NONE ||
+ renderer->priv->overline != PANGO_OVERLINE_NONE ||
renderer->strikethrough)
{
ink = &ink_rect;
@@ -684,7 +685,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer,
}
if (renderer->underline != PANGO_UNDERLINE_NONE ||
- renderer->overline != PANGO_OVERLINE_NONE ||
+ renderer->priv->overline != PANGO_OVERLINE_NONE ||
renderer->strikethrough)
{
metrics = pango_font_get_metrics (run->item->analysis.font,
@@ -695,7 +696,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer,
x + x_off, y - rise,
ink, logical);
- if (renderer->overline != PANGO_OVERLINE_NONE)
+ if (renderer->priv->overline != PANGO_OVERLINE_NONE)
add_overline (renderer, &state,metrics,
x + x_off, y - rise,
ink, logical);
@@ -712,7 +713,7 @@ pango_renderer_draw_layout_line (PangoRenderer *renderer,
state.underline != PANGO_UNDERLINE_NONE)
draw_underline (renderer, &state);
- if (renderer->overline == PANGO_OVERLINE_NONE &&
+ if (renderer->priv->overline == PANGO_OVERLINE_NONE &&
state.overline != PANGO_OVERLINE_NONE)
draw_overline (renderer, &state);
@@ -1449,7 +1450,7 @@ pango_renderer_default_prepare_run (PangoRenderer *renderer,
GSList *l;
renderer->underline = PANGO_UNDERLINE_NONE;
- renderer->overline = PANGO_OVERLINE_NONE;
+ renderer->priv->overline = PANGO_OVERLINE_NONE;
renderer->strikethrough = FALSE;
for (l = run->item->analysis.extra_attrs; l; l = l->next)
@@ -1463,7 +1464,7 @@ pango_renderer_default_prepare_run (PangoRenderer *renderer,
break;
case PANGO_ATTR_OVERLINE:
- renderer->overline = ((PangoAttrInt *)attr)->value;
+ renderer->priv->overline = ((PangoAttrInt *)attr)->value;
break;
case PANGO_ATTR_STRIKETHROUGH:
diff --git a/pango/pango-renderer.h b/pango/pango-renderer.h
index 4dae6a92..89107fd1 100644
--- a/pango/pango-renderer.h
+++ b/pango/pango-renderer.h
@@ -77,7 +77,6 @@ struct _PangoRenderer
GObject parent_instance;
PangoUnderline underline;
- PangoOverline overline;
gboolean strikethrough;
int active_count;
diff --git a/pango/pango-trace-private.h b/pango/pango-trace-private.h
new file mode 100644
index 00000000..5d2a4fdf
--- /dev/null
+++ b/pango/pango-trace-private.h
@@ -0,0 +1,53 @@
+/* Pango
+ * pango-trace-private.h:
+ *
+ * Copyright (C) 2020 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+
+#ifdef HAVE_SYSPROF
+#include <sysprof-capture.h>
+#endif
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#ifdef HAVE_SYSPROF
+#define PANGO_TRACE_CURRENT_TIME SYSPROF_CAPTURE_CURRENT_TIME
+#else
+#define PANGO_TRACE_CURRENT_TIME 0
+#endif
+
+void pango_trace_mark (gint64 begin_time,
+ const gchar *name,
+ const gchar *message_format,
+ ...) G_GNUC_PRINTF (3, 4);
+
+#ifndef HAVE_SYSPROF
+/* Optimise the whole call out */
+#if defined(G_HAVE_ISO_VARARGS)
+#define g_trace_mark(b, n, m, ...)
+#elif defined(G_HAVE_GNUC_VARARGS)
+#define g_trace_mark(b, n, m...)
+#else
+/* no varargs macro support; the call will have to be optimised out by the compiler */
+#endif
+#endif
+
+G_END_DECLS
diff --git a/pango/pango-trace.c b/pango/pango-trace.c
new file mode 100644
index 00000000..9f37376d
--- /dev/null
+++ b/pango/pango-trace.c
@@ -0,0 +1,40 @@
+/* Pango
+ * pango-trace.c:
+ *
+ * Copyright (C) 2020 Red Hat, Inc
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include "pango-trace-private.h"
+
+#include <stdarg.h>
+
+void
+(pango_trace_mark) (gint64 begin_time,
+ const gchar *name,
+ const gchar *message_format,
+ ...)
+{
+#ifdef HAVE_SYSPROF
+ gint64 end_time = PANGO_TRACE_CURRENT_TIME;
+ va_list args;
+
+ va_start (args, message_format);
+ sysprof_collector_mark_vprintf (begin_time, end_time - begin_time, "Pango", name, message_format, args);
+ va_end (args);
+#endif /* HAVE_SYSPROF */
+}
diff --git a/pango/pangocairo-fcfontmap.c b/pango/pangocairo-fcfontmap.c
index bd3a8583..015b8170 100644
--- a/pango/pangocairo-fcfontmap.c
+++ b/pango/pangocairo-fcfontmap.c
@@ -103,7 +103,7 @@ pango_cairo_fc_font_map_fontset_key_substitute (PangoFcFontMap *fcfontmap G_G
PangoFcFontsetKey *fontkey,
FcPattern *pattern)
{
- FcConfigSubstitute (NULL, pattern, FcMatchPattern);
+ FcConfigSubstitute (pango_fc_font_map_get_config (fcfontmap), pattern, FcMatchPattern);
if (fontkey)
cairo_ft_font_options_substitute (pango_fc_fontset_key_get_context_key (fontkey),
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index ec504094..4c2aa094 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -848,7 +848,10 @@ filter_fontset_by_format (FcFontSet *fontset)
for (i = 0; i < fontset->nfont; i++)
{
if (pango_fc_is_supported_font_format (fontset->fonts[i]))
- FcFontSetAdd (result, FcPatternDuplicate (fontset->fonts[i]));
+ {
+ FcPatternReference (fontset->fonts[i]);
+ FcFontSetAdd (result, fontset->fonts[i]);
+ }
}
return result;
@@ -873,16 +876,21 @@ pango_fc_patterns_get_font_pattern (PangoFcPatterns *pats, int i, gboolean *prep
if (!pats->fontset)
{
FcResult result;
- FcFontSet *fontset;
- FcFontSet *filtered;
+ FcFontSet *filtered[2] = { NULL, };
+ int i, n = 0;
- fontset = FcFontSort (pats->fontmap->priv->config, pats->pattern, FcFalse, NULL, &result);
- filtered = filter_fontset_by_format (fontset);
- FcFontSetDestroy (fontset);
+ for (i = 0; i < 2; i++)
+ {
+ FcFontSet *fonts = FcConfigGetFonts (pats->fontmap->priv->config, i);
+ if (fonts)
+ filtered[n++] = filter_fontset_by_format (fonts);
+ }
+
+ pats->fontset = FcFontSetSort (pats->fontmap->priv->config, filtered, n, pats->pattern, FcTrue, NULL, &result);
- pats->fontset = FcFontSetSort (pats->fontmap->priv->config, &filtered, 1, pats->pattern, FcTrue, NULL, &result);
+ for (i = 0; i < n; i++)
+ FcFontSetDestroy (filtered[i]);
- FcFontSetDestroy (filtered);
if (pats->match)
{
diff --git a/pango/pangowin32.c b/pango/pangowin32.c
index 8849d4af..213a665e 100644
--- a/pango/pangowin32.c
+++ b/pango/pangowin32.c
@@ -269,7 +269,7 @@ pango_win32_render (HDC hdc,
dX = g_new (INT, glyphs->num_glyphs);
/* Render glyphs using one ExtTextOutW() call for each run of glyphs
- * that have the same y offset. The big majoroty of glyphs will have
+ * that have the same y offset. The big majority of glyphs will have
* y offset of zero, so in general, the whole glyph string will be
* rendered by one call to ExtTextOutW().
*
diff --git a/subprojects/freetype2.wrap b/subprojects/freetype2.wrap
index 613f7d62..21ed35ce 100644
--- a/subprojects/freetype2.wrap
+++ b/subprojects/freetype2.wrap
@@ -8,3 +8,5 @@ source_hash = ec391504e55498adceb30baceebd147a6e963f636eb617424bcfc47a169898ce
patch_url = https://wrapdb.mesonbuild.com/v1/projects/freetype2/2.9.1/1/get_zip
patch_filename = freetype2-2.9.1-1-wrap.zip
patch_hash = 06222607775e707c6d7b8d21ffdb04c7672f676a18c5ebb9880545130ab0407b
+
+depth=1
diff --git a/subprojects/fribidi.wrap b/subprojects/fribidi.wrap
index 8d4e4bf4..0132d4ec 100644
--- a/subprojects/fribidi.wrap
+++ b/subprojects/fribidi.wrap
@@ -3,3 +3,4 @@ directory=fribidi
url=https://github.com/fribidi/fribidi.git
push-url=git@github.com:fribidi/fribidi.git
revision=master
+depth=1
diff --git a/subprojects/glib.wrap b/subprojects/glib.wrap
index 76aa0a02..e2e44d56 100644
--- a/subprojects/glib.wrap
+++ b/subprojects/glib.wrap
@@ -3,3 +3,4 @@ directory=glib
url=https://gitlab.gnome.org/GNOME/glib.git
push-url=ssh://git@gitlab.gnome.org:GNOME/glib.git
revision=master
+depth=1
diff --git a/subprojects/harfbuzz.wrap b/subprojects/harfbuzz.wrap
index e739b5e7..6fdcb633 100644
--- a/subprojects/harfbuzz.wrap
+++ b/subprojects/harfbuzz.wrap
@@ -3,3 +3,4 @@ directory=harfbuzz
url=https://github.com/harfbuzz/harfbuzz.git
push-url=git@github.com:harfbuzz/harfbuzz.git
revision=master
+depth=1
diff --git a/subprojects/sysprof.wrap b/subprojects/sysprof.wrap
new file mode 100644
index 00000000..fb669463
--- /dev/null
+++ b/subprojects/sysprof.wrap
@@ -0,0 +1,5 @@
+[wrap-git]
+directory=sysprof
+url=https://gitlab.gnome.org/GNOME/sysprof.git
+revision=6b1cd7a722fcebae1ac392562c47957477ade8bf
+depth=1
diff --git a/tests/test-break.c b/tests/test-break.c
index 6f4019e1..db944fbb 100644
--- a/tests/test-break.c
+++ b/tests/test-break.c
@@ -318,11 +318,26 @@ main (int argc, char *argv[])
/* allow to easily generate expected output for new test cases */
if (argc > 1)
{
- GString *string;
+ if (strcmp (argv[1], "--help") == 0)
+ {
+ g_print ("test-break uses the following symbols for log attrs\n\n");
+ g_print ("Breaks: Words:\n"
+ " L - mandatory break b - word boundary\n"
+ " l - line break s - word start\n"
+ " c - char break e - word end\n"
+ "\n"
+ "Whitespace: Sentences:\n"
+ " x - expandable space s - sentence start\n"
+ " w - whitespace e - sentence end\n");
+ }
+ else
+ {
+ GString *string;
- string = g_string_sized_new (0);
- test_file (argv[1], string);
- g_test_message ("%s", string->str);
+ string = g_string_sized_new (0);
+ test_file (argv[1], string);
+ g_print ("%s", string->str);
+ }
return 0;
}