Skip to content

Commit 1bddf6c

Browse files
tmbbmrdotb
authored andcommitted
feat(resvg): upgrade to Resvg 0.44 with substantial rust code refactor
- Updated rust code to accommodate significant architectural changes in Resvg 0.44, including shifts in functionality between resvg and usvg, and reworking of text rendering mechanics. - The upgrade addresses a specific bug found when rendering <tspan> elements inside <text>. - Rewrote tests, moving away from md5 checksum comparison for PNG output. - Introduced a new snapshot testing approach using the Approval library, which simplifies test management and improves test reliability.
1 parent 56ec6b4 commit 1bddf6c

26 files changed

+457
-281
lines changed

lib/resvg.ex

+5-6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ defmodule Resvg do
5757
`out_png` must be a path to a non-existent file.
5858
`opts` refer to [options](#module-common-options)
5959
60-
The functions return `:ok` in case of success. Otherise, it returns
60+
The functions return `:ok` in case of success. Otherise, it returns
6161
`{:error, reason}` if an error occurs.
6262
6363
## Examples
@@ -86,7 +86,7 @@ defmodule Resvg do
8686
`opts` refer to [options](#module-common-options) must at least set the
8787
`resources_dir` key to a valid path.
8888
89-
The functions return `:ok` in case of success. Otherise, it returns
89+
The functions return `:ok` in case of success. Otherise, it returns
9090
`{:error, reason}` if an error occurs.
9191
9292
## Examples
@@ -115,7 +115,7 @@ defmodule Resvg do
115115
`opts` refer to [options](#module-common-options) must at least set the
116116
`resources_dir` key to a valid path.
117117
118-
The functions return `{:ok, buffer}` in case of success. Otherise, it returns
118+
The functions return `{:ok, buffer}` in case of success. Otherise, it returns
119119
`{:error, reason}` if an error occurs.
120120
121121
## Examples
@@ -142,7 +142,7 @@ defmodule Resvg do
142142
`opts` refer to [options](#module-common-options) must at least set the
143143
`resources_dir` key to a valid path.
144144
145-
The functions return `{:ok, fonts_list}` in case of success. Otherise, it returns
145+
The functions return `{:ok, fonts_list}` in case of success. Otherise, it returns
146146
`{:error, reason}` if an error occurs.
147147
148148
## Examples
@@ -162,8 +162,7 @@ defmodule Resvg do
162162
163163
`opts` refer to [options](#module-common-options)
164164
165-
The functions return `{:ok, fonts_list}` in case of success. Otherise, it returns
166-
`{:error, reason}` if an error occurs.
165+
The functions return a list of `%Rsvg.Native.Node{}`s.
167166
168167
## Examples
169168

mix.exs

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ defmodule Resvg.MixProject do
2929
[
3030
{:rustler_precompiled, "~> 0.8.1"},
3131
{:rustler, "~> 0.34.0", optional: true},
32-
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false}
32+
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
33+
{:approval, "~> 0.1", only: :test}
3334
]
3435
end
3536

mix.lock

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
%{
2+
"approval": {:hex, :approval, "0.1.0", "b5614f405c6cffdf516d199b7acf3f25828610f06d80b60faf8f97f9e1735326", [:mix], [], "hexpm", "9c5a44250266b801190ee970d208de21975fac447c3dae9907a0242464efcb2e"},
23
"castore": {:hex, :castore, "1.0.8", "dedcf20ea746694647f883590b82d9e96014057aff1d44d03ec90f36a5c0dc6e", [:mix], [], "hexpm", "0b2b66d2ee742cb1d9cb8c8be3b43c3a70ee8651f37b75a8b982e036752983f1"},
34
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
45
"ex_doc": {:hex, :ex_doc, "0.34.1", "9751a0419bc15bc7580c73fde506b17b07f6402a1e5243be9e0f05a68c723368", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "d441f1a86a235f59088978eff870de2e815e290e44a8bd976fe5d64470a4c9d2"},

0 commit comments

Comments
 (0)