commit pango for openSUSE:Factory
Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package pango for openSUSE:Factory checked in at 2021-05-23 23:30:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pango (Old) and /work/SRC/openSUSE:Factory/.pango.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "pango" Sun May 23 23:30:34 2021 rev:130 rq:894779 version:1.48.5 Changes: -------- --- /work/SRC/openSUSE:Factory/pango/pango.changes 2021-04-24 23:06:55.995206459 +0200 +++ /work/SRC/openSUSE:Factory/.pango.new.2988/pango.changes 2021-05-23 23:30:40.100721441 +0200 @@ -1,0 +2,14 @@ +Tue May 18 16:16:14 UTC 2021 - Michael Gorse <mgorse@suse.com> + +- Update to version 1.48.5: + + Only initialize fontconfig once. + + Add missing deprecation notices. + + Add some missing apis to the markup docs. + + Speed up Emoji classification. + + Fix hangs and memory leaks. + + Don't insert hyphens at word boundaries. + + Handle empty lines better. + + Avoid width fluctuations with ellipsized text. + + Add a utility to show text segmentation. + +------------------------------------------------------------------- Old: ---- pango-1.48.4.obscpio New: ---- pango-1.48.5.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pango.spec ++++++ --- /var/tmp/diff_new_pack.HJejO2/_old 2021-05-23 23:30:41.092717326 +0200 +++ /var/tmp/diff_new_pack.HJejO2/_new 2021-05-23 23:30:41.096717309 +0200 @@ -17,7 +17,7 @@ Name: pango -Version: 1.48.4 +Version: 1.48.5 Release: 0 Summary: Library for Layout and Rendering of Text License: LGPL-2.1-or-later ++++++ _service ++++++ --- /var/tmp/diff_new_pack.HJejO2/_old 2021-05-23 23:30:41.128717177 +0200 +++ /var/tmp/diff_new_pack.HJejO2/_new 2021-05-23 23:30:41.128717177 +0200 @@ -2,7 +2,7 @@ <service name="obs_scm" mode="disabled"> <param name="url">https://gitlab.gnome.org/GNOME/pango.git</param> <param name="scm">git</param> - <param name="revision">refs/tags/1.48.4</param> + <param name="revision">refs/tags/1.48.5</param> <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> <param name="versionrewrite-pattern">(.*)\+0</param> <param name="versionrewrite-replacement">\1</param> ++++++ pango-1.48.4.obscpio -> pango-1.48.5.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/.gitlab-ci/run-tests.sh new/pango-1.48.5/.gitlab-ci/run-tests.sh --- old/pango-1.48.4/.gitlab-ci/run-tests.sh 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/.gitlab-ci/run-tests.sh 2021-05-18 15:51:55.000000000 +0200 @@ -7,7 +7,7 @@ builddir=$1 # Ignore memory leaks lower in dependencies -export LSAN_OPTIONS=fast_unwind_on_malloc=0:suppressions=$srcdir/lsan.supp:print_suppressions=0 +export LSAN_OPTIONS=suppressions=$srcdir/lsan.supp:print_suppressions=0 # Check leaks of slices export G_SLICE=always-malloc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/NEWS new/pango-1.48.5/NEWS --- old/pango-1.48.4/NEWS 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/NEWS 2021-05-18 15:51:55.000000000 +0200 @@ -1,3 +1,16 @@ +Overview of changes in 1.48.5 +============================= +- Only initialize fontconfig once +- Add missing deprecation notices +- Add some missing apis to the markup docs +- Speed up Emoji classification +- win32: Fix msvc build +- Fix hangs and memory leaks +- Don't insert hyphens at word boundaries +- Handle empty lines better +- Avoid width fluctuations with ellipsized text +- Add a utility to show text segmentation + Overview of changes in 1.48.4 ============================= - Include docs in the dist tarball diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/docs/pango_markup.md new/pango-1.48.5/docs/pango_markup.md --- old/pango-1.48.4/docs/pango_markup.md 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/docs/pango_markup.md 2021-05-18 15:51:55.000000000 +0200 @@ -136,6 +136,13 @@ : The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'. +overline +: One of 'none' or 'single'. Overline support was added in Pango 1.46/ + +overline_color +: The color of overlines; an RGB color specification such as '#00FF00' or a color + name such as 'red'. Overline support was added in Pango 1.46/ + rise : Vertical displacement, in Pango units. Can be negative for subscript, positive for superscript. @@ -165,6 +172,19 @@ gravity_hint : One of 'natural', 'strong', 'line'. +show +: Specifies what special characters to show visibly. The value can be 'none' + or a combination of 'spaces', 'line-breaks' and 'ignorables', combined with '|'. + Support for showing special characters was added in Pango 1.44. + +insert_hyphens +: 'true' or 'false' to indicate whether hyphens should be inserted when breaking + lines in the middle of words. Available since Pango 1.44. + +allow_breaks +: 'true' or 'false' to indicate whether breaking lines is allowed. Available + since Pango 1.44. + ## Convenience Tags `<b>` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/make-release.sh new/pango-1.48.5/make-release.sh --- old/pango-1.48.4/make-release.sh 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/make-release.sh 2021-05-18 15:51:55.000000000 +0200 @@ -9,6 +9,9 @@ exit 1 fi +# make sure included subprojects are current +meson subprojects update gi-docgen + # make the release tarball meson setup -Dgtk_doc=true --force-fallback-for gi-docgen ${release_build_dir} || exit meson compile -C${release_build_dir} || exit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/meson.build new/pango-1.48.5/meson.build --- old/pango-1.48.4/meson.build 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/meson.build 2021-05-18 15:51:55.000000000 +0200 @@ -1,5 +1,5 @@ project('pango', 'c', 'cpp', - version: '1.48.4', + version: '1.48.5', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/break.c new/pango-1.48.5/pango/break.c --- old/pango-1.48.4/pango/break.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/break.c 2021-05-18 15:51:55.000000000 +0200 @@ -306,7 +306,6 @@ /* Emoji extended pictographics */ gboolean is_Extended_Pictographic; - wc = next_wc; break_type = next_break_type; @@ -362,12 +361,15 @@ case G_UNICODE_PARAGRAPH_SEPARATOR: attrs[i].is_white = TRUE; break; - default: + case G_UNICODE_CONTROL: if (wc == '\t' || wc == '\n' || wc == '\r' || wc == '\f') attrs[i].is_white = TRUE; else attrs[i].is_white = FALSE; break; + default: + attrs[i].is_white = FALSE; + break; } /* Just few spaces have variable width. So explicitly mark them. @@ -502,9 +504,7 @@ else if (GB_type == GB_InHangulSyllable) is_grapheme_boundary = FALSE; /* Rules GB6, GB7, GB8 */ else if (GB_type == GB_Extend) - { - is_grapheme_boundary = FALSE; /* Rule GB9 */ - } + is_grapheme_boundary = FALSE; /* Rule GB9 */ else if (GB_type == GB_ZWJ) is_grapheme_boundary = FALSE; /* Rule GB9 */ else if (GB_type == GB_SpacingMark) @@ -641,14 +641,12 @@ if (wc >= 0x24B6 && wc <= 0x24E9) /* Other_Alphabetic */ goto Alphabetic; - if (G_UNLIKELY(wc >=0x1F1E6 && wc <=0x1F1FF)) + if (G_UNLIKELY(wc >= 0x1F1E6 && wc <= 0x1F1FF)) { - if (prev_WB_type == WB_RI_Odd) - WB_type = WB_RI_Even; - else if (prev_WB_type == WB_RI_Even) - WB_type = WB_RI_Odd; - else - WB_type = WB_RI_Odd; + if (prev_WB_type == WB_RI_Odd) + WB_type = WB_RI_Even; + else + WB_type = WB_RI_Odd; } break; @@ -933,7 +931,20 @@ prev_prev_SB_type == SB_ATerm_Close_Sp) && IS_OTHER_TERM(prev_SB_type) && SB_type == SB_Lower) - attrs[prev_SB_i].is_sentence_boundary = FALSE; + { + attrs[prev_SB_i].is_sentence_boundary = FALSE; + attrs[prev_SB_i].is_sentence_start = FALSE; + attrs[prev_SB_i].is_sentence_end = FALSE; + last_sentence_start = -1; + for (int j = prev_SB_i - 1; j >= 0; j--) + { + if (attrs[j].is_sentence_boundary) + { + last_sentence_start = j; + break; + } + } + } else if ((prev_SB_type == SB_ATerm || prev_SB_type == SB_ATerm_Close_Sp || prev_SB_type == SB_STerm || @@ -1538,8 +1549,9 @@ /* meets space character, move sentence start */ if (last_sentence_start != -1 && last_sentence_start == i - 1 && - attrs[i - 1].is_white) + attrs[i - 1].is_white) { last_sentence_start++; + } } @@ -1563,7 +1575,6 @@ attrs[i].is_line_break = TRUE; /* Rule LB3 */ attrs[0].is_line_break = FALSE; /* Rule LB2 */ - } static gboolean diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/ellipsize.c new/pango-1.48.5/pango/ellipsize.c --- old/pango-1.48.4/pango/ellipsize.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/ellipsize.c 2021-05-18 15:51:55.000000000 +0200 @@ -634,7 +634,8 @@ * of the gap */ static void -fixup_ellipsis_run (EllipsizeState *state) +fixup_ellipsis_run (EllipsizeState *state, + int extra_width) { PangoGlyphString *glyphs = state->ellipsis_run->glyphs; PangoItem *item = state->ellipsis_run->item; @@ -650,6 +651,8 @@ glyphs->glyphs[0].attr.is_cluster_start = TRUE; + glyphs->glyphs[glyphs->num_glyphs - 1].geometry.width += extra_width; + /* Fix up the item to point to the entire elided text */ item->offset = state->gap_start_iter.run_iter.start_index; item->length = state->gap_end_iter.run_iter.end_index - item->offset; @@ -765,7 +768,7 @@ break; } - fixup_ellipsis_run (&state); + fixup_ellipsis_run (&state, MAX (goal_width - current_width (&state), 0)); g_slist_free (line->runs); line->runs = get_run_list (&state); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-attributes.h new/pango-1.48.5/pango/pango-attributes.h --- old/pango-1.48.4/pango/pango-attributes.h 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-attributes.h 2021-05-18 15:51:55.000000000 +0200 @@ -214,7 +214,10 @@ * single characters, such as for keyboard accelerators. * %PANGO_UNDERLINE_SINGLE should be used for extended * portions of text. - * @PANGO_UNDERLINE_ERROR: a wavy underline should be drawn below. + * @PANGO_UNDERLINE_ERROR: an underline indicating an error should + * be drawn below. The exact style of rendering is up to the + * `PangoRenderer` in use, but typical styles include wavy + * or dotted lines. * This underline is typically used to indicate an error such * as a possible mispelling; in some cases a contrasting color * may automatically be used. This type of underlining is diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-bidi-type.c new/pango-1.48.5/pango/pango-bidi-type.c --- old/pango-1.48.4/pango/pango-bidi-type.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-bidi-type.c 2021-05-18 15:51:55.000000000 +0200 @@ -273,8 +273,8 @@ * * This function is useful to categorize characters into left-to-right * letters, right-to-left letters, and everything else. If full Unicode - * bidirectional type of a character is needed, [type_func@Pango.BidiType.for_unichar] - * can be used instead. + * bidirectional type of a character is needed, + * [type_func@Pango.BidiType.for_unichar] can be used instead. * * Return value: the direction of the character. */ @@ -305,12 +305,12 @@ * * Mirror characters are determined by the Unicode mirrored property. * - * Use g_unichar_get_mirror_char() instead; the docs for that function - * provide full details. - * * Return value: %TRUE if @ch has a mirrored character and @mirrored_ch is * filled in, %FALSE otherwise - **/ + * + * Deprecated: Use g_unichar_get_mirror_char() instead; the docs for that function + * provide full details. + */ gboolean pango_get_mirror_char (gunichar ch, gunichar *mirrored_ch) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-break.h new/pango-1.48.5/pango/pango-break.h --- old/pango-1.48.4/pango/pango-break.h 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-break.h 2021-05-18 15:51:55.000000000 +0200 @@ -51,7 +51,7 @@ * so all chars are in some sentence; @is_sentence_boundary denotes * the boundaries there. The second way doesn't assign * between-sentence spaces, etc. to any sentence, so - * @is_sentence_start/@is_sentence_end mark the boundaries of those sentences. + * @is_sentence_start/@is_sentence_end mark the boundaries of those sentences. * @is_sentence_start: is first character in a sentence * @is_sentence_end: is first char after a sentence. * Note that in degenerate cases, you could have both @is_sentence_start diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-context.c new/pango-1.48.5/pango/pango-context.c --- old/pango-1.48.4/pango/pango-context.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-context.c 2021-05-18 15:51:55.000000000 +0200 @@ -910,6 +910,9 @@ int st = 0; int ed = max; + if (ch < upright[0][0]) + return FALSE; + while (st <= ed) { int mid = (st + ed) / 2; @@ -926,7 +929,7 @@ } static void -width_iter_next(PangoWidthIter* iter) +width_iter_next (PangoWidthIter *iter) { gboolean met_joiner = FALSE; iter->start = iter->end; @@ -958,9 +961,9 @@ } /* for variation selector, tag and emoji modifier. */ - if (G_UNLIKELY(ch == 0xFE0EU || ch == 0xFE0FU - || (ch >= 0xE0020 && ch <= 0xE007F) - || (ch >= 0x1F3FB && ch <= 0x1F3FF))) + if (G_UNLIKELY (ch == 0xFE0EU || ch == 0xFE0FU || + (ch >= 0xE0020 && ch <= 0xE007F) || + (ch >= 0x1F3FB && ch <= 0x1F3FF))) { iter->end = g_utf8_next_char (iter->end); continue; @@ -968,6 +971,7 @@ if (width_iter_is_upright (ch) != iter->upright) break; + iter->end = g_utf8_next_char (iter->end); } } @@ -1000,7 +1004,6 @@ PangoAttrIterator *cached_iter, const PangoFontDescription *desc) { - state->context = context; state->text = text; state->end = text + start_index + length; @@ -1410,10 +1413,10 @@ { gboolean is_emoji = state->emoji_iter.is_emoji; if (is_emoji && !state->emoji_font_desc) - { - state->emoji_font_desc = pango_font_description_copy_static (state->font_desc); - pango_font_description_set_family_static (state->emoji_font_desc, "emoji"); - } + { + state->emoji_font_desc = pango_font_description_copy_static (state->font_desc); + pango_font_description_set_family_static (state->emoji_font_desc, "emoji"); + } state->current_fonts = pango_font_map_load_fontset (state->context->font_map, state->context, is_emoji ? state->emoji_font_desc : state->font_desc, @@ -1576,7 +1579,7 @@ g_return_val_if_fail (length >= 0, NULL); g_return_val_if_fail (length == 0 || text != NULL, NULL); - if (length == 0 || g_utf8_strlen (text + start_index, length) == 0) + if (length == 0 || g_utf8_get_char (text + start_index) == '\0') return NULL; itemize_state_init (&state, context, text, base_dir, start_index, length, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-emoji.c new/pango-1.48.5/pango/pango-emoji.c --- old/pango-1.48.4/pango/pango-emoji.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-emoji.c 2021-05-18 15:51:55.000000000 +0200 @@ -52,40 +52,37 @@ #include "pango-emoji-private.h" #include "pango-emoji-table.h" +static inline gboolean +bsearch_interval (gunichar c, + const struct Interval table[], + guint n) +{ + guint lower = 0; + guint upper = n - 1; + + while (lower <= upper) + { + int mid = (lower + upper) / 2; + + if (c < table[mid].start) + upper = mid - 1; + else if (c > table[mid].end) + lower = mid + 1; + else + return TRUE; + } -static int -interval_compare (const void *key, const void *elt) -{ - gunichar c = GPOINTER_TO_UINT (key); - struct Interval *interval = (struct Interval *)elt; - - if (c < interval->start) - return -1; - if (c > interval->end) - return +1; - - return 0; + return FALSE; } #define DEFINE_pango_Is_(name) \ -static gboolean \ +static inline gboolean \ _pango_Is_##name (gunichar ch) \ { \ - /* bsearch() is declared attribute(nonnull(1)) so we can't validly search \ - * for a NULL key */ \ - /* \ - if (G_UNLIKELY (ch == 0)) \ - return FALSE; \ - */ \ - \ - if (bsearch (GUINT_TO_POINTER (ch), \ - _pango_##name##_table, \ - G_N_ELEMENTS (_pango_##name##_table), \ - sizeof _pango_##name##_table[0], \ - interval_compare)) \ - return TRUE; \ - \ - return FALSE; \ + return ch >= _pango_##name##_table[0].start && \ + bsearch_interval (ch, \ + _pango_##name##_table, \ + G_N_ELEMENTS (_pango_##name##_table)); \ } DEFINE_pango_Is_(Emoji) @@ -106,36 +103,36 @@ return _pango_Is_Extended_Pictographic (ch); } -static gboolean +static inline gboolean _pango_Is_Emoji_Text_Default (gunichar ch) { return _pango_Is_Emoji (ch) && !_pango_Is_Emoji_Presentation (ch); } -static gboolean +static inline gboolean _pango_Is_Emoji_Emoji_Default (gunichar ch) { return _pango_Is_Emoji_Presentation (ch); } -static gboolean +static inline gboolean _pango_Is_Emoji_Keycap_Base (gunichar ch) { return (ch >= '0' && ch <= '9') || ch == '#' || ch == '*'; } -static gboolean +static inline gboolean _pango_Is_Regional_Indicator (gunichar ch) { return (ch >= 0x1F1E6 && ch <= 0x1F1FF); } -const gunichar kCombiningEnclosingCircleBackslashCharacter = 0x20E0; -const gunichar kCombiningEnclosingKeycapCharacter = 0x20E3; -const gunichar kVariationSelector15Character = 0xFE0E; -const gunichar kVariationSelector16Character = 0xFE0F; -const gunichar kZeroWidthJoinerCharacter = 0x200D; +#define kCombiningEnclosingCircleBackslashCharacter 0x20E0 +#define kCombiningEnclosingKeycapCharacter 0x20E3 +#define kVariationSelector15Character 0xFE0E +#define kVariationSelector16Character 0xFE0F +#define kZeroWidthJoinerCharacter 0x200D enum PangoEmojiScannerCategory { EMOJI = 0, @@ -157,27 +154,41 @@ kMaxEmojiScannerCategory = 16 }; -static unsigned char +static inline unsigned char _pango_EmojiSegmentationCategory (gunichar codepoint) { /* Specific ones first. */ - if (codepoint == kCombiningEnclosingKeycapCharacter) - return COMBINING_ENCLOSING_KEYCAP; - if (codepoint == kCombiningEnclosingCircleBackslashCharacter) - return COMBINING_ENCLOSING_CIRCLE_BACKSLASH; - if (codepoint == kZeroWidthJoinerCharacter) - return ZWJ; - if (codepoint == kVariationSelector15Character) - return VS15; - if (codepoint == kVariationSelector16Character) - return VS16; - if (codepoint == 0x1F3F4) - return TAG_BASE; - if ((codepoint >= 0xE0030 && codepoint <= 0xE0039) || - (codepoint >= 0xE0061 && codepoint <= 0xE007A)) + if (('a' <= codepoint && codepoint <= 'z') || + ('A' <= codepoint && codepoint <= 'Z') || + codepoint == ' ') + return kMaxEmojiScannerCategory; + + if ('0' <= codepoint && codepoint <= '9') + return KEYCAP_BASE; + + switch (codepoint) + { + case kCombiningEnclosingKeycapCharacter: + return COMBINING_ENCLOSING_KEYCAP; + case kCombiningEnclosingCircleBackslashCharacter: + return COMBINING_ENCLOSING_CIRCLE_BACKSLASH; + case kZeroWidthJoinerCharacter: + return ZWJ; + case kVariationSelector15Character: + return VS15; + case kVariationSelector16Character: + return VS16; + case 0x1F3F4: + return TAG_BASE; + case 0xE007F: + return TAG_TERM; + default: ; + } + + if ((0xE0030 <= codepoint && codepoint <= 0xE0039) || + (0xE0061 <= codepoint && codepoint <= 0xE007A)) return TAG_SEQUENCE; - if (codepoint == 0xE007F) - return TAG_TERM; + if (_pango_Is_Emoji_Modifier_Base (codepoint)) return EMOJI_MODIFIER_BASE; if (_pango_Is_Emoji_Modifier (codepoint)) @@ -186,13 +197,10 @@ return REGIONAL_INDICATOR; if (_pango_Is_Emoji_Keycap_Base (codepoint)) return KEYCAP_BASE; - if (_pango_Is_Emoji_Emoji_Default (codepoint)) return EMOJI_EMOJI_PRESENTATION; - if (_pango_Is_Emoji_Text_Default (codepoint)) - return EMOJI_TEXT_PRESENTATION; if (_pango_Is_Emoji (codepoint)) - return EMOJI; + return EMOJI_TEXT_PRESENTATION; /* Ragel state machine will interpret unknown category as "any". */ return kMaxEmojiScannerCategory; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-enum-types.c.template new/pango-1.48.5/pango/pango-enum-types.c.template --- old/pango-1.48.4/pango/pango-enum-types.c.template 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-enum-types.c.template 2021-05-18 15:51:55.000000000 +0200 @@ -13,7 +13,7 @@ GType @enum_name@_get_type (void) { - static volatile gsize g_define_type_id__volatile = 0; + static gsize g_define_type_id__volatile = 0; if (g_once_init_enter (&g_define_type_id__volatile)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-impl-utils.h new/pango-1.48.5/pango/pango-impl-utils.h --- old/pango-1.48.4/pango/pango-impl-utils.h 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-impl-utils.h 2021-05-18 15:51:55.000000000 +0200 @@ -163,6 +163,9 @@ for (i = 0; i < G_N_ELEMENTS (ignorables); i++) { + if (ch < ignorables[i].ch) + return NULL; + if (ch == ignorables[i].ch) return ignorables[i].nick; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-layout.c new/pango-1.48.5/pango/pango-layout.c --- old/pango-1.48.4/pango/pango-layout.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-layout.c 2021-05-18 15:51:55.000000000 +0200 @@ -32,7 +32,7 @@ * functionality such as line breaking, justification, alignment and * ellipsization. * - * A `PangoLayout is initialized with a `PangoContext`, UTF-8 string + * A `PangoLayout` is initialized with a `PangoContext`, UTF-8 string * and set of attributes for that string. Once that is done, the set of * formatted lines can be extracted from the object, the layout can be * rendered, and conversion between logical character positions within @@ -356,11 +356,6 @@ if (width != layout->width) { layout->width = width; - - /* Increasing the width can only decrease the line count */ - if (layout->line_count == 1 && width > layout->width) - return; - layout_changed (layout); } } @@ -3516,6 +3511,8 @@ } _pango_attr_list_get_iterator (&attrs, &iter); + prev_space = prev_hyphen = TRUE; + for (i = 0, p = text + item->offset; i < item->num_chars; i++, p = g_utf8_next_char (p)) { gunichar wc = g_utf8_get_char (p); @@ -3586,9 +3583,7 @@ else hyphen = FALSE; - if (i == 0) - need_hyphen[i] = FALSE; - else if (prev_space || space) + if (prev_space || space) need_hyphen[i] = FALSE; else if (prev_hyphen || hyphen) need_hyphen[i] = FALSE; @@ -3599,6 +3594,8 @@ prev_hyphen = hyphen; } + need_hyphen[item->num_chars - 1] = FALSE; + _pango_attr_iterator_destroy (&iter); _pango_attr_list_destroy (&attrs); } @@ -3611,6 +3608,9 @@ if (state->log_widths_offset + pos == 0) return FALSE; + if (layout->log_attrs[state->start_offset + pos].is_word_boundary) + return FALSE; + if (state->need_hyphen[state->log_widths_offset + pos - 1]) return TRUE; @@ -4984,7 +4984,7 @@ gboolean has_underline; gboolean has_overline; - if (G_UNLIKELY (!run_ink && !run_logical)) + if (G_UNLIKELY (!run_ink && !run_logical && !height)) return; pango_layout_get_item_properties (run->item, &properties); @@ -5109,7 +5109,7 @@ g_return_if_fail (LINE_IS_VALID (line)); - if (G_UNLIKELY (!ink_rect && !logical_rect)) + if (G_UNLIKELY (!ink_rect && !logical_rect && !height)) return; switch (private->cache_status) @@ -5215,8 +5215,15 @@ tmp_list = tmp_list->next; } - if (logical_rect && !line->runs) - pango_layout_line_get_empty_extents (line, logical_rect); + if (!line->runs) + { + PangoRectangle r, *rect; + + rect = logical_rect ? logical_rect : &r; + pango_layout_line_get_empty_extents (line, rect); + if (height) + *height = rect->height; + } if (caching) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pango-renderer.c new/pango-1.48.5/pango/pango-renderer.c --- old/pango-1.48.4/pango/pango-renderer.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pango-renderer.c 2021-05-18 15:51:55.000000000 +0200 @@ -157,6 +157,9 @@ * * Draws @layout with the specified `PangoRenderer`. * + * This is equivalent to drawing the lines of the layout, at their + * respective positions relative to @x, @y. + * * Since: 1.8 */ void @@ -558,6 +561,10 @@ * * Draws @line with the specified `PangoRenderer`. * + * This draws the glyph items that make up the line, as well as + * shapes, backgrounds and lines that are specified by the attributes + * of those items. + * * Since: 1.8 */ void @@ -807,6 +814,11 @@ * * This is useful for rendering text in PDF. * + * Note that this method does not handle attributes in @glyph_item. + * If you want colors, shapes and lines handled automatically according + * to those attributes, you need to use pango_renderer_draw_layout_line() + * or pango_renderer_draw_layout(). + * * Note that @text is the start of the text for layout, which is then * indexed by `glyph_item->item->offset`. * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pangocoretext-fontmap.c new/pango-1.48.5/pango/pangocoretext-fontmap.c --- old/pango-1.48.4/pango/pangocoretext-fontmap.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pangocoretext-fontmap.c 2021-05-18 15:51:55.000000000 +0200 @@ -529,7 +529,8 @@ int *n_sizes) { *n_sizes = 0; - *sizes = NULL; + if (sizes) + *sizes = NULL; } G_DEFINE_TYPE (PangoCoreTextFace, pango_core_text_face, PANGO_TYPE_FONT_FACE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pangofc-fontmap.c new/pango-1.48.5/pango/pangofc-fontmap.c --- old/pango-1.48.4/pango/pangofc-fontmap.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pangofc-fontmap.c 2021-05-18 15:51:55.000000000 +0200 @@ -106,7 +106,7 @@ */ static GMutex fc_init_mutex; static GCond fc_init_cond; -static gboolean fc_initialized; +static int fc_initialized = 0; typedef struct _PangoFcFontFaceData PangoFcFontFaceData; @@ -820,11 +820,8 @@ g_object_unref (fontmap); } -static void -match_in_thread (GTask *task, - gpointer source_object, - gpointer task_data, - GCancellable *cancellable) +static gpointer +match_in_thread (gpointer task_data) { ThreadData *td = task_data; FcResult result; @@ -842,13 +839,14 @@ td->patterns->match = match; g_cond_signal (&td->patterns->cond); g_mutex_unlock (&td->patterns->mutex); + + thread_data_free (td); + + return NULL; } -static void -sort_in_thread (GTask *task, - gpointer source_object, - gpointer task_data, - GCancellable *cancellable) +static gpointer +sort_in_thread (gpointer task_data) { ThreadData *td = task_data; FcResult result; @@ -868,13 +866,17 @@ td->patterns->fontset = fontset; g_cond_signal (&td->patterns->cond); g_mutex_unlock (&td->patterns->mutex); + + thread_data_free (td); + + return NULL; } static PangoFcPatterns * pango_fc_patterns_new (FcPattern *pat, PangoFcFontMap *fontmap) { PangoFcPatterns *pats; - GTask *task; + GThread *thread; pat = uniquify_pattern (fontmap, pat); pats = g_hash_table_lookup (fontmap->priv->patterns_hash, pat); @@ -892,17 +894,11 @@ g_mutex_init (&pats->mutex); g_cond_init (&pats->cond); - task = g_task_new (NULL, NULL, NULL, NULL); - g_task_set_name (task, "[pango] FcFontSetMatch"); - g_task_set_task_data (task, thread_data_new (pats), thread_data_free); - g_task_run_in_thread (task, match_in_thread); - g_object_unref (task); - - task = g_task_new (NULL, NULL, NULL, NULL); - g_task_set_name (task, "[pango] FcFontSetSort"); - g_task_set_task_data (task, thread_data_new (pats), thread_data_free); - g_task_run_in_thread (task, sort_in_thread); - g_object_unref (task); + thread = g_thread_new ("[pango] FcFontSetMatch", match_in_thread, thread_data_new (pats)); + g_thread_unref (thread); + + thread = g_thread_new ("[pango] FcFontSetSort", sort_in_thread, thread_data_new (pats)); + g_thread_unref (thread); g_hash_table_insert (fontmap->priv->patterns_hash, pats->pattern, pats); @@ -1344,11 +1340,8 @@ G_ADD_PRIVATE (PangoFcFontMap) G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, pango_fc_font_map_list_model_init)) -static void -init_in_thread (GTask *task, - gpointer source_object, - gpointer task_data, - GCancellable *cancellable) +static gpointer +init_in_thread (gpointer task_data) { gint64 before = PANGO_TRACE_CURRENT_TIME; @@ -1357,8 +1350,27 @@ pango_trace_mark (before, "FcInit", NULL); g_mutex_lock (&fc_init_mutex); - fc_initialized = TRUE; - g_cond_signal (&fc_init_cond); + fc_initialized = 2; + g_cond_broadcast (&fc_init_cond); + g_mutex_unlock (&fc_init_mutex); + + return NULL; +} + +static void +start_init_in_thread (PangoFcFontMap *fcfontmap) +{ + g_mutex_lock (&fc_init_mutex); + + if (fc_initialized == 0) + { + GThread *thread; + + fc_initialized = 1; + thread = g_thread_new ("[pango] FcInit", init_in_thread, NULL); + g_thread_unref (thread); + } + g_mutex_unlock (&fc_init_mutex); } @@ -1369,7 +1381,7 @@ gboolean waited = FALSE; g_mutex_lock (&fc_init_mutex); - while (!fc_initialized) + while (fc_initialized < 2) { waited = TRUE; g_cond_wait (&fc_init_cond, &fc_init_mutex); @@ -1411,15 +1423,7 @@ NULL); priv->dpi = -1; - if (!fc_initialized) - { - GTask *task; - - task = g_task_new (fcfontmap, NULL, NULL, NULL); - g_task_set_name (task, "[pango] FcInit"); - g_task_run_in_thread (task, init_in_thread); - g_object_unref (task); - } + start_init_in_thread (fcfontmap); } static void @@ -2321,7 +2325,7 @@ FcConfigDestroy (oldconfig); /* No need to wait anymore */ - fc_initialized = TRUE; + fc_initialized = 2; } /** @@ -2893,7 +2897,8 @@ FcObjectSet *objectset; FcFontSet *fonts; - *sizes = NULL; + if (sizes) + *sizes = NULL; *n_sizes = 0; if (G_UNLIKELY (!fcface->family || !fcface->family->fontmap)) return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pangofc-shape.c new/pango-1.48.5/pango/pangofc-shape.c --- old/pango-1.48.4/pango/pangofc-shape.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pangofc-shape.c 2021-05-18 15:51:55.000000000 +0200 @@ -151,18 +151,10 @@ { PangoHbShapeContext *context = (PangoHbShapeContext *) font_data; - if ((context->show_flags & PANGO_SHOW_IGNORABLES) != 0) + if (context->show_flags != 0) { - if (pango_get_ignorable (unicode)) - { - *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode); - return TRUE; - } - } - - if ((context->show_flags & PANGO_SHOW_SPACES) != 0) - { - if (g_unichar_type (unicode) == G_UNICODE_SPACE_SEPARATOR) + if ((context->show_flags & PANGO_SHOW_SPACES) != 0 && + g_unichar_type (unicode) == G_UNICODE_SPACE_SEPARATOR) { /* Replace 0x20 by visible space, since we * don't draw a hex box for 0x20 @@ -173,11 +165,16 @@ *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode); return TRUE; } - } - if ((context->show_flags & PANGO_SHOW_LINE_BREAKS) != 0) - { - if (unicode == 0x2028) + if ((context->show_flags & PANGO_SHOW_IGNORABLES) != 0 && + pango_get_ignorable (unicode)) + { + *glyph = PANGO_GET_UNKNOWN_GLYPH (unicode); + return TRUE; + } + + if ((context->show_flags & PANGO_SHOW_LINE_BREAKS) != 0 && + unicode == 0x2028) { /* Always mark LS as unknown. If it ends up * at the line end, PangoLayout takes care of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pangowin32-fontmap.c new/pango-1.48.5/pango/pangowin32-fontmap.c --- old/pango-1.48.4/pango/pangowin32-fontmap.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pangowin32-fontmap.c 2021-05-18 15:51:55.000000000 +0200 @@ -1794,7 +1794,8 @@ * for scalable fonts it's simple, and currently we only have such * see : pango_win32_enum_proc(), TRUETYPE_FONTTYPE */ - *sizes = NULL; + if (sizes) + *sizes = NULL; *n_sizes = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/pango/pangowin32.c new/pango-1.48.5/pango/pangowin32.c --- old/pango-1.48.4/pango/pangowin32.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/pango/pangowin32.c 2021-05-18 15:51:55.000000000 +0200 @@ -820,10 +820,7 @@ PangoWin32FontCache *cache = pango_win32_font_map_get_font_cache (win32font->fontmap); PangoWin32Font *fontmap; - if (G_UNLIKELY (!cache)) - return; - - if (win32font->hfont != NULL) + if (cache != NULL && win32font->hfont != NULL) pango_win32_font_cache_unload (cache, win32font->hfont); g_slist_foreach (win32font->metrics_by_lang, (GFunc)free_metrics_info, NULL); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/subprojects/gi-docgen.wrap new/pango-1.48.5/subprojects/gi-docgen.wrap --- old/pango-1.48.4/subprojects/gi-docgen.wrap 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/subprojects/gi-docgen.wrap 2021-05-18 15:51:55.000000000 +0200 @@ -1,6 +1,6 @@ [wrap-git] directory=gi-docgen -url=https://gitlab.gnome.org/ebassi/gi-docgen.git -push-url=ssh://git@gitlab.gnome.org:ebassi/gi-docgen.git +url=https://gitlab.gnome.org/GNOME/gi-docgen.git +push-url=ssh://git@gitlab.gnome.org:GNOME/gi-docgen.git revision=main depth=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/subprojects/gobject-introspection.wrap new/pango-1.48.5/subprojects/gobject-introspection.wrap --- old/pango-1.48.4/subprojects/gobject-introspection.wrap 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/subprojects/gobject-introspection.wrap 2021-05-18 15:51:55.000000000 +0200 @@ -5,6 +5,6 @@ revision=master depth=1 -[provides] +[provide] dependency_names = gobject-introspection-1.0 program_names = g-ir-scanner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/tests/test-break.c new/pango-1.48.5/tests/test-break.c --- old/pango-1.48.4/tests/test-break.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/tests/test-break.c 2021-05-18 15:51:55.000000000 +0200 @@ -322,7 +322,7 @@ /* allow to easily generate expected output for new test cases */ if (argc > 1) { - if (strcmp (argv[1], "--help") == 0) + if (strcmp (argv[1], "--legend") == 0) { g_print ("test-break uses the following symbols for log attrs\n\n"); g_print ("Breaks: Words:\n" @@ -331,8 +331,9 @@ " c - char break e - word end\n" "\n" "Whitespace: Sentences:\n" - " x - expandable space s - sentence start\n" - " w - whitespace e - sentence end\n"); + " x - expandable space b - sentence boundary\n" + " w - whitespace s - sentence start\n" + " e - sentence end\n"); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/tests/test-layout.c new/pango-1.48.5/tests/test-layout.c --- old/pango-1.48.4/tests/test-layout.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/tests/test-layout.c 2021-05-18 15:51:55.000000000 +0200 @@ -368,7 +368,7 @@ string = g_string_sized_new (0); test_file (argv[1], string); - g_test_message ("%s", string->str); + g_print ("%s", string->str); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/tests/testmisc.c new/pango-1.48.5/tests/testmisc.c --- old/pango-1.48.4/tests/testmisc.c 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/tests/testmisc.c 2021-05-18 15:51:55.000000000 +0200 @@ -101,6 +101,26 @@ g_assert (scripts == NULL || num > 0); } +static void +test_line_height (void) +{ + PangoContext *context; + PangoLayout *layout; + PangoLayoutLine *line; + int height = 0; + + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + layout = pango_layout_new (context); + pango_layout_set_text (layout, "one\ttwo", -1); + line = pango_layout_get_line_readonly (layout, 0); + pango_layout_line_get_height (line, &height); + + g_assert_cmpint (height, >, 0); + + g_object_unref (layout); + g_object_unref (context); +} + int main (int argc, char *argv[]) { @@ -111,6 +131,7 @@ g_test_add_func ("/layout/itemize-utf8", test_itemize_utf8); g_test_add_func ("/layout/short-string-crash", test_short_string_crash); g_test_add_func ("/language/emoji-crash", test_language_emoji_crash); + g_test_add_func ("/layout/line-height", test_line_height); return g_test_run (); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/utils/meson.build new/pango-1.48.5/utils/meson.build --- old/pango-1.48.4/utils/meson.build 2021-03-27 02:54:41.000000000 +0100 +++ new/pango-1.48.5/utils/meson.build 2021-05-18 15:51:55.000000000 +0200 @@ -80,3 +80,10 @@ ]) endif + +pango_segmentation = executable('pango-segmentation', + 'pango-segmentation.c', + dependencies: [ libpango_dep, libpangocairo_dep ], + include_directories: [ root_inc ], + install: false, + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.48.4/utils/pango-segmentation.c new/pango-1.48.5/utils/pango-segmentation.c --- old/pango-1.48.4/utils/pango-segmentation.c 1970-01-01 01:00:00.000000000 +0100 +++ new/pango-1.48.5/utils/pango-segmentation.c 2021-05-18 15:51:55.000000000 +0200 @@ -0,0 +1,182 @@ +/* Pango + * pango-segmentation.c: Test Pango line breaking + * + * Copyright (C) 2021 Red Hat, Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include <glib.h> +#include <pango/pangocairo.h> +#include <string.h> +#include <locale.h> + +#ifndef G_OS_WIN32 +#include <unistd.h> +#endif + +typedef enum { + GRAPHEME, + WORD, + LINE, + SENTENCE +} BreakKind; + +static BreakKind +kind_from_string (const char *str) +{ + if (strcmp (str, "grapheme") == 0) + return GRAPHEME; + else if (strcmp (str, "word") == 0) + return WORD; + else if (strcmp (str, "line") == 0) + return LINE; + else if (strcmp (str, "sentence") == 0) + return SENTENCE; + else + { + g_printerr ("Not a segmentation: %s", str); + return 0; + } +} + +static gboolean +show_segmentation (const char *input, + BreakKind kind) +{ + GString *string; + PangoContext *context; + gsize length; + GError *error = NULL; + PangoLogAttr *attrs; + int len; + char *p; + int i; + char *text; + PangoAttrList *attributes; + PangoLayout *layout; + + context = pango_font_map_create_context (pango_cairo_font_map_get_default ()); + + string = g_string_new (""); + + length = strlen (input); + len = g_utf8_strlen (input, -1) + 1; + + pango_parse_markup (input, -1, 0, &attributes, &text, NULL, &error); + g_assert_no_error (error); + + layout = pango_layout_new (context); + pango_layout_set_text (layout, text, length); + pango_layout_set_attributes (layout, attributes); + + if (pango_layout_get_unknown_glyphs_count (layout) > 0) + { + char *msg = g_strdup_printf ("Missing glyphs - skipping. Maybe fonts are missing?"); + g_test_skip (msg); + g_free (msg); + g_object_unref (layout); + pango_attr_list_unref (attributes); + g_free (text); + return FALSE; + } + + pango_layout_get_log_attrs (layout, &attrs, &len); + + for (i = 0, p = text; i < len; i++, p = g_utf8_next_char (p)) + { + PangoLogAttr log = attrs[i]; + gboolean is_break = FALSE; + + switch (kind) + { + case GRAPHEME: + is_break = log.is_cursor_position; + break; + case WORD: + is_break = log.is_word_boundary; + break; + case LINE: + is_break = log.is_line_break; + break; + case SENTENCE: + is_break = log.is_sentence_boundary; + break; + default: + g_assert_not_reached (); + } + + if (is_break) + g_string_append (string, "|"); + + if (i < len - 1) + { + gunichar ch = g_utf8_get_char (p); + if (ch == 0x20) + g_string_append (string, " "); + else if (g_unichar_isgraph (ch) && + !(g_unichar_type (ch) == G_UNICODE_LINE_SEPARATOR || + g_unichar_type (ch) == G_UNICODE_PARAGRAPH_SEPARATOR)) + g_string_append_unichar (string, ch); + else + g_string_append_printf (string, "[%#04x]", ch); + } + } + + g_object_unref (layout); + g_free (attrs); + g_free (text); + pango_attr_list_unref (attributes); + + g_print ("%s\n", string->str); + + g_string_free (string, TRUE); + + return TRUE; +} + +int +main (int argc, char *argv[]) +{ + setlocale (LC_ALL, ""); + char *opt_kind = "grapheme"; + GOptionEntry entries[] = { + { "kind", 0, 0, G_OPTION_ARG_STRING, &opt_kind, "Kind of boundary (grapheme/word/line/sentence)", "KIND" }, + { NULL, }, + }; + GOptionContext *context; + GError *error = NULL; + + context = g_option_context_new ("TEXT"); + g_option_context_add_main_entries (context, entries, NULL); + g_option_context_set_description (context, + "Show text segmentation as determined by Pango."); + if (!g_option_context_parse (context, &argc, &argv, &error)) + { + g_printerr ("%s\n", error->message); + exit (1); + } + + if (argc < 2) + { + g_printerr ("Usage: pango-segmentation [OPTIONS���] TEXT"); + exit (1); + } + + show_segmentation (argv[1], kind_from_string (opt_kind)); + + return 0; +} ++++++ pango.obsinfo ++++++ --- /var/tmp/diff_new_pack.HJejO2/_old 2021-05-23 23:30:41.352716247 +0200 +++ /var/tmp/diff_new_pack.HJejO2/_new 2021-05-23 23:30:41.352716247 +0200 @@ -1,5 +1,5 @@ name: pango -version: 1.48.4 -mtime: 1616810081 -commit: 386639c3b118cc973f714eb485877f480391f31f +version: 1.48.5 +mtime: 1621345915 +commit: 3940a1714e84b076d04d4638c88df3dba7d8014e
participants (1)
-
Source-Sync