Commit Graph

79693 Commits

Author SHA1 Message Date
Emmanuele Bassi
644e6f8ebe Consolidate TextView/TextBuffer attribute serialization
Use dictionaries of string pairs instead of abusing GVariant; we can
convert the dictionary into a GVariant when we send the data over the
wire.
2024-03-04 19:13:29 +00:00
Matthias Clasen
0b4c695d65 Merge branch 'hinting-proper-positioning' into 'main'
gsk: Handle hinted fonts better

Closes #6502

See merge request GNOME/gtk!6966
2024-03-03 23:27:00 +00:00
Matthias Clasen
448287bd58 Merge branch 'camelCaseNick/a11y-text-contents-at' into 'main'
a11y: implement get_contents_at for Gtk.Text, Gtk.TextView, Gtk.Inscription

See merge request GNOME/gtk!6971
2024-03-03 23:03:13 +00:00
Benjamin Otte
5e6aff69c6 Merge branch 'wip/otte/for-main' into 'main'
demos: shadertoy only handles GL

See merge request GNOME/gtk!6976
2024-03-03 22:38:22 +00:00
Benjamin Otte
d88e616711 demos: shadertoy only handles GL
If somebody wants to add GLES support, go for it.

For now we enforce GL.
2024-03-03 22:20:44 +00:00
Aurimas Černius
0e5c94a094 Update Lithuanian translation 2024-03-03 20:47:02 +00:00
Brage Fuglseth
bb0aeec99c Update Norwegian Bokmål translation 2024-03-03 20:08:02 +00:00
Matthias Clasen
880e3ef289 Add tests for glyph positioning
These tests check that we round glyph positions to integral device
pixel coordinates when hinting is enabled, and to device subpixel
positions if it isn't.
2024-03-03 14:28:19 -05:00
Sabri Ünal
94a09263d7 Update Turkish translation 2024-03-03 18:22:30 +00:00
Markus Göllnitz
ab9106ac89 testsuite: test for implementation of accessible_text_get_contents_at
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2024-03-03 19:13:40 +01:00
Markus Göllnitz
ff6451a77e a11y: implement get_contents_at for Gtk.TextView
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2024-03-03 19:13:40 +01:00
Matthias Clasen
4f2d63b8ac gsk: Handle hinted fonts better
Enforce the following rules:
- No hinting or subpixel positioning in transformed context
- glyph-align determines if we use integral or fractional
  device pixel positions
- For hinting, always use an integral y position (the hinter
  assumes integral positions, and only operates vertically).
2024-03-03 13:08:29 -05:00
Matthias Clasen
81c97f0910 gsk: Add a private helper
Add a function to get the hint style of a font.
2024-03-03 13:08:29 -05:00
Matthias Clasen
d1b52cc292 gsk: Preserve the antialiasing setting of the font
When we get an unhinted font for text node extents, don't change
the antialiasing setting. It doesn't affect the extents we get
here, but if we later need an unhinted font for rendering, the
one we create this way will be the right one, so it will already
exist.
2024-03-03 13:08:29 -05:00
Matthias Clasen
ddedb39329 gsk: Tweak gsk_get_hinted_font slightly
Make it possible to preserve some of the fonts original options.
2024-03-03 13:08:29 -05:00
Matthias Clasen
d45987e637 Merge branch 'fallback-to-gl+llvmpipe' into 'main'
Don't fall back to cairo for software rendering

See merge request GNOME/gtk!6975
2024-03-03 17:54:07 +00:00
Matthias Clasen
b95eceea60 Don't fall back to cairo for software rendering
The experience with gl+llvmpipe is not great, in particular on
fractional scales. But it is less broken than cairo in that
situation.
2024-03-03 12:28:20 -05:00
Emmanuele Bassi
2774e80fc4 a11y: Ensure that attributes are unique before sending them
The default attributes are overridden by the run attributes.
2024-03-03 17:08:39 +00:00
Matthias Clasen
7c207c4868 Merge branch 'matthiasc/for-main' into 'main'
Improve subpixel positioning tests

See merge request GNOME/gtk!6974
2024-03-03 16:33:46 +00:00
Matthias Clasen
c6c8abcf21 Improve subpixel positioning tests
We want to test subpixel positioning, so turn off hinting, since
hinting and subpixel positioning are opposing forces.

