Commit Graph

79700 Commits

Author SHA1 Message Date
Matthias Clasen
42fc165b94 Add glyph hinting tests
Add tests that demonstrate different rendering with and without
hinting, to prove that hinting has an effect.
2024-03-02 18:41:06 -05:00
Matthias Clasen
20a4e3f351 Add glyph antialiasing test
This test checks that the antialias font option has the indended
effect.
2024-03-02 18:41:02 -05:00
Matthias Clasen
f3f90e1d71 Add a glyph scaling test
The glyph in this test has extents that will be made smaller
by hinting, which poses some challenge for our renderers.

The scaled glyph rendering is too big for the 'small texture'
text setup, so we allow the test to fail there.
2024-03-02 18:39:14 -05:00
Matthias Clasen
b018da2acd gsk: Accept font options in node files
The goal is to fix all the context that influences the rendering
of text nodes in the node file. This will help with better font
testing.

The newly accepted properties are

hint-style: none/slight/full
antialias: none/gray

We are omitting font options and values that aren't supported
in GSK or have no influence on the rendering.

Note that these settings will get incorporated in the PangoFont
that gets set on the resulting text node.

Parser tests included.
2024-03-02 18:39:14 -05:00
Matthias Clasen
ab5f3f59ce gsk: Use unhinted extents for text nodes
We need precise bounds. And while hinting might shift the rendering
around from these bounds by a fraction of a pixel, we account for
this in the places where it matters: when determining diff regions,
when sizing offscreens, and when determining the size of atlas
regions for glyphs.
2024-03-02 18:39:14 -05:00
Matthias Clasen
0127217e10 gsk: Add a way to get a (un)hinted font
Add a function to change the cairo font options of a font to
to the given values while keeping everything else the same.

We use pango api for this if available.

