Commit graph

3056 commits

Author SHA1 Message Date
Hermet Park
366dcd7285 bump up version v0.14.10 2024-09-12 22:13:24 +09:00
Hermet Park
36f5a8fd4e sw_engine: rectified 8 grayscale drawing
8 bits matting images must be blended, not overwriting.

issue: https://github.com/thorvg/thorvg/issues/1767
2024-09-12 22:12:54 +09:00
Hermet Park
38dbd86d12 sw_engine: Added missing matting and blending for direct images
issue: https://github.com/thorvg/thorvg/issues/1767
2024-09-12 22:12:47 +09:00
Mira Grudzinska
12d7ca351d svg_loader: append text to the SvgTextNode
Text can be added in parts due to the presence
of the <tspan> tag. This requires that each
subsequent piece of text is appended rather than
overwriting the previous one.
2024-09-12 22:12:40 +09:00
Hermet Park
fde70ece60 sw_engine: blending stabilization++
Currently, only blending might work.
Blending and composition must be handled together.
2024-09-12 22:12:34 +09:00
Jinny You
493e98d3ea lottie/text: Support line spacing
Compute line spacing based on the text range selector, applying the maximum spacing value for each line.
issue: https://github.com/thorvg/thorvg/issues/2178
2024-09-12 22:12:24 +09:00
Jinny You
d88731498b lottie/text: Support Text Based
Added support for Text Based of Text Range Selector, by processing further properties:
2. Character Excluding Spaces
3. Words
4. Lines

see: https://github.com/thorvg/thorvg/issues/2178
2024-09-12 22:11:34 +09:00
Hermet Park
ced252e0eb renderer: ++reliability in text drawing
Allow the canvas to pass through
even if text elements are not properly supported.

issue: https://github.com/thorvg/thorvg/issues/2715
2024-09-12 22:11:26 +09:00
Hermet Park
1eb3e068df sw_engine: cleaned up the blending operations.
Corrected the alpha interpolation order during blending.
This also corrected the hard mix blending result in the guitar sample.

issue: https://github.com/thorvg/thorvg/issues/2704
2024-09-12 22:09:54 +09:00
Hermet Park
81a0fbfd59 bump up version v0.14.9 2024-09-06 00:01:46 +09:00
Mira Grudzinska
0bcedd2f44 svg_loader: fix text nodes issue
Since the text node wasn't pushed onto the loader's stack,
closing the text node incorrectly caused an element to be
popped from the stack (if one was present).
This could result in elements that were supposed to have
that element as a parent being rendered incorrectly or not
being rendered at all.
Now, the text node is correctly pushed onto the stack.

@Issue: https://github.com/thorvg/thorvg/issues/2706
2024-09-06 00:01:29 +09:00
Hermet Park
fa469f8bea common/math: replace isinfinite() with isinf() 2024-09-06 00:01:20 +09:00
Mira Grudzinska
e01cc2723f common: precision increase while matrix inversion
A numerically motivated limit on the matrix determinant
set at 1e-6 was not sufficient. The limit has been increased
by checkoing whether 1/det is still a number.
2024-09-06 00:01:06 +09:00
Hermet Park
9dbe141058 lottie/parser: ++ null value handling
Note that, only dealt with a obivous case in practice.

issue: https://github.com/thorvg/thorvg/issues/2703
2024-09-06 00:00:31 +09:00
Łukasz Pomietło
251ec5586b loader/ttf: Spaces and invalid glyphs rendering fix
If for any reason an invalid glyph is found in text, 
it will now be skipped when rendering 
(instead of increasing offset by last valid glyph advance).