This does not currently change test outcomes, but it will prevent
the tests from breaking in the future when we make changes to
improve hinting.
2024-03-03 11:19:04 -05:00
Emmanuele Bassi
a59c967675 a11y: Implement AtspiText.GetDefaultAttributes
The new GtkAccessibleText.get_default_attributes() vfunc gives us the
ability to implement this AT-SPI method.
2024-03-03 15:17:53 +00:00
Emmanuele Bassi
c3329f5fcc a11y: Implement AtspiText.GetAttributeRun for AccessibleText
GetAttributeRun works like GetAttributes, but it allows including the
default text attributes.

See: !6971, GNOME/orca#477
2024-03-03 15:17:53 +00:00
Emmanuele Bassi
4f06e46759 a11y: Implement get_default_attributes for TextView 2024-03-03 15:17:53 +00:00
Emmanuele Bassi
7e522a8c55 a11y: Implement get_default_attributes for Text 2024-03-03 15:17:52 +00:00
Emmanuele Bassi
d9447fd2e7 a11y: Implement get_default_attributes for Label 2024-03-03 15:17:52 +00:00
Emmanuele Bassi
95214f3697 a11y: Implement get_default_attributes for Inscription 2024-03-03 15:17:52 +00:00
Emmanuele Bassi
fe64c998f8 a11y: Add GtkAccessibleText.get_default_attributes
Accessible text attributes come in two flavours:

- the run attributes, which apply to a text from a given offset
- the default attributes, which apply to the whole text

The default attributes are used to gather the initial values for every
text attribute, while the run attributes operate additively.

We currently have a getter for the former, but we lack one for the
latter.
2024-03-03 15:17:52 +00:00
Markus Göllnitz
84582ad762 a11y: implement get_contents_at for Gtk.Inscription
Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2024-03-03 15:52:26 +01:00
Matthias Clasen
fcc7a58058 Merge branch 'gst-cmp-float' into 'main'
gstreamer: Use G_APPROX_VALUE to compare floats

See merge request GNOME/gtk!6972
2024-03-03 14:16:47 +00:00
Matthias Clasen
8a48becb7e Cosmetics 2024-03-03 08:56:32 -05:00
Robert Mader
465446430e gstreamer: Use G_APPROX_VALUE to compare floats
Mainly to silence compiler warnings.
2024-03-03 14:35:27 +01:00
Luming Zh
4060c43ae7 Update Chinese (China) translation 2024-03-03 11:17:20 +00:00
Markus Göllnitz
4ec9a2a330 a11y: implement get_contents_at for Gtk.Text
There are users of GetStringAtOffset, such as Orca.

Signed-off-by: Markus Göllnitz <camelcasenick@bewares.it>
2024-03-03 04:37:01 +01:00
Matthias Clasen
90c017a762 Merge branch 'matthiasc/for-main' into 'main'
Grr, vulkan

See merge request GNOME/gtk!6970
2024-03-03 03:03:19 +00:00
Matthias Clasen
e011434223 Update tests for version number bump 2024-03-02 22:02:36 -05:00
Matthias Clasen
b1ccb4103d Grr, vulkan
The can always make it worse with another define.
2024-03-02 21:47:49 -05:00
Matthias Clasen
8033809f8b Merge branch 'matthiasc/for-main' into 'main'
vulkan: Add another error code

See merge request GNOME/gtk!6969
2024-03-03 01:26:44 +00:00
Matthias Clasen
66ba1f76ba vulkan: Add another error code
Handle VK_ERROR_INVALID_VIDEO_STD_PARAMETERS_KHR.
2024-03-02 20:20:16 -05:00
Matthias Clasen
0ca822c716 Merge branch 'matthiasc/for-main' into 'main'
4.13.9

See merge request GNOME/gtk!6968
2024-03-03 00:57:14 +00:00
Matthias Clasen
4ac288c1b4 Post-release version build 2024-03-02 19:56:09 -05:00
Matthias Clasen
64316ab185 4.13.9 2024-03-02 19:30:26 -05:00
Matthias Clasen
4d90a693ae Merge branch 'scaled-font' into 'main'
gsk: Use a scaled font for glyph rendering

See merge request GNOME/gtk!6936
2024-03-03 00:23:43 +00:00
Matthias Clasen
0c5f943783 Merge branch 'matthiasc/for-main' into 'main'
NEWS: Updates

See merge request GNOME/gtk!6967
2024-03-02 23:54:29 +00:00
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