Note that this is not a fully general api, but tailored to the
needs of GSK. We don't allow setting hint-metrics (because it
only influences layout, not rendering) or subpixel-mode (since
we don't have component alpha available).
2024-03-02 18:39:14 -05:00
Matthias Clasen
16a476fe22 gsk: Stop passing scale to glyph upload op
It is always 1.0 now, so there is no point. Instead of the scale,
print the font when doing verbose logging.
2024-03-02 18:39:14 -05:00
Matthias Clasen
c8ca6930c5 gsk: Use a scaled font for glyph rendering
This changes the approach we take to rendering glyphs in the
presence of a scale transform: Instead of scaling the extents
and rendering to an image surface with device scale, simply
create a scaled font and use it for extents and rendering.

This avoids clipping problems with scaling of extents in
the presence of hinting.
2024-03-02 18:39:14 -05:00
Matthias Clasen
c4f33f36de gsk: Add a way to get a scaled font
Add a function to change the size of a font while keeping everything
else the same. We use pango api for this if available.
2024-03-02 18:39:14 -05:00
Matthias Clasen
0543c48862 NEWS: Updates 2024-03-02 18:27:33 -05:00
Yaron Shahrabani
fcb17a86e6 Update Hebrew translation 2024-03-02 22:15:37 +00:00
Yuri Chornoivan
5633b5b637 Update Ukrainian translation 2024-03-02 20:40:15 +00:00
Artur S0
f7eaf69d67 Update Russian translation 2024-03-02 19:55:29 +00:00
Piotr Drąg
32411943ea Update Polish translation 2024-03-02 17:08:11 +01:00
Jiri Grönroos
58fa5d7617 Update Finnish translation 2024-03-02 16:03:12 +00:00
Ekaterine Papava
f9ee1967f4 Update Georgian translation 2024-03-02 15:53:04 +00:00
Danial Behzadi
6a376f0a30 Update Persian translation 2024-03-02 15:32:03 +00:00
Piotr Drąg
66826c26db Update POTFILES.in 2024-03-02 16:19:28 +01:00
Matthias Clasen
8d1e37789e Merge branch 'broken-hexboxes' into 'main'
gsk: problems with hex boxes

See merge request GNOME/gtk!6963
2024-03-02 00:04:29 +00:00
Matthias Clasen
6c39a5946e Merge branch 'wip/chergert/for-main' into 'main'
gdk/gdkglcontext: include duration of eglSwapBuffers

See merge request GNOME/gtk!6964
2024-03-02 00:03:58 +00:00
Christian Hergert
2a98928286 gdk/gdkglcontext: include duration of eglSwapBuffers 2024-03-02 00:03:57 +00:00
Matthias Clasen
c7806eb908 gsk: Fix handling of hex boxes
The pango code that is drawing hex boxes, invisible glyphs, etc,
is depending on the width being set in the PangoGlyphInfo. Once
we set that, everything falls into place.

Testcase included.
2024-03-01 16:51:58 -05:00
Matthias Clasen
9015734e65 Merge branch 'matthiasc/for-main' into 'main'
gsk: Make glyph parsing more flexible

See merge request GNOME/gtk!6962
2024-03-01 17:49:46 +00:00
Matthias Clasen
f5159e1ecb gsk: Make glyph parsing more flexible
It is a bit annoying that one has to specify the glyph width
when specifying glyphs numerically for a text node, since this
information really is part of the font.

Make the parser more flexible, and allow to specify just the glyph
ids, without an explicit width. In this case, the width will be
determined from the font.

With this, glyphs can now be specified in any of the follwing
ways:

glyphs: "ABC";              (ASCII)
glyphs: 23, 45, 1001;       (Glyph IDs)
glyphs: 23 10, 100 11.1;    (Glyph IDs and advance widths)
glyphs: 23 10 1 2 color;    (with offsets and flags)

Tests have been updated to cover these variants.
2024-03-01 11:22:28 -05:00
Matthias Clasen
aec2f50d82 testsuite: Add a forgotten test 2024-03-01 09:23:41 -05:00
Matthias Clasen
74860f7602 Merge branch 'debug-flags-ubsan' into 'main'
gdkdisplay: Don’t call _get_instance_private(NULL)

See merge request GNOME/gtk!6961
2024-03-01 13:10:30 +00:00
Philip Withnall
a9175e0c03 gdkdisplay: Don’t call _get_instance_private(NULL)
While it’s documented as being safe, it triggers warnings from ubsan.
While we work out the best way to deal with that inside the
implementation of `G_ADD_PRIVATE` in GLib, let’s pragmatically just
short-circuit the code which triggers the warning here. This is helpful
because `gdk_display_get_debug_flags()` is called from a number of
locations within GTK, so is likely to be hit if anyone is running a UI
app under ubsan.

See https://gitlab.gnome.org/GNOME/glib/-/issues/3267#note_2033550

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/3267
2024-03-01 12:16:31 +00:00
Matthias Clasen
e1c56555af Merge branch 'camelCaseNick/editable-accessible-crash' into 'main'
a11y: support multiple levels of editable delegations in AT-SPI text

See merge request GNOME/gtk!6960
2024-03-01 04:12:23 +00:00
Matthias Clasen
24120c8fd0 Merge branch 'matthiasc/for-main' into 'main'
testsuite: Plug some leaks

See merge request GNOME/gtk!6959
2024-03-01 03:56:06 +00:00
Markus Göllnitz
f284331f79 a11y: support multiple levels of editable delegations in AT-SPI text
Gtk.Editable.get_delegate is allowed to return another
delegating Gtk.Editable. However, the AT-SPI text
implementationn for Gtk.Editables does not handle
delegate chaining.

In the wild, you will find a Gtk.Text as the delegate of
a Gtk.SpinButton, that is in turn the delegate of an
Adw.SpinRow in libadwaita.

Note: This does not handle the more dangerous possibility
of a delegate loop when built with G_DISABLE_ASSERT,
otherwise stops after the arbitrarily chosen number of
six steps of delegation.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2024-03-01 04:14:58 +01:00
Matthias Clasen
a82de96e1a Add a testsuite for nodeparser tests
This helps when changing the node parser.
2024-02-29 21:59:04 -05:00
Matthias Clasen
eba9b116ed Merge branch 'camelCaseNick/text-accessible-segv' into 'main'
a11y: handle no selection ranges for AT-SPI text

Closes #6488

See merge request GNOME/gtk!6958
2024-02-29 03:52:10 +00:00
Markus Göllnitz
1f89b3c7df a11y: handle no selection ranges for AT-SPI text 2024-02-29 03:52:10 +00:00
Matthias Clasen
c739b9fe7f Merge branch 'wip/kabus/misc-leaks2' into 'main'
general: Fix leaks

See merge request GNOME/gtk!6951
2024-02-28 12:35:02 +00:00
Matthias Clasen
556b729b97 Merge branch 'matthiasc/for-main' into 'main'
gsk: Serialize fonts with absolute size

See merge request GNOME/gtk!6953
2024-02-28 12:08:59 +00:00
Matthias Clasen
9fd5558acd Update nodeparser tests
The node serialization code now prints fonts with pixel sizes.
Update affected tests.
2024-02-27 23:46:33 -05:00
Matthias Clasen
b7422c0f62 nodeparser: Change default font
Use Cantarell 15px instead of Cantarell 11, ot make roundtrip
tests easier to read.
2024-02-27 23:45:46 -05:00
Emmanuele Bassi
ace684c7ab Merge branch 'wip/chergert/for-main' into 'main'
a11y/atspi: make TextCaretMoved match GTK 3 / ATK

See merge request GNOME/gtk!6956
2024-02-28 01:15:53 +00:00
Christian Hergert
752e704e99 accessibletext: handle NULL gracefully from get_contents_at()
This fixes a g_critical() internally with GtkTextView when running orca.
2024-02-27 16:40:48 -08:00
Christian Hergert
8c7e13746b a11y/atspi: make TextCaretMoved match GTK 3 / ATK
When testing VTE on GTK 3 using ATK, the variant parameter is <0> instead
of <''> on the wire. Make that match to increase the chances that tooling
will hit the same expectations.
2024-02-27 16:35:29 -08:00
Matthias Clasen
c2311c7154 gsk: Serialize fonts with absolute size
This is more often what we want. Our testcases tend to have
pixel sizes, and we want to preserve then when resaving the
test files.
2024-02-27 14:10:10 -05:00
Khalid Abu Shawarib
44fa748826 general: Fix leaks 2024-02-27 22:01:41 +03:00
Matthias Clasen
dfed398371 Merge branch 'gtk4-edge-tiling-resize-fix' into 'main'
[gtk4/wayland] Infer edge constraints from tiled edges.

See merge request GNOME/gtk!6745
2024-02-27 17:39:04 +00:00
Matthias Clasen
962ba49a8e Merge branch 'wip/chergert/for-main' into 'main'
textview: always set n_ranges out parameter

See merge request GNOME/gtk!6950
2024-02-27 02:19:40 +00:00
Christian Hergert
5811e443f8 textview: always set n_ranges out parameter 2024-02-26 17:49:03 -08:00
Aurimas Černius
f55e1392d4 Update Lithuanian translation 2024-02-26 20:56:00 +00:00
Daniel Mustieles
0fbe5ba40c Update Spanish translation 2024-02-26 15:25:40 +00:00
Matthias Clasen
980ea63d78 Merge branch 'video-cursor-timeout' into 'main'
video: Install the hide cursor timeout later

Closes #6264

See merge request GNOME/gtk!6948
2024-02-26 14:45:02 +00:00
Simon McVittie
85cf995af7 testsuite: Force Mesa to use software GL when asserting about stderr
In an autobuilder environment, there will typically be no hardware GPU
available, so Mesa will fall back from hardware to Zink to software
rendering. Unfortunately, Zink logs to stderr during loading if no
hardware GPUs are available. This particular test asserts that stderr
has desired contents, which means Zink's extra output causes the test
to fail. We can bypass this by disabling use of Zink.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/6478
Signed-off-by: Simon McVittie <smcv@debian.org>
2024-02-26 13:23:11 +00:00
Matthias Clasen
dcc3533363 video: Install the hide cursor timeout later
We were installing the timeout in root, but removing it in unmap,
which could lead to trouble if we ever dispose a GtkVideo widget
without mapping it.

Fixes: #6264
2024-02-26 08:17:27 -05:00