Hello community, here is the log from the commit of package pango for openSUSE:Factory checked in at 2020-11-19 11:57:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pango (Old) and /work/SRC/openSUSE:Factory/.pango.new.5913 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pango" Thu Nov 19 11:57:41 2020 rev:125 rq:847342 version:1.48.0 Changes: -------- --- /work/SRC/openSUSE:Factory/pango/pango.changes 2020-09-25 16:28:12.503713603 +0200 +++ /work/SRC/openSUSE:Factory/.pango.new.5913/pango.changes 2020-11-23 10:37:56.565851401 +0100 @@ -1,0 +2,16 @@ +Mon Nov 9 15:35:49 UTC 2020 - Dominique Leuenberger <dims...@opensuse.org> + +- Update to version 1.48.0: + + docs: Clarify use of PangoAnalysis in shaping. + + fontconfig: Make pango_font_family_get_face more reliable. + + introspection: Fix use of PangoFcSubstituteFunc. + + introspection: Skip fontconfig types. + + build: Use yielding meson feature for introspection. +- Changes from version 1.47.0: + + Add pango_language_get_preferred. + + Add pango_fc_font_get_languages. + + Sort faces of a family by slant and weight. +- Replace -Dintrospection=true meson parameter with + -Dintrospection=enabled, following upstream changes. + +------------------------------------------------------------------- Old: ---- pango-1.46.2.obscpio New: ---- pango-1.48.0.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pango.spec ++++++ --- /var/tmp/diff_new_pack.sjEkTv/_old 2020-11-23 10:37:57.125852015 +0100 +++ /var/tmp/diff_new_pack.sjEkTv/_new 2020-11-23 10:37:57.129852020 +0100 @@ -17,7 +17,7 @@ Name: pango -Version: 1.46.2 +Version: 1.48.0 Release: 0 Summary: Library for Layout and Rendering of Text License: LGPL-2.1-or-later @@ -30,7 +30,7 @@ BuildRequires: gcc-c++ BuildRequires: gtk-doc BuildRequires: help2man -BuildRequires: meson +BuildRequires: meson >= 0.54.0 BuildRequires: pkgconfig BuildRequires: pkgconfig(cairo) >= 1.12.10 BuildRequires: pkgconfig(fontconfig) >= 2.11.91 @@ -123,7 +123,7 @@ %build %meson \ -Dgtk_doc=true \ - -Dintrospection=true \ + -Dintrospection=enabled \ -Dinstall-tests=false \ %{nil} %meson_build ++++++ _service ++++++ --- /var/tmp/diff_new_pack.sjEkTv/_old 2020-11-23 10:37:57.161852055 +0100 +++ /var/tmp/diff_new_pack.sjEkTv/_new 2020-11-23 10:37:57.161852055 +0100 @@ -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">1.46.2</param> + <param name="revision">1.48.0</param> <param name="versionformat">@PARENT_TAG@+@TAG_OFFSET@</param> <param name="versionrewrite-pattern">(.*)\+0</param> <param name="versionrewrite-replacement">\1</param> ++++++ pango-1.46.2.obscpio -> pango-1.48.0.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/.gitlab-ci/fedora.Dockerfile new/pango-1.48.0/.gitlab-ci/fedora.Dockerfile --- old/pango-1.46.2/.gitlab-ci/fedora.Dockerfile 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/.gitlab-ci/fedora.Dockerfile 2020-11-08 15:29:15.000000000 +0100 @@ -41,7 +41,7 @@ thai-scalable-waree-fonts \ && dnf clean all -RUN pip3 install meson==0.53.1 +RUN pip3 install meson==0.54.3 ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/.gitlab-ci.yml new/pango-1.48.0/.gitlab-ci.yml --- old/pango-1.46.2/.gitlab-ci.yml 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/.gitlab-ci.yml 2020-11-08 15:29:15.000000000 +0100 @@ -8,9 +8,10 @@ variables: COMMON_MESON_FLAGS: "--fatal-meson-warnings --werror" MESON_TEST_TIMEOUT_MULTIPLIER: 2 + FEDORA_IMAGE: registry.gitlab.gnome.org/gnome/pango/fedora:v3 linux-fedora: - image: registry.gitlab.gnome.org/gnome/pango/fedora:v2 + image: $FEDORA_IMAGE stage: build needs: [] variables: @@ -34,13 +35,13 @@ - "${CI_PROJECT_DIR}/_build/fontlist.txt" asan-build: - image: registry.gitlab.gnome.org/gnome/pango/fedora:v2 + image: $FEDORA_IMAGE tags: [ asan ] stage: analysis needs: [] variables: script: - - CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=false _build + - CC=clang meson --buildtype=debugoptimized -Db_sanitize=address -Db_lundef=false -Dintrospection=disabled _build - ninja -C _build - .gitlab-ci/run-tests.sh _build allow_failure: true @@ -78,7 +79,7 @@ - _build/fontlist.txt reference: - image: registry.gitlab.gnome.org/gnome/pango/fedora:v1 + image: $FEDORA_IMAGE stage: docs needs: [] variables: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/NEWS new/pango-1.48.0/NEWS --- old/pango-1.46.2/NEWS 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/NEWS 2020-11-08 15:29:15.000000000 +0100 @@ -1,3 +1,17 @@ +Overview of changes in 1.48.0 +============================= +- docs: Clarify use of PangoAnalysis in shaping +- fontconfig: Make pango_font_family_get_face more reliable +- introspection: Fix use of PangoFcSubstituteFunc +- introspection: Skip fontconfig types +- build: Use yielding meson feature for introspection + +Overview of changes in 1.47.0 +============================= +- Add pango_language_get_preferred +- Add pango_fc_font_get_languages +- Sort faces of a family by slant and weight + Overview of changes in 1.46.2 ============================= - Fix pango_win32_font_map_load_font with falback families diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/docs/pango-sections.txt new/pango-1.48.0/docs/pango-sections.txt --- old/pango-1.46.2/docs/pango-sections.txt 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/docs/pango-sections.txt 2020-11-08 15:29:15.000000000 +0100 @@ -644,6 +644,7 @@ pango_language_includes_script pango_language_get_scripts pango_language_get_default +pango_language_get_preferred pango_language_get_sample_string <SUBSECTION Private> @@ -979,6 +980,9 @@ pango_fc_font_map_shutdown pango_fc_font_map_set_config pango_fc_font_map_get_config +PangoFcSubstituteFunc +pango_fc_font_map_set_default_substitute +pango_fc_font_map_substitute_changed pango_fc_font_description_from_pattern PANGO_FC_FONT_FEATURES PANGO_FC_GRAVITY @@ -1010,6 +1014,8 @@ pango_fc_font_get_glyph pango_fc_font_get_unknown_glyph pango_fc_font_kern_glyphs +pango_fc_font_get_languages +pango_fc_font_get_pattern <SUBSECTION Standard> PANGO_FC_FONT PANGO_IS_FC_FONT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/make-release.sh new/pango-1.48.0/make-release.sh --- old/pango-1.46.2/make-release.sh 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/make-release.sh 2020-11-08 15:29:15.000000000 +0100 @@ -10,16 +10,16 @@ fi # we include gtk-doc since we need the gtk-doc-for-gtk4 branch -meson setup --force-fallback-for gtk-doc ${release_build_dir} || exit +meson setup ${release_build_dir} || exit # make the release tarball -meson dist -C${release_build_dir} --include-subprojects || exit +meson dist -C${release_build_dir} || exit # now build the docs meson configure -Dgtk_doc=true ${release_build_dir} || exit ninja -C${release_build_dir} pango-doc || exit -tar cf ${release_build_dir}/meson-dist/pango-docs-${version}.tar.xz ${release_build_dir}/docs/ +tar cf ${release_build_dir}/meson-dist/pango-docs-${version}.tar.xz -C${release_build_dir} docs/ echo -e "\n\nPango ${version} release on branch ${branch} in ./${release_build_dir}/:\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/meson.build new/pango-1.48.0/meson.build --- old/pango-1.46.2/meson.build 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/meson.build 2020-11-08 15:29:15.000000000 +0100 @@ -1,5 +1,5 @@ project('pango', 'c', 'cpp', - version: '1.46.2', + version: '1.48.0', license: 'LGPLv2.1+', default_options: [ 'buildtype=debugoptimized', @@ -8,7 +8,7 @@ # https://github.com/mesonbuild/meson/issues/2289 'c_std=gnu99', ], - meson_version : '>= 0.50.0') + meson_version : '>= 0.54.0') add_project_arguments([ '-D_POSIX_C_SOURCE=200809L', '-D_POSIX_THREAD_SAFE_FUNCTIONS', '-D_GNU_SOURCE', ], language: 'c') @@ -269,17 +269,15 @@ pango_deps += harfbuzz_dep -# Only use FontConfig fallback when required or requested - +# If option is 'auto' or 'enabled' it is not required to find fontconfig on the +# system because a fallback is done at the end. Override 'disabled' option on +# platforms that requires it. fontconfig_option = get_option('fontconfig') - -fontconfig_sys_required = (host_system != 'windows' and host_system != 'darwin') -if fontconfig_sys_required and fontconfig_option.disabled() - error('Fontconfig is required on this platform (pass -Dfontconfig=enabled or -Dfontconfig=auto)') +fontconfig_required = host_system not in ['windows', 'darwin'] +if not fontconfig_option.disabled() or fontconfig_required + fontconfig_option = false endif -fontconfig_required = fontconfig_sys_required or fontconfig_option.enabled() - fontconfig_dep = dependency('fontconfig', version: fontconfig_req_version, required: fontconfig_option) if fontconfig_dep.found() fontconfig_pc = 'fontconfig' @@ -294,15 +292,19 @@ endif endif -if fontconfig_required and not fontconfig_dep.found() +# Do the fallback now if fontconfig has not been found on the system. Override +# user option on platforms that always require fontconfig. +fontconfig_option = fontconfig_required ? true : get_option('fontconfig') +if not fontconfig_dep.found() fontconfig_dep = dependency('fontconfig', version: fontconfig_req_version, - fallback: ['fontconfig', 'fontconfig_dep']) + fallback: ['fontconfig', 'fontconfig_dep'], + required: fontconfig_option) endif if fontconfig_dep.found() pango_deps += fontconfig_dep - if fontconfig_pc == 'fontconfig' + if fontconfig_dep.type_name() != 'library' if fontconfig_dep.version().version_compare('>=2.12.92') pango_conf.set('HAVE_FCWEIGHTFROMOPENTYPEDOUBLE', 1) endif @@ -318,9 +320,17 @@ endif message('fontconfig has FcWeightFromOpenTypeDouble: ' + res) +# If option is 'auto' or 'enabled' it is not required to find freetype2 on the +# system because a fallback is done at the end. Override 'disabled' option on +# if fontconfig has been found. +freetype_option = get_option('freetype') +freetype_required = fontconfig_dep.found() +if not freetype_option.disabled() or freetype_required + freetype_option = false +endif + # The first version of freetype with a pkg-config file is 2.1.5 -# We require both fontconfig and freetype if we are to have either. -freetype_dep = dependency('freetype2', required: get_option('freetype')) +freetype_dep = dependency('freetype2', required: freetype_option) if freetype_dep.found() freetype2_pc = 'freetype2' @@ -328,7 +338,7 @@ if cc.get_id() == 'msvc' and cc.has_header('ft2build.h') foreach ft2_lib: ['freetype', 'freetypemt'] if not freetype_dep.found() - freetype_dep = cc.find_library(ft2_lib, required: get_option('freetype')) + freetype_dep = cc.find_library(ft2_lib, required: freetype_option) if freetype_dep.found() freetype2_lib = '-l@0@'.format(ft2_lib) endif @@ -337,8 +347,10 @@ endif endif -if fontconfig_required and not freetype_dep.found() - freetype_dep = dependency('freetype2', required: get_option('freetype'), +# Do the fallback now if freetype2 has not been found on the system. +freetype_option = freetype_required ? true : get_option('freetype') +if not freetype_dep.found() + freetype_dep = dependency('freetype2', required: freetype_option, fallback: ['freetype2', 'freetype_dep']) endif @@ -371,14 +383,21 @@ pango_deps += dependency('appleframeworks', modules: [ 'CoreFoundation', 'ApplicationServices' ]) endif +# If option is 'auto' or 'enabled' it is not required to find cairo on the +# system because a fallback is done at the end. +cairo_option = get_option('cairo') +if not cairo_option.disabled() + cairo_option = false +endif + cairo_found_type = '' -cairo_dep = dependency('cairo', version: cairo_req_version, required: get_option('cairo')) +cairo_dep = dependency('cairo', version: cairo_req_version, required: cairo_option) if cairo_dep.found() cairo_found_type = cairo_dep.type_name() else if cc.get_id() == 'msvc' and cc.has_header('cairo.h') - cairo_dep = cc.find_library('cairo', required: false) + cairo_dep = cc.find_library('cairo', required: cairo_option) cairo_found_type = 'library' endif endif @@ -387,7 +406,8 @@ # in a declarative way if not cairo_dep.found() cairo_dep = dependency('cairo', version: cairo_req_version, - fallback: ['cairo', 'libcairo_dep'], required: get_option('cairo')) + fallback: ['cairo', 'libcairo_dep'], required: get_option('cairo'), + default_options: ['freetype=enabled', 'fontconfig=enabled']) cairo_found_type = cairo_dep.type_name() endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/meson_options.txt new/pango-1.48.0/meson_options.txt --- old/pango-1.46.2/meson_options.txt 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/meson_options.txt 2020-11-08 15:29:15.000000000 +0100 @@ -4,8 +4,9 @@ value: false) option('introspection', description: 'Build the GObject introspection data for Pango', - type: 'boolean', - value: true) + type: 'feature', + value: 'auto', + yield: true) option('install-tests', description : 'Install tests', type: 'boolean', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/meson.build new/pango-1.48.0/pango/meson.build --- old/pango-1.46.2/pango/meson.build 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/meson.build 2020-11-08 15:29:15.000000000 +0100 @@ -121,7 +121,8 @@ pango_dep_sources = [pango_enum_h] -build_gir = get_option('introspection') +gir = find_program('g-ir-scanner', required : get_option('introspection')) +build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled()) if build_gir gir_args = [ @@ -151,6 +152,7 @@ dependencies: pango_deps, sources: pango_dep_sources, ) +meson.override_dependency('pango', libpango_dep) pango_pkg_requires = ['gobject-2.0'] if harfbuzz_dep.type_name() == 'pkgconfig' @@ -292,6 +294,7 @@ dependencies: pango_deps + [ libpango_dep ], sources: pangoft2_dep_sources, ) + meson.override_dependency('pangoft2', libpangoft2_dep) pkgconfig.generate(libpangoft2, name: 'Pango FT2 and Pango Fc', @@ -381,6 +384,7 @@ dependencies: pango_deps + [ libpango_dep, libpangoft2_dep ], sources: pangoxft_dep_sources, ) + meson.override_dependency('pangoxft', libpangoxft_dep) pkgconfig.generate(libpangoxft, name: 'Pango Xft', @@ -440,6 +444,7 @@ include_directories: root_inc, dependencies: pango_deps + [ libpango_dep ], ) + meson.override_dependency('pangowin32', libpangowin32_dep) pkgconfig.generate(libpangowin32, name: 'Pango Win32', @@ -546,6 +551,7 @@ dependencies: pango_deps + [ libpango_dep ], sources: pangocairo_dep_sources, ) + meson.override_dependency('pangocairo', libpangocairo_dep) # Create pangocairo.pc according to whether we found Cairo # manually diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pango-language.c new/pango-1.48.0/pango/pango-language.c --- old/pango-1.46.2/pango/pango-language.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pango-language.c 2020-11-08 15:29:15.000000000 +0100 @@ -791,13 +791,14 @@ return (PangoLanguage **) g_array_free (langs, FALSE); } +G_LOCK_DEFINE_STATIC (languages); +static gboolean initialized = FALSE; /* MT-safe */ +static PangoLanguage * const * languages = NULL; /* MT-safe */ +static GHashTable *hash = NULL; /* MT-safe */ + static PangoLanguage * _pango_script_get_default_language (PangoScript script) { - G_LOCK_DEFINE_STATIC (languages); - static gboolean initialized = FALSE; /* MT-safe */ - static PangoLanguage * const * languages = NULL; /* MT-safe */ - static GHashTable *hash = NULL; /* MT-safe */ PangoLanguage *result, * const * p; G_LOCK (languages); @@ -835,6 +836,33 @@ } /** + * pango_language_get_preferred: + * + * Returns the list of languages that the user prefers, as specified + * by the PANGO_LANGUAGE or LANGUAGE environment variables, in order + * of preference. Note that this list does not necessarily include + * the language returned by pango_language_get_default(). + * + * When choosing language-specific resources, such as the sample + * text returned by pango_language_get_sample_string(), you should + * first try the default language, followed by the languages returned + * by this function. + * + * Returns: (transfer none) (nullable): a %NULL-terminated array of + * PangoLanguage* + * + * Since: 1.48 + */ +PangoLanguage ** +pango_language_get_preferred (void) +{ + /* We call this just for its side-effect of initializing languages */ + _pango_script_get_default_language (PANGO_SCRIPT_COMMON); + + return languages; +} + +/** * pango_script_get_sample_language: * @script: a #PangoScript * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pango-language.h new/pango-1.48.0/pango/pango-language.h --- old/pango-1.46.2/pango/pango-language.h 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pango-language.h 2020-11-08 15:29:15.000000000 +0100 @@ -53,6 +53,9 @@ PANGO_AVAILABLE_IN_1_16 PangoLanguage *pango_language_get_default (void) G_GNUC_CONST; +PANGO_AVAILABLE_IN_1_48 +PangoLanguage **pango_language_get_preferred (void) G_GNUC_CONST; + PANGO_AVAILABLE_IN_ALL gboolean pango_language_matches (PangoLanguage *language, const char *range_list) G_GNUC_PURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pango-version-macros.h new/pango-1.48.0/pango/pango-version-macros.h --- old/pango-1.46.2/pango/pango-version-macros.h 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pango-version-macros.h 2020-11-08 15:29:15.000000000 +0100 @@ -262,6 +262,16 @@ */ #define PANGO_VERSION_1_46 (G_ENCODE_VERSION (1, 46)) +/** + * PANGO_VERSION_1_48: + * + * A macro that evaluates to the 1.48 version of Pango, in a format + * that can be used by the C pre-processor. + * + * Since: 1.48 + */ +#define PANGO_VERSION_1_48 (G_ENCODE_VERSION (1, 48)) + /* evaluates to the current stable version; for development cycles, * this means the next stable target */ @@ -681,4 +691,18 @@ # define PANGO_AVAILABLE_IN_1_46 _PANGO_EXTERN #endif +#if PANGO_VERSION_MIN_REQUIRED >= PANGO_VERSION_1_48 +# define PANGO_DEPRECATED_IN_1_48 PANGO_DEPRECATED +# define PANGO_DEPRECATED_IN_1_48_FOR(f) PANGO_DEPRECATED_FOR(f) +#else +# define PANGO_DEPRECATED_IN_1_48 _PANGO_EXTERN +# define PANGO_DEPRECATED_IN_1_48_FOR(f) _PANGO_EXTERN +#endif + +#if PANGO_VERSION_MAX_ALLOWED < PANGO_VERSION_1_48 +# define PANGO_AVAILABLE_IN_1_48 PANGO_UNAVAILABLE(1, 48) +#else +# define PANGO_AVAILABLE_IN_1_48 _PANGO_EXTERN +#endif + #endif /* __PANGO_VERSION_H__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangocairo-fcfontmap.c new/pango-1.48.0/pango/pangocairo-fcfontmap.c --- old/pango-1.46.2/pango/pangocairo-fcfontmap.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangocairo-fcfontmap.c 2020-11-08 15:29:15.000000000 +0100 @@ -105,6 +105,8 @@ { FcConfigSubstitute (pango_fc_font_map_get_config (fcfontmap), pattern, FcMatchPattern); + if (fcfontmap->substitute_func) + fcfontmap->substitute_func (pattern, fcfontmap->substitute_data); if (fontkey) cairo_ft_font_options_substitute (pango_fc_fontset_key_get_context_key (fontkey), pattern); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangofc-font.c new/pango-1.48.0/pango/pangofc-font.c --- old/pango-1.46.2/pango/pangofc-font.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangofc-font.c 2020-11-08 15:29:15.000000000 +0100 @@ -1035,3 +1035,51 @@ done: return hb_font; } + +/** + * pango_fc_font_get_languages: + * @font: a #PangoFcFont + * + * Returns the languages that are supported by @font. + * + * This corresponds to the FC_LANG member of the FcPattern. + * + * The returned array is only valid as long as the font + * and its fontmap are valid. + * + * Returns: (transfer none) (nullable): a %NULL-terminated + * array of PangoLanguage* + * + * Since: 1.48 + */ +PangoLanguage ** +pango_fc_font_get_languages (PangoFcFont *font) +{ + PangoFcFontMap *fontmap; + PangoLanguage **languages; + + fontmap = g_weak_ref_get ((GWeakRef *) &font->fontmap); + if (!fontmap) + return NULL; + + languages = _pango_fc_font_map_get_languages (fontmap, font); + g_object_unref (fontmap); + + return languages; +} + +/** + * pango_fc_font_get_pattern: (skip) + * @font: a #PangoFcFont + * + * Returns the FcPattern that @font is based on. + * + * Returns: the fontconfig pattern for this font + * + * Since: 1.48 + */ +FcPattern * +pango_fc_font_get_pattern (PangoFcFont *font) +{ + return font->font_pattern; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangofc-font.h new/pango-1.48.0/pango/pangofc-font.h --- old/pango-1.46.2/pango/pangofc-font.h 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangofc-font.h 2020-11-08 15:29:15.000000000 +0100 @@ -94,6 +94,13 @@ PANGO_AVAILABLE_IN_1_4 guint pango_fc_font_get_glyph (PangoFcFont *font, gunichar wc); +PANGO_AVAILABLE_IN_1_48 +PangoLanguage ** + pango_fc_font_get_languages (PangoFcFont *font); + +PANGO_AVAILABLE_IN_1_48 +FcPattern *pango_fc_font_get_pattern (PangoFcFont *font); + PANGO_DEPRECATED_FOR(PANGO_GET_UNKNOWN_GLYPH) PangoGlyph pango_fc_font_get_unknown_glyph (PangoFcFont *font, gunichar wc); @@ -106,5 +113,6 @@ PANGO_DEPRECATED_IN_1_44_FOR(pango_font_get_hb_font) void pango_fc_font_unlock_face (PangoFcFont *font); + G_END_DECLS #endif /* __PANGO_FC_FONT_H__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangofc-fontmap-private.h new/pango-1.48.0/pango/pangofc-fontmap-private.h --- old/pango-1.46.2/pango/pangofc-fontmap-private.h 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangofc-fontmap-private.h 2020-11-08 15:29:15.000000000 +0100 @@ -94,14 +94,23 @@ PangoFontMap parent_instance; PangoFcFontMapPrivate *priv; + + /* Function to call on prepared patterns to do final + * config tweaking. + */ + PangoFcSubstituteFunc substitute_func; + gpointer substitute_data; + GDestroyNotify substitute_destroy; }; /** * PangoFcFontMapClass: * @default_substitute: (nullable): Substitutes in default * values for unspecified fields in a #FcPattern. This will - * be called prior to creating a font for the pattern. May be - * %NULL. Deprecated in favor of @font_key_substitute(). + * be called prior to creating a font for the pattern. + * Implementations must call substitute_func if it is + * defined. May be %NULL. Deprecated in favor of + * @font_key_substitute(). * @new_font: Creates a new #PangoFcFont for the specified * pattern of the appropriate type for this font map. The * @pattern argument must be passed to the "pattern" property @@ -127,7 +136,8 @@ * @fontset_key_substitute: (nullable): Substitutes in * default values for unspecified fields in a * #FcPattern. This will be called prior to creating a font - * for the pattern. May be %NULL. (Since: 1.24) + * for the pattern. Implementations must call substitute_func + * if it is defined. May be %NULL. (Since: 1.24) * @create_font: (nullable): Creates a new #PangoFcFont for * the specified pattern of the appropriate type for this * font map using information from the font key that is diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangofc-fontmap.c new/pango-1.48.0/pango/pangofc-fontmap.c --- old/pango-1.46.2/pango/pangofc-fontmap.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangofc-fontmap.c 2020-11-08 15:29:15.000000000 +0100 @@ -166,8 +166,9 @@ int id; /* needed to handle TTC files with multiple faces */ /* Data */ - FcPattern *pattern; /* Referenced pattern that owns filename */ + FcPattern *pattern; /* Referenced pattern that owns filename */ PangoCoverage *coverage; + PangoLanguage **languages; hb_face_t *hb_face; }; @@ -181,6 +182,7 @@ FcPattern *pattern; guint fake : 1; + guint regular : 1; }; struct _PangoFcFamily @@ -307,6 +309,8 @@ if (data->coverage) pango_coverage_unref (data->coverage); + g_free (data->languages); + hb_face_destroy (data->hb_face); g_slice_free (PangoFcFontFaceData, data); @@ -1337,6 +1341,9 @@ pango_fc_font_map_shutdown (fcfontmap); + if (fcfontmap->substitute_destroy) + fcfontmap->substitute_destroy (fcfontmap->substitute_data); + G_OBJECT_CLASS (pango_fc_font_map_parent_class)->finalize (object); } @@ -1798,6 +1805,28 @@ PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->default_substitute (fontmap, pattern); } +void +pango_fc_font_map_set_default_substitute (PangoFcFontMap *fontmap, + PangoFcSubstituteFunc func, + gpointer data, + GDestroyNotify notify) +{ + if (fontmap->substitute_destroy) + fontmap->substitute_destroy (fontmap->substitute_data); + + fontmap->substitute_func = func; + fontmap->substitute_data = data; + fontmap->substitute_destroy = notify; + + pango_fc_font_map_substitute_changed (fontmap); +} + +void +pango_fc_font_map_substitute_changed (PangoFcFontMap *fontmap) { + pango_fc_font_map_cache_clear(fontmap); + pango_font_map_changed(PANGO_FONT_MAP (fontmap)); +} + static double pango_fc_font_map_get_resolution (PangoFcFontMap *fcfontmap, PangoContext *context) @@ -2245,6 +2274,57 @@ return (PangoCoverage *)coverage; } +static PangoLanguage ** +_pango_fc_font_map_fc_to_languages (FcLangSet *langset) +{ + FcStrSet *strset; + FcStrList *list; + FcChar8 *s; + GArray *langs; + + langs = g_array_new (TRUE, FALSE, sizeof (PangoLanguage *)); + + strset = FcLangSetGetLangs (langset); + list = FcStrListCreate (strset); + + FcStrListFirst (list); + while ((s = FcStrListNext (list))) + { + PangoLanguage *l = pango_language_from_string ((const char *)s); + g_array_append_val (langs, l); + } + + FcStrListDone (list); + FcStrSetDestroy (strset); + + return (PangoLanguage **) g_array_free (langs, FALSE); +} + +PangoLanguage ** +_pango_fc_font_map_get_languages (PangoFcFontMap *fcfontmap, + PangoFcFont *fcfont) +{ + PangoFcFontFaceData *data; + FcLangSet *langset; + + data = pango_fc_font_map_get_font_face_data (fcfontmap, fcfont->font_pattern); + if (G_UNLIKELY (!data)) + return NULL; + + if (G_UNLIKELY (data->languages == NULL)) + { + /* + * Pull the languages out of the pattern, this + * doesn't require loading the font + */ + if (FcPatternGetLangSet (fcfont->font_pattern, FC_LANG, 0, &langset) != FcResultMatch) + return NULL; + + data->languages = _pango_fc_font_map_fc_to_languages (langset); + } + + return data->languages; +} /** * pango_fc_font_map_create_context: * @fcfontmap: a #PangoFcFontMap @@ -2726,6 +2806,32 @@ return face; } +static int +compare_face (const void *p1, const void *p2) +{ + const PangoFcFace *f1 = *(const void **)p1; + const PangoFcFace *f2 = *(const void **)p2; + int w1, w2; + int s1, s2; + + if (FcPatternGetInteger (f1->pattern, FC_WEIGHT, 0, &w1) != FcResultMatch) + w1 = FC_WEIGHT_MEDIUM; + + if (FcPatternGetInteger (f1->pattern, FC_SLANT, 0, &s1) != FcResultMatch) + s1 = FC_SLANT_ROMAN; + + if (FcPatternGetInteger (f2->pattern, FC_WEIGHT, 0, &w2) != FcResultMatch) + w2 = FC_WEIGHT_MEDIUM; + + if (FcPatternGetInteger (f2->pattern, FC_SLANT, 0, &s2) != FcResultMatch) + s2 = FC_SLANT_ROMAN; + + if (s1 != s2) + return s1 - s2; /* roman < italic < oblique */ + + return w1 - w2; /* from light to heavy */ +} + static void ensure_faces (PangoFcFamily *fcfamily) { @@ -2747,6 +2853,7 @@ fcfamily->faces[i++] = create_face (fcfamily, "Bold", NULL, TRUE); fcfamily->faces[i++] = create_face (fcfamily, "Italic", NULL, TRUE); fcfamily->faces[i++] = create_face (fcfamily, "Bold Italic", NULL, TRUE); + fcfamily->faces[0]->regular = 1; } else { @@ -2760,12 +2867,17 @@ gboolean has_face [4] = { FALSE, FALSE, FALSE, FALSE }; PangoFcFace **faces; gint num = 0; + int regular_weight; + int regular_idx; fontset = fcfamily->patterns; /* at most we have 3 additional artifical faces */ faces = g_new (PangoFcFace *, fontset->nfont + 3); + regular_weight = 0; + regular_idx = -1; + for (i = 0; i < fontset->nfont; i++) { const char *style, *font_style = NULL; @@ -2790,12 +2902,23 @@ if (FcPatternGetString (fontset->fonts[i], FC_STYLE, 0, (FcChar8 **)(void*)&font_style) != FcResultMatch) font_style = NULL; + if (font_style && strcmp (font_style, "Regular") == 0) + { + regular_weight = FC_WEIGHT_MEDIUM; + regular_idx = num; + } + if (weight <= FC_WEIGHT_MEDIUM) { if (slant == FC_SLANT_ROMAN) { has_face[REGULAR] = TRUE; style = "Regular"; + if (weight > regular_weight) + { + regular_weight = weight; + regular_idx = num; + } } else { @@ -2833,8 +2956,13 @@ if ((has_face[REGULAR] || has_face[ITALIC] || has_face[BOLD]) && !has_face[BOLD_ITALIC]) faces[num++] = create_face (fcfamily, "Bold Italic", NULL, TRUE); + if (regular_idx != -1) + faces[regular_idx]->regular = 1; + faces = g_renew (PangoFcFace *, faces, num); + qsort (faces, num, sizeof (PangoFcFace *), compare_face); + fcfamily->n_faces = num; fcfamily->faces = faces; } @@ -2875,14 +3003,12 @@ ensure_faces (fcfamily); - if (name == NULL) - name = "Regular"; /* This name always exists in fontconfig */ - for (i = 0; i < fcfamily->n_faces; i++) { PangoFontFace *face = PANGO_FONT_FACE (fcfamily->faces[i]); - if (strcmp (name, pango_font_face_get_face_name (face)) == 0) + if ((name != NULL && strcmp (name, pango_font_face_get_face_name (face)) == 0) || + (name == NULL && PANGO_FC_FACE (face)->regular)) return face; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangofc-fontmap.h new/pango-1.48.0/pango/pangofc-fontmap.h --- old/pango-1.46.2/pango/pangofc-fontmap.h 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangofc-fontmap.h 2020-11-08 15:29:15.000000000 +0100 @@ -106,6 +106,52 @@ PangoFcFont *fcfont); /** + * PangoFcSubstituteFunc: + * @pattern: the FcPattern to tweak. + * @data: user data. + * + * Function type for doing final config tweaking on prepared FcPatterns. + */ +typedef void (*PangoFcSubstituteFunc) (FcPattern *pattern, + gpointer data); + +/** + * pango_fc_font_map_set_default_substitute: + * @fontmap: a #PangoFcFontMap + * @func: function to call to to do final config tweaking + * on #FcPattern objects. + * @data: data to pass to @func + * @notify: function to call when @data is no longer used. + * + * Sets a function that will be called to do final configuration + * substitution on a #FcPattern before it is used to load + * the font. This function can be used to do things like set + * hinting and antialiasing options. + * + * Since: 1.48 + */ +PANGO_AVAILABLE_IN_1_48 +void pango_fc_font_map_set_default_substitute (PangoFcFontMap *fontmap, + PangoFcSubstituteFunc func, + gpointer data, + GDestroyNotify notify); + +/** + * pango_fc_font_map_substitute_changed: + * @fontmap: a #PangoFcFontMap + * + * Call this function any time the results of the + * default substitution function set with + * pango_fc_font_map_set_default_substitute() change. + * That is, if your substitution function will return different + * results for the same input pattern, you must call this function. + * + * Since: 1.48 + */ +PANGO_AVAILABLE_IN_1_48 +void pango_fc_font_map_substitute_changed (PangoFcFontMap *fontmap); + +/** * PANGO_FC_GRAVITY: * * String representing a fontconfig property name that Pango sets on any diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangofc-private.h new/pango-1.48.0/pango/pangofc-private.h --- old/pango-1.46.2/pango/pangofc-private.h 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangofc-private.h 2020-11-08 15:29:15.000000000 +0100 @@ -78,6 +78,9 @@ PangoFontMetrics *pango_fc_font_create_base_metrics_for_context (PangoFcFont *font, PangoContext *context); +PangoLanguage **_pango_fc_font_map_get_languages (PangoFcFontMap *fcfontmap, + PangoFcFont *fcfont); + G_END_DECLS #endif /* __PANGOFC_PRIVATE_H__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangoft2-fontmap.c new/pango-1.48.0/pango/pangoft2-fontmap.c --- old/pango-1.46.2/pango/pangoft2-fontmap.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangoft2-fontmap.c 2020-11-08 15:29:15.000000000 +0100 @@ -52,13 +52,6 @@ double dpi_x; double dpi_y; - /* Function to call on prepared patterns to do final - * config tweaking. - */ - PangoFT2SubstituteFunc substitute_func; - gpointer substitute_data; - GDestroyNotify substitute_destroy; - PangoRenderer *renderer; }; @@ -117,9 +110,6 @@ if (ft2fontmap->renderer) g_object_unref (ft2fontmap->renderer); - if (ft2fontmap->substitute_destroy) - ft2fontmap->substitute_destroy (ft2fontmap->substitute_data); - G_OBJECT_CLASS (pango_ft2_font_map_parent_class)->finalize (object); FT_Done_FreeType (ft2fontmap->library); @@ -176,6 +166,9 @@ * the font. This function can be used to do things like set * hinting and antialiasing options. * + * Deprecated: 1.46: Use pango_fc_font_map_set_default_substitute() + * instead. + * * Since: 1.2 **/ void @@ -184,18 +177,8 @@ gpointer data, GDestroyNotify notify) { - fontmap->serial++; - if (fontmap->serial == 0) - fontmap->serial++; - - if (fontmap->substitute_destroy) - fontmap->substitute_destroy (fontmap->substitute_data); - - fontmap->substitute_func = func; - fontmap->substitute_data = data; - fontmap->substitute_destroy = notify; - - pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (fontmap)); + PangoFcFontMap *fcfontmap = PANGO_FC_FONT_MAP (fontmap); + pango_fc_font_map_set_default_substitute(fcfontmap, func, data, notify); } /** @@ -208,15 +191,15 @@ * That is, if your substitution function will return different * results for the same input pattern, you must call this function. * + * Deprecated: 1.46: Use pango_fc_font_map_substitute_changed() + * instead. + * * Since: 1.2 **/ void pango_ft2_font_map_substitute_changed (PangoFT2FontMap *fontmap) { - fontmap->serial++; - if (fontmap->serial == 0) - fontmap->serial++; - pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (fontmap)); + pango_fc_font_map_substitute_changed(PANGO_FC_FONT_MAP (fontmap)); } /** @@ -363,8 +346,8 @@ FcConfigSubstitute (NULL, pattern, FcMatchPattern); - if (ft2fontmap->substitute_func) - ft2fontmap->substitute_func (pattern, ft2fontmap->substitute_data); + if (fcfontmap->substitute_func) + fcfontmap->substitute_func (pattern, fcfontmap->substitute_data); if (FcPatternGet (pattern, FC_DPI, 0, &v) == FcResultNoMatch) FcPatternAddDouble (pattern, FC_DPI, ft2fontmap->dpi_y); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangoft2.h new/pango-1.48.0/pango/pangoft2.h --- old/pango-1.46.2/pango/pangoft2.h 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangoft2.h 2020-11-08 15:29:15.000000000 +0100 @@ -28,6 +28,7 @@ #include <ft2build.h> #include FT_FREETYPE_H +#include <pango/pangofc-fontmap.h> #include <pango/pango-layout.h> #include <pango/pangofc-font.h> @@ -67,7 +68,7 @@ * Function type for doing final config tweaking on prepared FcPatterns. */ typedef void (*PangoFT2SubstituteFunc) (FcPattern *pattern, - gpointer data); + gpointer data); /* Calls for applications */ @@ -115,14 +116,14 @@ void pango_ft2_font_map_set_resolution (PangoFT2FontMap *fontmap, double dpi_x, double dpi_y); -PANGO_AVAILABLE_IN_1_2 +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_IN_1_48_FOR(pango_fc_font_map_set_default_substitute) void pango_ft2_font_map_set_default_substitute (PangoFT2FontMap *fontmap, PangoFT2SubstituteFunc func, gpointer data, GDestroyNotify notify); -PANGO_AVAILABLE_IN_1_2 +PANGO_DEPRECATED_IN_1_48_FOR(pango_fc_font_map_substitute_changed) void pango_ft2_font_map_substitute_changed (PangoFT2FontMap *fontmap); -#ifndef PANGO_DISABLE_DEPRECATED PANGO_DEPRECATED_IN_1_22_FOR(pango_font_map_create_context) PangoContext *pango_ft2_font_map_create_context (PangoFT2FontMap *fontmap); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangoxft-fontmap.c new/pango-1.48.0/pango/pangoxft-fontmap.c --- old/pango-1.46.2/pango/pangoxft-fontmap.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangoxft-fontmap.c 2020-11-08 15:29:15.000000000 +0100 @@ -46,13 +46,6 @@ Display *display; int screen; - /* Function to call on prepared patterns to do final - * config tweaking. - */ - PangoXftSubstituteFunc substitute_func; - gpointer substitute_data; - GDestroyNotify substitute_destroy; - PangoRenderer *renderer; }; @@ -108,9 +101,6 @@ fontmaps = g_slist_remove (fontmaps, object); G_UNLOCK (fontmaps); - if (xftfontmap->substitute_destroy) - xftfontmap->substitute_destroy (xftfontmap->substitute_data); - G_OBJECT_CLASS (pango_xft_font_map_parent_class)->finalize (object); } @@ -297,6 +287,9 @@ * the font. This function can be used to do things like set * hinting and antialiasing options. * + * Deprecated: 1.46: Use pango_fc_font_map_set_default_substitute() + * instead. + * * Since: 1.2 **/ void @@ -308,18 +301,8 @@ { PangoXftFontMap *xftfontmap = (PangoXftFontMap *)pango_xft_get_font_map (display, screen); - xftfontmap->serial++; - if (xftfontmap->serial == 0) - xftfontmap->serial++; - - if (xftfontmap->substitute_destroy) - xftfontmap->substitute_destroy (xftfontmap->substitute_data); - - xftfontmap->substitute_func = func; - xftfontmap->substitute_data = data; - xftfontmap->substitute_destroy = notify; - - pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (xftfontmap)); + PangoFcFontMap *fcfontmap = PANGO_FC_FONT_MAP (xftfontmap); + pango_fc_font_map_set_default_substitute(fcfontmap, func, data, notify); } /** @@ -333,6 +316,9 @@ * That is, if your substitution function will return different * results for the same input pattern, you must call this function. * + * Deprecated: 1.46: Use pango_fc_font_map_substitute_changed() + * instead. + * * Since: 1.2 **/ void @@ -341,10 +327,7 @@ { PangoXftFontMap *xftfontmap = (PangoXftFontMap *)pango_xft_get_font_map (display, screen); - xftfontmap->serial++; - if (xftfontmap->serial == 0) - xftfontmap->serial++; - pango_fc_font_map_cache_clear (PANGO_FC_FONT_MAP (xftfontmap)); + pango_fc_font_map_substitute_changed(PANGO_FC_FONT_MAP (xftfontmap)); } void @@ -408,8 +391,8 @@ double d; FcConfigSubstitute (NULL, pattern, FcMatchPattern); - if (xftfontmap->substitute_func) - xftfontmap->substitute_func (pattern, xftfontmap->substitute_data); + if (fcfontmap->substitute_func) + fcfontmap->substitute_func (pattern, fcfontmap->substitute_data); XftDefaultSubstitute (xftfontmap->display, xftfontmap->screen, pattern); if (FcPatternGetDouble (pattern, FC_PIXEL_SIZE, 0, &d) == FcResultMatch && d == 0.0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/pangoxft.h new/pango-1.48.0/pango/pangoxft.h --- old/pango-1.46.2/pango/pangoxft.h 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/pangoxft.h 2020-11-08 15:29:15.000000000 +0100 @@ -23,6 +23,7 @@ #ifndef __PANGOXFT_H__ #define __PANGOXFT_H__ +#include <pango/pangofc-fontmap.h> #include <pango/pango-context.h> #include <pango/pango-ot.h> #include <pango/pangofc-font.h> @@ -85,7 +86,7 @@ * Function type for doing final config tweaking on prepared FcPatterns. */ typedef void (*PangoXftSubstituteFunc) (FcPattern *pattern, - gpointer data); + gpointer data); /* Calls for applications */ @@ -101,15 +102,17 @@ void pango_xft_shutdown_display (Display *display, int screen); -PANGO_AVAILABLE_IN_1_2 +#ifndef PANGO_DISABLE_DEPRECATED +PANGO_DEPRECATED_IN_1_48_FOR(pango_fc_font_map_set_default_substitute) void pango_xft_set_default_substitute (Display *display, int screen, PangoXftSubstituteFunc func, gpointer data, GDestroyNotify notify); -PANGO_AVAILABLE_IN_1_2 +PANGO_DEPRECATED_IN_1_48_FOR(pango_fc_font_map_substitute_changed) void pango_xft_substitute_changed (Display *display, int screen); +#endif PANGO_AVAILABLE_IN_ALL GType pango_xft_font_map_get_type (void) G_GNUC_CONST; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/pango/shape.c new/pango-1.48.0/pango/shape.c --- old/pango-1.46.2/pango/shape.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/pango/shape.c 2020-11-08 15:29:15.000000000 +0100 @@ -45,14 +45,18 @@ * @analysis: #PangoAnalysis structure from pango_itemize() * @glyphs: glyph string in which to store results * - * Given a segment of text and the corresponding - * #PangoAnalysis structure returned from pango_itemize(), - * convert the characters into glyphs. You may also pass - * in only a substring of the item from pango_itemize(). + * Given a segment of text and the corresponding #PangoAnalysis structure + * returned from pango_itemize(), convert the characters into glyphs. You + * may also pass in only a substring of the item from pango_itemize(). * * It is recommended that you use pango_shape_full() instead, since * that API allows for shaping interaction happening across text item * boundaries. + * + * Note that the extra attributes in the @analyis that is returned from + * pango_itemize() have indices that are relative to the entire paragraph, + * so you need to subtract the item offset from their indices before + * calling pango_shape(). */ void pango_shape (const gchar *text, @@ -83,6 +87,11 @@ * text of which @item_text is part of, provide the broader text as * @paragraph_text. If @paragraph_text is %NULL, item text is used instead. * + * Note that the extra attributes in the @analyis that is returned from + * pango_itemize() have indices that are relative to the entire paragraph, + * so you do not pass the full paragraph text as @paragraph_text, you need + * to subtract the item offset from their indices before calling pango_shape_full(). + * * Since: 1.32 */ void @@ -170,6 +179,12 @@ * This is similar to pango_shape_full(), except it also takes * flags that can influence the shaping process. * + * Note that the extra attributes in the @analyis that is returned from + * pango_itemize() have indices that are relative to the entire paragraph, + * so you do not pass the full paragraph text as @paragraph_text, you need + * to subtract the item offset from their indices before calling + * pango_shape_with_flags(). + * * Since: 1.44 */ void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/subprojects/freetype2.wrap new/pango-1.48.0/subprojects/freetype2.wrap --- old/pango-1.46.2/subprojects/freetype2.wrap 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/subprojects/freetype2.wrap 2020-11-08 15:29:15.000000000 +0100 @@ -1,12 +1,6 @@ -[wrap-file] -directory = freetype-2.9.1 - -source_url = https://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.gz -source_filename = freetype-2.9.1.tar.gz -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 - +[wrap-git] +directory=freetype2 +url=https://github.com/centricular/freetype2.git depth=1 +push-url=g...@github.com:centricular/freetype2.git +revision=meson diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/tests/gen-all-unicode.py new/pango-1.48.0/tests/gen-all-unicode.py --- old/pango-1.46.2/tests/gen-all-unicode.py 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/tests/gen-all-unicode.py 2020-11-08 15:29:15.000000000 +0100 @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import sys # From glib/gutf8.c: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/tests/gen-installed-test.py new/pango-1.48.0/tests/gen-installed-test.py --- old/pango-1.46.2/tests/gen-installed-test.py 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/tests/gen-installed-test.py 2020-11-08 15:29:15.000000000 +0100 @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import sys import argparse import os diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/tests/meson.build new/pango-1.48.0/tests/meson.build --- old/pango-1.46.2/tests/meson.build 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/tests/meson.build 2020-11-08 15:29:15.000000000 +0100 @@ -95,7 +95,6 @@ 'breaks/one', 'breaks/two', 'breaks/three', - 'breaks/four', ] if thai_dep.found() @@ -141,14 +140,13 @@ install_data(installed_test_items_data, install_dir: join_paths(installed_test_bindir, 'itemize')) endif -python = import('python3').find_python() gen_installed_test = files([ 'gen-installed-test.py' ]) gen_all_unicode = files([ 'gen-all-unicode.py' ]) custom_target('all-unicode', output: 'all-unicode.txt', command: [ - python, gen_all_unicode, '@OUTPUT@' + gen_all_unicode, '@OUTPUT@' ], install: get_option('install-tests'), install_dir: installed_test_bindir) @@ -161,7 +159,7 @@ custom_target(name + '.test', output: name + '.test', command: [ - python, gen_installed_test, + gen_installed_test, installed_test_bindir, name, '@OUTDIR@', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/tests/test-shape.c new/pango-1.48.0/tests/test-shape.c --- old/pango-1.46.2/tests/test-shape.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/tests/test-shape.c 2020-11-08 15:29:15.000000000 +0100 @@ -185,8 +185,6 @@ pango_attr_list_unref (itemize_attrs); pango_attr_list_unref (shape_attrs); - pango_attr_list_unref (attrs); - for (l = items; l; l = l->next) { PangoItem *item = l->data; @@ -232,7 +230,7 @@ if (i + 1 < glyphs->num_glyphs) p1 = text + item->offset + glyphs->log_clusters[i + 1]; else - p1 = g_utf8_next_char (p); + p1 = text + item->offset + item->length; } append_text (s1, p, p1 - p); g_string_append_printf (s2, "[%d]", gi->glyph); @@ -281,6 +279,8 @@ g_list_free_full (items, (GDestroyNotify)pango_item_free); g_free (contents); g_free (text); + + pango_attr_list_unref (attrs); } static gchar * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/utils/viewer-pangoft2.c new/pango-1.48.0/utils/viewer-pangoft2.c --- old/pango-1.46.2/utils/viewer-pangoft2.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/utils/viewer-pangoft2.c 2020-11-08 15:29:15.000000000 +0100 @@ -51,7 +51,7 @@ fontmap = pango_ft2_font_map_new (); pango_ft2_font_map_set_resolution (PANGO_FT2_FONT_MAP (fontmap), opt_dpi, opt_dpi); - pango_ft2_font_map_set_default_substitute (PANGO_FT2_FONT_MAP (fontmap), substitute_func, NULL, NULL); + pango_fc_font_map_set_default_substitute (PANGO_FC_FONT_MAP (fontmap), substitute_func, NULL, NULL); return fontmap; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pango-1.46.2/utils/viewer-pangoxft.c new/pango-1.48.0/utils/viewer-pangoxft.c --- old/pango-1.46.2/utils/viewer-pangoxft.c 2020-09-18 20:46:01.000000000 +0200 +++ new/pango-1.48.0/utils/viewer-pangoxft.c 2020-11-08 15:29:15.000000000 +0100 @@ -51,8 +51,8 @@ XftInit (NULL); - pango_xft_set_default_substitute (instance->display, instance->screen, - default_substitute, NULL, NULL); + pango_fc_font_map_set_default_substitute (PANGO_FC_FONT_MAP (pango_xft_get_font_map (instance->display, instance->screen)), + default_substitute, NULL, NULL); return instance; } ++++++ pango.obsinfo ++++++ --- /var/tmp/diff_new_pack.sjEkTv/_old 2020-11-23 10:37:57.393852308 +0100 +++ /var/tmp/diff_new_pack.sjEkTv/_new 2020-11-23 10:37:57.397852314 +0100 @@ -1,5 +1,5 @@ name: pango -version: 1.46.2 -mtime: 1600454761 -commit: 296711130ef90d9555bd6ada5b258bb75d622c12 +version: 1.48.0 +mtime: 1604845755 +commit: a39fea44c7c9f982fcca6d639929545dd3e09eb7 _______________________________________________ openSUSE Commits mailing list -- commit@lists.opensuse.org To unsubscribe, email commit-le...@lists.opensuse.org List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/commit@lists.opensuse.org