We blindly assume everywhere that a single glyph will definitely fit on
one atlas, but that's not always the case.
For now, don't crash or produce GL errors.
Instead of only allowing for glyph indexes, allow ASCII characters as
replacements. So this glyph sequence
glyphs: 65 8, 66 8, 67 8
Can be replaced by
glyphs: "ABC"
provided that the glyph for "A", "B" and "C" are 65, 66 and 67
respectively and their advance is exactly 8.
x offset and y offset must always be 0 and every glyph must start a
cluster.
Update to the docs outlined in #1887.
In particular, the changes do:
1. Require no property, have a working default for everything
2. Be clear about what gets printed and how.
Tests ahve been adapted to still pass.
Base the rewrite on testsuite/css/parser/test-css-parser - we now
require the node file to match a reference node and track the errors it
triggers.
We also no longer use gtester.
When printing, behave the same way as when parsing:
Magically skip a container node if there is one - just like the
parser magically creates a container node to hold all the nodes
it parses.
We can't just pretend we have an identity matrix when we are actually
scaling. This fixes the node editor sometimes not drawing things when
rendering to a texture. We were mistakenly discaring render nodes
because the bounds transformation was wrong.
We stuff both gl-drawn and cairo-drawn textures into the same cache, so
we can't really assume that we need to draw any of them flipped or not.
Fix this by drawing fallback stuff upside down and then using
upside-down vertex data for everything.
Fixes#1897
We don't want to return a GFile because GFile can't handle can't deal
with data: urls.
That makes the code a bit more complicated that doesn't deal with those
URLs, but it makes the other code actually work.
GtkCssImageUrl also now decodes data urls immediately instead of only at
the first load. So don't use data urls if you care about performance.
Instead of encoding the raw data, encode the full image to a PNG.
And instead of stuffing that encoding into a string, use a full
data: url.
And then remove the width and height properties, because they're now
implicitly included in the data.
And then change the parser to match.
And because the parser now parses regular urls on top of data: urls, we
can now load any random file.
Instead of the previous approach using GVariant, this new approach uses
human-readable text files as the serialization format for render nodes.
The format is a custom one, but it is inspired by QML and conforms to
the CSS syntax. Because of that, we can use the CSS machinery from GTK
to parse it, and in particular share code to parse properties that GTK's
CSS machinery also supports, such as colors.
This commit breaks all existing usages of node files - such as the
testsuite and various test tools - they will be fixed in further
commits.