Issue: #2687
2024-09-06 00:00:24 +09:00
Mira Grudzinska
bd87d136a5 lottie: handle trim path edge cases
According to the definition of trim path elements,
the begin and end values are specified as percentages
in the range of 0-100% (this is also confirmed by AE,
where it's not possible to exceed this range).
Added clamping to align with spec.
2024-09-05 23:59:52 +09:00
Mira Grudzinska
dc386ba280 common: introduce tvg::clamp 2024-09-05 23:59:29 +09:00
Mira Grudzinska
216167ccde sw_engine: increased accuracy in dashing
The limit on leftovers was too small, which became
noticeable for animations with trimming - currently
implemented with the dashing alg.
The limit has been increased.
2024-09-05 23:57:22 +09:00
Hermet Park
e253f0f716 bump up version v0.14.8 2024-08-30 01:08:37 +09:00
Hermet Park
759354f7cd sw_engine: fixed incorrect image blending operations
The anti-aliased outline color was incorrectly blended
at the multiply option.

The fix can be observed in the example:
'examples/lottie/resourcesguitar.json'

in order to do this, RenderMehthod::blend() method introduced
`bool direct` for figuring out the intermediate composition.
2024-08-30 01:08:37 +09:00
Mira Grudzinska
94047ffd36 common: uint8_t version of the lerp
An uint8_t version of the lerp function
is introduced to handle cases where
the interpolation factor t exceeds 1, which
previously caused overflow issues due to casting.
2024-08-30 01:08:34 +09:00
Hermet Park
c30447be98 lottie/expressions: rectified $bm_sum()
Added only a single element to x.
2024-08-30 01:01:47 +09:00
Hermet Park
354533c922 lottie/expressions: hotfix a crash
Stabilized $bm_sum(), by allowing the different dimensional
arguments.

issue: https://github.com/thorvg/thorvg/issues/2664
2024-08-30 01:01:40 +09:00
JunsuChoi
244e61205c svg_loader: Adjust hsl values out of range
The range of saturation and brightness values is 0 ~ 100% and range of hue is 0 ~ 360.
If a value greater than 100% is loaded, it will be modified to be 100%.

issue: https://github.com/thorvg/thorvg/issues/2678
2024-08-30 01:01:32 +09:00
Mira Grudzinska
0751b14186 lottie: fix trim
The bug caused the trim path to not be applied
when it appeared in a group between different
shapes.
2024-08-30 01:00:59 +09:00
Mira Grudzinska
bd5728a140 lottie: fix trim path regression
To avoid editing the trim path values provided
by the user, the logic for their interpretation
was moved from the API to the renderer (7c87d8e).
This caused an issue in the lottie animations when
the trim path is applied more than once. Now fixed.

@issue: https://github.com/thorvg/thorvg/issues/2670
2024-08-30 01:00:52 +09:00
Łukasz Pomietło
f324cc993d renderer/text: fix a missing text update
previously font size & italic style had been ignored
even if its attributes are changed.

Co-Authored-By: Hermet Park <hermet@lottiefiles.com>

issue: https://github.com/thorvg/thorvg/issues/2676
2024-08-30 01:00:42 +09:00
lpogic
35ffa9edf8 text: fixed a corrupted italic style application
issue: https://github.com/thorvg/thorvg/issues/2669
2024-08-30 00:57:57 +09:00
tangruiwen.mmh1103
fbae8ad095 gl_engine: fix mistake in the calculation of stroke miter limit
* correct the stroke width and color calculation with scaling
* fix the miter limit calculation to make bevel join fallback correct
2024-08-30 00:56:57 +09:00
Hermet Park
223a07d0d2 lottie/jerryscript: ++build reliance 2024-08-30 00:56:48 +09:00
Hermet Park
e3a6bf5229 bump up version v0.14.7 2024-08-23 10:56:46 +09:00
Mira Grudzinska
660484b12b lottie: add offsetPath support
Due to the lack of an analytical solution for Bezier
curves offsetting, a simple and computationally cheap
approximation has been implemented. The algorithm shifts
the segments connecting control points and determines
new points based on their intersections.

@issue: https://github.com/thorvg/thorvg/issues/2230
2024-08-23 10:56:23 +09:00
Mira Grudzinska
b521eee2be lottie: roundness refactored based on #2295 2024-08-23 10:50:43 +09:00
Mira Grudzinska
1540ecb4c0 common: prevent warning - expression result unused 2024-08-23 10:46:38 +09:00
Hermet Park
222eb2720a renderer/text: --memory leak
regression by 71d3fce1dd
2024-08-23 10:46:29 +09:00
Hermet Park
9a1d169558 sw_engine/texmap: ++fixed memory access violation
Co-Authored-By: Mira Grudzinska <mira@lottiefiles.com>
2024-08-23 10:46:22 +09:00
Mira Grudzinska
73fd8015f7 lottie: fix text update
The occurrence of a 'carriage return' (13) or 'end of text' (3)
caused the skipping of the next character check, immediately
searching for it in the list of available characters.
If the next character was also 13 or 3, it led to incorrect
interpretation; however, if it was the last character in the
sequence, a crash occurred.
2024-08-23 10:46:15 +09:00
Mira Grudzinska
a08c73b08b sw_engine: fix TexmapPolygon rastering
The y range initialization was missing a check to ensure
that the height is a positive value. This could lead to
an attempt to call malloc with a negative argument, which
cast to an unsigned value, caused a crash.
2024-08-23 10:46:07 +09:00
Hermet Park
f5337015e9 renderer: text refactoring
- assign the shape instance as mandatory.
- assign the text instance internally.
2024-08-23 10:45:55 +09:00
Hermet Park
8ca5e74902 api: corrected wrong const specifier
Setter obvisouly modifies the instance.
2024-08-23 10:45:49 +09:00
Mira Grudzinska
2447e02932 docs: description++ 2024-08-23 10:45:39 +09:00
Hermet Park
7a37735110 doc: ++enhancement in Picture::load()
addressed supported raw data format.

issue: https://github.com/thorvg/thorvg/issues/2648
2024-08-23 10:45:29 +09:00
Hermet Park
65c808fc02 common: spec out TexMap
Spec out this incomplete experimental feature,
this is a still promising one, we will reintroduce
this officially after 1.0 release

size: -2kb

issue: https://github.com/thorvg/thorvg/issues/1372
2024-08-23 10:45:14 +09:00
Elliott Sales de Andrade
eb462c6e32 build: Override dependency for use as subproject
A pkgconfig file is already provided, which enables using `thorvg` once
it is installed. However, this file is not, and cannot be, available at
setup time if using `thorvg` as a subproject.

In such cases, Meson provides the `override_dependency` mechanism for a
subproject to tell its parent how to use it.
2024-08-23 10:35:35 +09:00
Hermet Park
ac729068f5 lottie: ensure a null terminator at the end of the copied data
In certain cases, the user might want to set mapped memory directly.
This update ensures that a null terminator is appended to the string data.

Co-Authored-By: Mira Grudzinska <mira@lottiefiles.com>

Issue: https://github.com/thorvg/thorvg/issues/2642
2024-08-23 10:35:23 +09:00
Hermet Park
82563bf29a doc: hotfix 2024-08-20 11:50:29 +09:00
Hermet Park
03d4b754df bump up version 0.14.6 2024-08-15 23:19:13 +09:00
Mira Grudzinska
183b67b967 lottie: prioritization of roundness in rectangles
Added prioritization of rectangle roundness over
rounded corners, in line with AE results.
2024-08-15 23:18:51 +09:00
Hermet Park
8927294374 common: spec out Scene Clipper
Scene Clipper is an unusual feature
that is too unstable and ambiguous in ThorVG.

Users can achieve the same functionality
with multiple composed shapes instead of scene clipping.

size: -2.5kb

issues:
- https://github.com/thorvg/thorvg/issues/1548
- https://github.com/thorvg/thorvg/issues/1549
- https://github.com/thorvg/thorvg/issues/1573
2024-08-15 23:18:39 +09:00
Mira Grudzinska
4af3825bc3 lottie: handle edge case for rounded rect
For rounded rectangles the roundness value should
be determined using to the formula:
r = min(r, max(size.x, size.y)/2)
rather than the previous method:
r = min(size.x/2, size.y/2, r)
2024-08-15 23:14:19 +09:00