Skip to content
Commits on Source (39)
......@@ -13,6 +13,7 @@ export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
export G_SLICE=always-malloc
meson test -C ${builddir} \
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
--print-errorlogs \
--suite=pango
......
Overview of changes in 1.50.6, 19-03-2022
=========================================
- Drop hb-glib dependency
- Fix test font configuration
- Maintain order in pango_attr_list_change
- Fix a use-after-free in pango_attr_list_change
Overview of changes in 1.50.5, 03-03-2022
=========================================
* Fix compiler warnings
* Enable cairo by default
* pango-view: Show more baselines
* layout: Handle baselines
* Windows: build cleanups
Overview of changes in 1.50.4, 09-02-2022
=========================================
* Tweak synthetic space sizes
......
......@@ -49,7 +49,7 @@ pango_content_files = [
doc_conf = configuration_data()
doc_conf.set('PANGO_VERSION', meson.project_version())
docs_dir = pango_datadir / 'doc/pango/reference'
docs_dir = pango_datadir / 'doc'
pango_toml = configure_file(input: 'pango.toml.in',
output: 'pango.toml',
......
project('pango', 'c', 'cpp',
version: '1.50.4',
version: '1.50.6',
license: 'LGPLv2.1+',
default_options: [
'buildtype=debugoptimized',
......@@ -268,40 +268,14 @@ endif
# pkg-config files for them
cairo_pc = ''
cairo_lib = ''
harfbuzz_pc=''
freetype2_pc=''
fontconfig_pc=''
harfbuzz_lib=''
fontconfig_lib=''
harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req_version, required: false)
if harfbuzz_dep.found()
harfbuzz_pc = 'harfbuzz'
else
if cc.get_id() == 'msvc' and cc.has_header('hb.h')
# The CMake build files for HarfBuzz (which is used for MSVC builds) do not
# generate pkg-config files, so look for harfbuzz.lib. Ensure that we
# we look for HarfBuzz 2.0.0 or later.
harfbuzz_lib = cc.find_library('harfbuzz', required: false)
if harfbuzz_lib.found()
if cc.has_function('hb_ot_tags_from_script_and_language', dependencies: harfbuzz_lib)
harfbuzz_dep = harfbuzz_lib
endif
endif
endif
endif
# Remove when Meson acquires ability to declare deps declaratively, or
# when finding dependencies via CMake files is fixed.
if not harfbuzz_dep.found()
harfbuzz_dep = dependency('harfbuzz', version: harfbuzz_req_version,
fallback: ['harfbuzz', 'libharfbuzz_dep'],
default_options: ['coretext=enabled'])
endif
if not harfbuzz_dep.found()
error('harfbuzz not found')
endif
harfbuzz_dep = dependency('harfbuzz',
version: harfbuzz_req_version,
required: true,
fallback: ['harfbuzz', 'libharfbuzz_dep'],
default_options: ['coretext=enabled'])
pango_deps += harfbuzz_dep
......@@ -322,9 +296,6 @@ else
# Look for the Visual Studio-style import library if FontConfig's .pc file cannot be
# found on Visual Studio
fontconfig_dep = cc.find_library('fontconfig', required: fontconfig_option)
if fontconfig_dep.found()
fontconfig_lib = '-lfontconfig'
endif
endif
endif
......@@ -365,33 +336,21 @@ 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
freetype_dep = dependency('freetype2', required: freetype_option)
# The first version of freetype with a pkg-config file is 2.1.5,
# CMake uses 'freetype' rather than 'freetype2' for the package name
freetype_package_name = cc.get_argument_syntax() == 'msvc' ? \
'freetype' : 'freetype2'
if freetype_dep.found()
freetype2_pc = 'freetype2'
else
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: freetype_option)
if freetype_dep.found()
freetype2_lib = '-l@0@'.format(ft2_lib)
endif
endif
endforeach
endif
endif
freetype_dep = dependency(freetype_package_name,
required: freetype_option,
fallback: ['freetype2', 'freetype_dep'])
# 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'])
if freetype_dep.found() and freetype_dep.type_name() == 'pkgconfig'
freetype2_pc = 'freetype2'
endif
# To build pangoft2, we need HarfBuzz, FontConfig and FreeType
build_pangoft2 = harfbuzz_dep.found() and fontconfig_dep.found() and freetype_dep.found()
build_pangoft2 = fontconfig_dep.found() and freetype_dep.found()
if build_pangoft2
pango_conf.set('HAVE_FREETYPE', 1)
pango_deps += freetype_dep
......@@ -445,8 +404,7 @@ endif
# 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'),
default_options: ['freetype=enabled', 'fontconfig=enabled'])
fallback: ['cairo', 'libcairo_dep'], required: get_option('cairo'))
cairo_found_type = cairo_dep.type_name()
endif
......
......@@ -25,7 +25,7 @@ option('libthai',
description : 'Build with libthai support')
option('cairo',
type : 'feature',
value : 'auto',
value : 'enabled',
description : 'Build with cairo support')
option('xft',
type : 'feature',
......
......@@ -136,18 +136,10 @@ if build_gir
gir_args = [
'--quiet',
]
harfbuzz_gobject_dep = dependency('harfbuzz-gobject', version: harfbuzz_req_version, required: false)
if not harfbuzz_gobject_dep.found() and cc.get_argument_syntax() == 'msvc'
# The CMake build files for HarfBuzz (which is used for MSVC builds) do not
# generate pkg-config files, so look for harfbuzz-gobject.lib
harfbuzz_gobject_dep = cc.find_library('harfbuzz-gobject', has_headers: ['hb-gobject.h'], required: false)
endif
if not harfbuzz_gobject_dep.found()
harfbuzz_gobject_dep = dependency('harfbuzz-gobject', version: harfbuzz_req_version, required: false,
fallback: ['harfbuzz', 'libharfbuzz_gobject_dep'])
endif
harfbuzz_gobject_dep = dependency('harfbuzz-gobject',
version: harfbuzz_req_version,
required: false,
fallback: ['harfbuzz', 'libharfbuzz_gobject_dep'])
if harfbuzz_gobject_dep.found()
pango_deps += harfbuzz_gobject_dep
......
......@@ -2157,6 +2157,9 @@ pango_attr_list_change (PangoAttrList *list,
if (tmp_attr->klass->type != attr->klass->type)
continue;
if (tmp_attr == attr)
continue;
if (tmp_attr->end_index <= attr->end_index ||
pango_attribute_equal (tmp_attr, attr))
{
......@@ -2184,6 +2187,9 @@ pango_attr_list_change (PangoAttrList *list,
if (tmp_attr2->start_index >= tmp_attr->start_index)
break;
g_ptr_array_index (list->attributes, k - 1) = tmp_attr2;
g_ptr_array_index (list->attributes, k) = tmp_attr;
}
}
}
......
......@@ -6694,6 +6694,12 @@ apply_baseline_shift (PangoLayoutLine *line,
{
int y_offset = 0;
PangoItem *prev = NULL;
hb_position_t baseline_adjustment = 0;
#if HB_VERSION_ATLEAST(4,0,0)
hb_ot_layout_baseline_tag_t baseline_tag = 0;
hb_position_t baseline;
hb_position_t run_baseline;
#endif
for (GSList *l = line->runs; l; l = l->next)
{
......@@ -6701,16 +6707,71 @@ apply_baseline_shift (PangoLayoutLine *line,
PangoItem *item = run->item;
int start_x_offset, end_x_offset;
int start_y_offset, end_y_offset;
#if HB_VERSION_ATLEAST(4,0,0)
hb_font_t *hb_font;
hb_script_t script;
hb_language_t language;
hb_direction_t direction;
hb_tag_t script_tags[HB_OT_MAX_TAGS_PER_SCRIPT];
hb_tag_t lang_tags[HB_OT_MAX_TAGS_PER_LANGUAGE];
unsigned int script_count = HB_OT_MAX_TAGS_PER_SCRIPT;
unsigned int lang_count = HB_OT_MAX_TAGS_PER_LANGUAGE;
hb_font = pango_font_get_hb_font (item->analysis.font);
script = (hb_script_t) g_unicode_script_to_iso15924 (item->analysis.script);
language = hb_language_from_string (pango_language_to_string (item->analysis.language), -1);
hb_ot_tags_from_script_and_language (script, language,
&script_count, script_tags,
&lang_count, lang_tags);
if (item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE)
direction = HB_DIRECTION_TTB;
else
direction = HB_DIRECTION_LTR;
if (baseline_tag == 0)
{
if (item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE)
baseline_tag = HB_OT_LAYOUT_BASELINE_TAG_IDEO_EMBOX_CENTRAL;
else
baseline_tag = hb_ot_layout_get_horizontal_baseline_tag_for_script (script);
hb_ot_layout_get_baseline_with_fallback (hb_font,
baseline_tag,
direction,
script_tags[script_count - 1],
lang_count ? lang_tags[lang_count - 1] : HB_TAG_NONE,
&run_baseline);
baseline = run_baseline;
}
else
{
hb_ot_layout_get_baseline_with_fallback (hb_font,
baseline_tag,
direction,
script_tags[script_count - 1],
lang_count ? lang_tags[lang_count - 1] : HB_TAG_NONE,
&run_baseline);
}
/* Don't do baseline adjustment in vertical, since the renderer
* is still doing its own baseline shifting there
*/
if (item->analysis.flags & PANGO_ANALYSIS_FLAG_CENTERED_BASELINE)
baseline_adjustment = 0;
else
baseline_adjustment = baseline - run_baseline;
#endif
collect_baseline_shift (state, item, prev, &start_x_offset, &start_y_offset, &end_x_offset, &end_y_offset);
y_offset += start_y_offset;
y_offset += start_y_offset + baseline_adjustment;
run->y_offset = y_offset;
run->start_x_offset = start_x_offset;
run->end_x_offset = end_x_offset;
y_offset += end_y_offset;
y_offset += end_y_offset - baseline_adjustment;
prev = item;
}
......
......@@ -51,10 +51,20 @@ The following keys are used, if found:
``description`` = ``s``
A short description of the library.
``dependencies`` = ``dict(s, dict(s, s)``
``dependencies`` = ``dict(s, dict(s, s))``
A dictionary of dependencies; each entry in the dictionary has a key in the
form of ``{namespace}-{version}``, and values in the form of a dictionary
with the following keys: ``name``, ``description``, and ``docs_url``.
with the following keys: ``name``, ``description``, and ``docs_url``. Each
entry in the this dictionary can only describe a namespace included in the
introspection data; any other namespace listed here will be ignored. See
the ``related`` configuration below.
``related`` = ``dict(s, dict(s, s))``
A dictionary of related namespaces; each entry in the dictionary has a key
in the form of ``{namespace}-{version}``, and values in the form of a
dictionary with the following keys: ``name``, ``description``, and
``docs_url``. Each entry in this dictionary can describe a namespace that
is related to the project.
``devhelp`` = ``b``
Whether gi-docgen should generate a DevHelp file for the namespace.
......
......@@ -107,6 +107,24 @@ class GIDocConfig:
return retval
@property
def related(self):
library = self._config.get('library', None)
if library is None:
return {}
retval = {}
dependencies = self._config.get('related', {})
for gir_name, dep in dependencies.items():
res = {}
res['name'] = dep.get('name', 'Unknown')
res['description'] = dep.get('description', 'No description provided')
res['docs_url'] = dep.get('docs_url', '#')
retval[gir_name] = res
log.debug(f"Found related library {gir_name}: {res}")
return retval
@property
def devhelp(self):
return self.library.get('devhelp', False)
......
# SPDX-FileCopyrightText: 2020 GNOME Foundation <https://gnome.org>
# SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
version = "2021.9"
version = "2022.2"
......@@ -840,6 +840,19 @@ class TemplateMethod:
self.introspectable = method.introspectable
self.shadows = method.shadows
if method.shadows:
for m in type_.methods:
if m.name == method.shadows:
self.shadows_symbol = m.identifier
break
self.shadowed_by = method.shadowed_by
if method.shadowed_by:
for m in type_.methods:
if m.name == method.shadowed_by:
self.shadowed_by_symbol = m.identifier
break
def transform_property_attribute(namespace, type_, method, value):
if value in type_.properties:
text = f"{namespace.name}.{type_.name}:{value}"
......@@ -1049,6 +1062,17 @@ class TemplateFunction:
self.introspectable = func.introspectable
self.shadows = func.shadows
if func.shadows:
f = namespace.find_function(func.shadows)
if f is not None:
self.shadows_symbol = f.identifier
self.shadowed_by = func.shadowed_by
if func.shadowed_by:
f = namespace.find_function(func.shadowed_by)
if f is not None:
self.shadowed_by_symbol = f.identifier
@property
def c_decl(self):
res = []
......@@ -2769,7 +2793,7 @@ def gen_devhelp(config, repository, namespace, symbols, content_files):
keyword = etree.SubElement(functions, "keyword")
keyword.set("type", "constant")
keyword.set("name", t.identifier)
keyword.set("link", f"constant.{t.name}.html")
keyword.set("link", f"const.{t.name}.html")
if t.available_since is not None:
keyword.set("since", t.available_since)
if t.deprecated_since is not None and t.deprecated_since["version"] is not None:
......
......@@ -77,6 +77,9 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
<tr><td>Deprecated since:</td><td>{{ class_method.deprecated_since.version }}</td></tr>
<tr><td colspan="2">{{ class_method.deprecated_since.message }}</td></tr>
{% endif %}
{% if not class_method.introspectable %}
<tr><td>This class method is not directly available to language bindings</td></tr>
{% endif %}
</table>
</div>
......
......@@ -79,6 +79,9 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
<tr><td>Deprecated since:</td><td>{{ type_func.deprecated_since.version }}</td></tr>
<tr><td colspan="2">{{ type_func.deprecated_since.message }}</td></tr>
{% endif %}
{% if not type_func.introspectable %}
<tr><td>This constructor is not directly available to language bindings</td></tr>
{% endif %}
</table>
</div>
......
......@@ -84,6 +84,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
<tr><td>Deprecated since:</td><td>{{ func.deprecated_since.version }}</td></tr>
<tr><td colspan="2">{{ func.deprecated_since.message }}</td></tr>
{% endif %}
{% if not func.introspectable %}
<tr><td>This function is not directly available to language bindings</td></tr>
{% endif %}
{% if func.shadows %}
<tr><td>This function is renamed to <a href="func.{{func.shadows}}.html"><code>{{func.shadows_symbol}}()</code></a> in language bindings</td></tr>
{% endif %}
{% if func.shadowed_by %}
<tr><td>The implementation of this function is provided by <a href="func.{{func.shadowed_by}}.html"><code>{{func.shadowed_by_symbol}}()</code></a> in language bindings</td></tr>
{% endif %}
</table>
</div>
......
......@@ -79,6 +79,15 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
<tr><td>Deprecated since:</td><td>{{ method.deprecated_since.version }}</td></tr>
<tr><td colspan="2">{{ method.deprecated_since.message|safe }}</td></tr>
{% endif %}
{% if not method.introspectable %}
<tr><td>This method is not directly available to language bindings.</td></tr>
{% endif %}
{% if method.shadows %}
<tr><td>This method is renamed to <a href="method.{{class.name}}.{{method.shadows}}.html"><code>{{method.shadows_symbol}}()</code></a> in language bindings</td></tr>
{% endif %}
{% if method.shadowed_by %}
<tr><td>The implementation of this method is provided by <a href="method.{{class.name}}.{{method.shadowed_by}}.html"><code>{{method.shadowed_by_symbol}}()</code></a> in language bindings</td></tr>
{% endif %}
</table>
</div>
......
......@@ -83,7 +83,7 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
</div>
</header>
{% if CONFIG.dependencies|length > 0 %}
{% if repository.includes %}
<section>
<div class="toggle-wrapper">
<h4 id="dependencies" style="display:flex;">
......@@ -93,14 +93,42 @@ SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
<div class="docblock">
<table>
{% for gir_name, dep in CONFIG.dependencies.items() %}
{% for ns_name, repo in repository.includes.items() %}
{% for _, lib in CONFIG.dependencies.items() if lib.name == repo.namespace.name %}
<tr>
<td><strong>{{ dep.name }}</strong></td>
<td>{{ dep.description }}</td>
<td><strong>{{ repo.namespace.name }}</strong>&mdash;{{ repo.namespace.version }}</td>
<td>{{ lib.description }}</td>
</tr>
<tr>
<td></td>
<td><a href="{{ dep.docs_url }}" class="external">Browse documentation</a></td>
<td><a href="{{ lib.docs_url }}" class="external">Browse documentation</a></td>
</tr>
{% endfor %}
{% endfor %}
</table>
</div>
</div>
</section>
{% endif %}
{% if CONFIG.related|length > 0 %}
<section>
<div class="toggle-wrapper">
<h4 id="related" style="display:flex;">
Related libraries
<a href="#related" class="anchor"></a>
</h4>
<div class="docblock">
<table>
{% for gir_name, lib in CONFIG.related.items() %}
<tr>
<td><strong>{{ lib.name }}</strong></td>
<td>{{ lib.description }}</td>
</tr>
<tr>
<td></td>
<td><a href="{{ lib.docs_url }}" class="external">Browse documentation</a></td>
</tr>
{% endfor %}
</table>
......
......@@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
project('gi-docgen',
version: '2021.9',
version: '2022.2',
meson_version: '>= 0.55.0',
)
......
......@@ -8,7 +8,7 @@ if sys.version_info < (3, 6, 0):
from gidocgen.core import version
from distutils.command.build_py import build_py as _build_py
from setuptools.command.build_py import build_py as _build_py
from setuptools import setup
......
......@@ -2,7 +2,7 @@
directory=gobject-introspection
url=https://gitlab.gnome.org/GNOME/gobject-introspection.git
push-url=ssh://git@gitlab.gnome.org:GNOME/gobject-introspection.git
revision=master
revision=main
depth=1
[provide]
......