Behdad Esfahbod
9f7538c260
[hb-cairo] Change API
2 years ago
Matthias Clasen
0d6ee4621e
wip: Make hb-view use hb-cairo
...
This is a quick hack to prove that the
hb-cairo apis work
2 years ago
Behdad Esfahbod
5f168db884
[hb-view] Build with autotools if cairo-ft is not available
...
Like with meson.
2 years ago
Behdad Esfahbod
6ccbfabd4f
[paint] Return bool from paint_image()
...
Fixes https://github.com/harfbuzz/harfbuzz/issues/3974
2 years ago
Matthias Clasen
dfd371e976
Cosmetics
2 years ago
Matthias Clasen
4816be9ab5
Work around cairo limitations
...
If we just draw an image, cairos recording surface
complains that it is unbounded. Its not true of course.
To make things work, clip to the extents.
2 years ago
Matthias Clasen
76c16095fa
Fix the build on Windows
...
No __BYTE_ORDER there.
2 years ago
Behdad Esfahbod
56a48f8b0a
[paint] Don't use extents in hb-view
...
Let the clipbox do its magic. Currently works for ft backend only.
2 years ago
Matthias Clasen
ecd7420456
Debug spew
...
To get a dump of the hb-paint callbacks,
set HB_PAINT_DEBUG=1 when running hb-view.
For now, leave this code in place, since it
comes in handy for various debugging.
2 years ago
Matthias Clasen
13e0cb64f4
hb-view: Interpolate gradients premultiplied
...
This is what the specs demand.
2 years ago
Behdad Esfahbod
381d410b1e
[paint] Add HB_PAINT_IMAGE_FORMAT_BGRA and use it in hb-ft
...
Now hb-ft can render color emoji as well.
Just left COLRv2.
2 years ago
Behdad Esfahbod
63db0d2aed
[util] Speculatively fix build against non-PNG builds
2 years ago
Behdad Esfahbod
c5f903872f
[paint] Add bitmap width/height to paint_image callback
...
Such that we can add raw data as well.
2 years ago
Behdad Esfahbod
237955dffc
[paint] Add slant to image() callback
...
And slant images in hb-view.
2 years ago
Matthias Clasen
c221933977
[paint] Preserve foreground information
2 years ago
Matthias Clasen
6387004cad
[paint] Simplify api
...
Drop the hb_paint_context_t struct from the API, and
only pass the font where we need it.
2 years ago
Matthias Clasen
71bd5a0dfc
[paint] Resolve colors
...
We don't need to pass the index/alpha pairs to
client callbacks, and can just resolve the colors
internally.
Update test results.
2 years ago
Matthias Clasen
5d7553d38f
view: Add a --font-palette option
2 years ago
Matthias Clasen
d094e76cbc
hb-view: Pass fg color to hb_font_paint_glyph
2 years ago
Matthias Clasen
9be01b6bff
[paint] Pass hb_paint_context_t along
...
Replace the font argument with a hb_paint_context_t
that carries the font, the palette index and the
foreground color.
The hb_font_paint_glyph() api now takes the palette
index and the foreground color as extra arguments.
Update all callers and regenerate test results.
2 years ago
Matthias Clasen
b1500babaa
utils: Some cairo helper tweaks
2 years ago
Matthias Clasen
97224f3b63
[paint] Pass font to all callbacks
...
This will lead to easier implementations.
At the same time, we change the push_clip_glyph
callback to use the font as-is, no unscaling needed.
Update all callers and expected test results.
2 years ago
Behdad Esfahbod
cf02d13302
[cairo] Remove unused struct
2 years ago
Matthias Clasen
a3ba723876
Drop an unneeded include
2 years ago
Matthias Clasen
0800d1879c
Try to fix autotools build
2 years ago
Matthias Clasen
5451b78f4a
Don't use alloca
...
It complicates things on Windows, for no
big win. Just preallocate a reasonable amount.
2 years ago
Matthias Clasen
7c12db46ff
Try to fix msvc build
2 years ago
Behdad Esfahbod
3590ee74f4
[util] Fix bot
2 years ago
Behdad Esfahbod
81bf089273
[hb-view] Use color render callback if HB_DRAW >= 2
2 years ago
Matthias Clasen
c65f580b93
Drop hb-test
...
This was a test binary to assist in developing
the hb-paint code. Not needed anymore, now that
hb-view has the same code in the cairo userfont
backend.
2 years ago
Behdad Esfahbod
9672aa8610
[util] Fix compiler warning
2 years ago
Matthias Clasen
955bd30365
Fix hb-cairo-utils
...
This was a stupid mistake, and hard to track down.
2 years ago
Behdad Esfahbod
3573956705
[util] Include stdio.h
2 years ago
Behdad Esfahbod
7accbe97d8
[util] Fix argument order and root transform PNGs
2 years ago
Behdad Esfahbod
529dc40d7d
[util] Adjust scaling
...
Still doesn't render PNGs.
Fix a few compiler warnings
2 years ago
Behdad Esfahbod
bcc9ab27fc
[hb-view] Fix transformation
...
No need for cairo patch; that patch was wrong.
2 years ago
Behdad Esfahbod
c996fc58ec
[hb-view] Remove redundant check
2 years ago
Behdad Esfahbod
bec5354030
[hb-view] Fix render_color_glyph extents coordinate system
...
Needs cairo fix:
https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/371
2 years ago
Behdad Esfahbod
95ccd66481
[hb-view] Set glyph extents in render_color_glyph
...
Works around limitation in cairo-recording-surface unboundedness.
Extents are wrong but at least renders something now.
2 years ago
Matthias Clasen
6cadf280f2
Use hb-cairo-utils in hb-test
...
Just to prove that it works.
2 years ago
Matthias Clasen
8bcd13dd91
small fixup to hb-cairo-utils
2 years ago
Matthias Clasen
6c49822cad
wip: Use hb-paint in hb-view
...
This doesn't paint anything yet.
2 years ago
Behdad Esfahbod
3b32eab38e
[colr] Fix compiler warning
2 years ago
Behdad Esfahbod
e3153654cb
[colr] Fix PNG placement
2 years ago
Behdad Esfahbod
f07ce68f9c
Remove unused function
2 years ago
Matthias Clasen
0a2f3673b9
[paint] Use tags for image formats
...
This fits better with the rest of the
HarfBuzz API.
2 years ago
Matthias Clasen
485ba9beb3
[paint] Spell out rectangle in the API
...
No need to abbreviate this.
2 years ago
Matthias Clasen
37f3f0fcc2
[paint] Change the image callback
...
Instead of passing the glyph ID, give
it the image blob, a mimetype, and
glyph extents (if available).
Update all callers.
2 years ago
Matthias Clasen
9876e30c6e
test: Support png images via paint_image
2 years ago
Matthias Clasen
0d890061d1
Rename 'solid' to 'color'
...
'solid' does not really describe well what
the function does, and there is no strong
reason to stick 1:1 to the terminology used
in the spec.
2 years ago