svgpng 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. checksums.yaml +7 -0
  2. data/README.adoc +81 -0
  3. data/docs/decisions/svg-to-png.md +368 -0
  4. data/docs/goldens.md +74 -0
  5. data/lib/svgpng/errors.rb +57 -0
  6. data/lib/svgpng/font_face.rb +36 -0
  7. data/lib/svgpng/font_inputs.rb +49 -0
  8. data/lib/svgpng/font_warnings.rb +45 -0
  9. data/lib/svgpng/limits.rb +10 -0
  10. data/lib/svgpng/native.rb +213 -0
  11. data/lib/svgpng/native_render.rb +198 -0
  12. data/lib/svgpng/package_resolution.rb +174 -0
  13. data/lib/svgpng/raw_input.rb +51 -0
  14. data/lib/svgpng/release_set.rb +273 -0
  15. data/lib/svgpng/render_profile.rb +183 -0
  16. data/lib/svgpng/renderer.rb +27 -0
  17. data/lib/svgpng/result.rb +50 -0
  18. data/lib/svgpng/version.rb +5 -0
  19. data/lib/svgpng.rb +19 -0
  20. data/vendor/licenses/README.txt +23 -0
  21. data/vendor/licenses/fonts/COPYRIGHT.txt +13 -0
  22. data/vendor/licenses/fonts/NotoSans-Condensed-OFL-1.1.txt +94 -0
  23. data/vendor/licenses/fonts/OFL-1.1.txt +92 -0
  24. data/vendor/licenses/libpng/LICENSE +134 -0
  25. data/vendor/licenses/libpng/LICENSES/MIT-0.txt +16 -0
  26. data/vendor/licenses/libpng/LICENSES/MIT.txt +19 -0
  27. data/vendor/licenses/resvg/LICENSE-APACHE +176 -0
  28. data/vendor/licenses/resvg/LICENSE-MIT +25 -0
  29. data/vendor/licenses/rust/adler2-2.0.1/LICENSE-0BSD +12 -0
  30. data/vendor/licenses/rust/adler2-2.0.1/LICENSE-APACHE +201 -0
  31. data/vendor/licenses/rust/adler2-2.0.1/LICENSE-MIT +23 -0
  32. data/vendor/licenses/rust/arrayref-0.3.9/LICENSE +26 -0
  33. data/vendor/licenses/rust/arrayvec-0.7.8/LICENSE-APACHE +201 -0
  34. data/vendor/licenses/rust/arrayvec-0.7.8/LICENSE-MIT +25 -0
  35. data/vendor/licenses/rust/autocfg-1.5.1/LICENSE-APACHE +201 -0
  36. data/vendor/licenses/rust/autocfg-1.5.1/LICENSE-MIT +25 -0
  37. data/vendor/licenses/rust/base64-0.23.1/LICENSE-APACHE +201 -0
  38. data/vendor/licenses/rust/base64-0.23.1/LICENSE-MIT +21 -0
  39. data/vendor/licenses/rust/bitflags-2.13.2/LICENSE-APACHE +201 -0
  40. data/vendor/licenses/rust/bitflags-2.13.2/LICENSE-MIT +25 -0
  41. data/vendor/licenses/rust/block-buffer-0.10.4/LICENSE-APACHE +201 -0
  42. data/vendor/licenses/rust/block-buffer-0.10.4/LICENSE-MIT +25 -0
  43. data/vendor/licenses/rust/bytemuck-1.25.2/LICENSE-APACHE +61 -0
  44. data/vendor/licenses/rust/bytemuck-1.25.2/LICENSE-MIT +9 -0
  45. data/vendor/licenses/rust/bytemuck-1.25.2/LICENSE-ZLIB +11 -0
  46. data/vendor/licenses/rust/bytemuck_derive-1.12.1/LICENSE-APACHE +61 -0
  47. data/vendor/licenses/rust/bytemuck_derive-1.12.1/LICENSE-MIT +9 -0
  48. data/vendor/licenses/rust/bytemuck_derive-1.12.1/LICENSE-ZLIB +11 -0
  49. data/vendor/licenses/rust/byteorder-lite-0.1.0/LICENSE-MIT +21 -0
  50. data/vendor/licenses/rust/byteorder-lite-0.1.0/UNLICENSE +24 -0
  51. data/vendor/licenses/rust/cfg-if-1.0.5/LICENSE-APACHE +201 -0
  52. data/vendor/licenses/rust/cfg-if-1.0.5/LICENSE-MIT +25 -0
  53. data/vendor/licenses/rust/color_quant-1.1.0/LICENSE +21 -0
  54. data/vendor/licenses/rust/cpufeatures-0.2.17/LICENSE-APACHE +201 -0
  55. data/vendor/licenses/rust/cpufeatures-0.2.17/LICENSE-MIT +25 -0
  56. data/vendor/licenses/rust/crc32fast-1.5.3/LICENSE-APACHE +202 -0
  57. data/vendor/licenses/rust/crc32fast-1.5.3/LICENSE-MIT +21 -0
  58. data/vendor/licenses/rust/crypto-common-0.1.7/LICENSE-APACHE +201 -0
  59. data/vendor/licenses/rust/crypto-common-0.1.7/LICENSE-MIT +25 -0
  60. data/vendor/licenses/rust/cssparser-0.35.0/LICENSE +373 -0
  61. data/vendor/licenses/rust/cssparser-macros-0.6.1/LICENSE +373 -0
  62. data/vendor/licenses/rust/data-url-0.3.2/LICENSE-APACHE +201 -0
  63. data/vendor/licenses/rust/data-url-0.3.2/LICENSE-MIT +25 -0
  64. data/vendor/licenses/rust/digest-0.10.7/LICENSE-APACHE +201 -0
  65. data/vendor/licenses/rust/digest-0.10.7/LICENSE-MIT +25 -0
  66. data/vendor/licenses/rust/dtoa-1.0.11/LICENSE-APACHE +176 -0
  67. data/vendor/licenses/rust/dtoa-1.0.11/LICENSE-MIT +23 -0
  68. data/vendor/licenses/rust/dtoa-short-0.3.5/LICENSE +373 -0
  69. data/vendor/licenses/rust/euclid-0.22.14/COPYRIGHT +5 -0
  70. data/vendor/licenses/rust/euclid-0.22.14/LICENSE-APACHE +201 -0
  71. data/vendor/licenses/rust/euclid-0.22.14/LICENSE-MIT +25 -0
  72. data/vendor/licenses/rust/fdeflate-0.3.7/LICENSE-APACHE +177 -0
  73. data/vendor/licenses/rust/fdeflate-0.3.7/LICENSE-MIT +25 -0
  74. data/vendor/licenses/rust/flate2-1.1.10/LICENSE-APACHE +201 -0
  75. data/vendor/licenses/rust/flate2-1.1.10/LICENSE-MIT +25 -0
  76. data/vendor/licenses/rust/float-cmp-0.9.0/LICENSE +19 -0
  77. data/vendor/licenses/rust/font-types-0.12.7/LICENSE-APACHE +67 -0
  78. data/vendor/licenses/rust/font-types-0.12.7/LICENSE-MIT +25 -0
  79. data/vendor/licenses/rust/fontconfig-parser-0.5.8/LICENSE +21 -0
  80. data/vendor/licenses/rust/fontdb-0.24.0/LICENSE +21 -0
  81. data/vendor/licenses/rust/generic-array-0.14.7/LICENSE +21 -0
  82. data/vendor/licenses/rust/gif-0.14.2/LICENSE-APACHE +201 -0
  83. data/vendor/licenses/rust/gif-0.14.2/LICENSE-MIT +21 -0
  84. data/vendor/licenses/rust/harfrust-0.12.0/LICENSE +22 -0
  85. data/vendor/licenses/rust/image-webp-0.2.4/LICENSE-APACHE +177 -0
  86. data/vendor/licenses/rust/image-webp-0.2.4/LICENSE-MIT +25 -0
  87. data/vendor/licenses/rust/imagesize-0.15.0/LICENSE +21 -0
  88. data/vendor/licenses/rust/itoa-1.0.18/LICENSE-APACHE +176 -0
  89. data/vendor/licenses/rust/itoa-1.0.18/LICENSE-MIT +23 -0
  90. data/vendor/licenses/rust/kurbo-0.13.1/LICENSE-APACHE +202 -0
  91. data/vendor/licenses/rust/kurbo-0.13.1/LICENSE-MIT +25 -0
  92. data/vendor/licenses/rust/libc-0.2.191/LICENSE-APACHE +176 -0
  93. data/vendor/licenses/rust/libc-0.2.191/LICENSE-MIT +25 -0
  94. data/vendor/licenses/rust/log-0.4.34/LICENSE-APACHE +201 -0
  95. data/vendor/licenses/rust/log-0.4.34/LICENSE-MIT +25 -0
  96. data/vendor/licenses/rust/memchr-2.8.3/COPYING +3 -0
  97. data/vendor/licenses/rust/memchr-2.8.3/LICENSE-MIT +21 -0
  98. data/vendor/licenses/rust/memchr-2.8.3/UNLICENSE +24 -0
  99. data/vendor/licenses/rust/memmap2-0.9.12/LICENSE-APACHE +201 -0
  100. data/vendor/licenses/rust/memmap2-0.9.12/LICENSE-MIT +26 -0
  101. data/vendor/licenses/rust/miniz_oxide-0.8.9/LICENSE +25 -0
  102. data/vendor/licenses/rust/miniz_oxide-0.8.9/LICENSE-APACHE.md +177 -0
  103. data/vendor/licenses/rust/miniz_oxide-0.8.9/LICENSE-MIT.md +24 -0
  104. data/vendor/licenses/rust/miniz_oxide-0.8.9/LICENSE-ZLIB.md +14 -0
  105. data/vendor/licenses/rust/miniz_oxide-0.9.1/LICENSE +25 -0
  106. data/vendor/licenses/rust/miniz_oxide-0.9.1/LICENSE-APACHE.md +177 -0
  107. data/vendor/licenses/rust/miniz_oxide-0.9.1/LICENSE-MIT.md +24 -0
  108. data/vendor/licenses/rust/miniz_oxide-0.9.1/LICENSE-ZLIB.md +14 -0
  109. data/vendor/licenses/rust/num-traits-0.2.19/LICENSE-APACHE +201 -0
  110. data/vendor/licenses/rust/num-traits-0.2.19/LICENSE-MIT +25 -0
  111. data/vendor/licenses/rust/once_cell-1.21.4/LICENSE-APACHE +201 -0
  112. data/vendor/licenses/rust/once_cell-1.21.4/LICENSE-MIT +23 -0
  113. data/vendor/licenses/rust/phf-0.11.3/LICENSE +20 -0
  114. data/vendor/licenses/rust/phf_generator-0.11.3/LICENSE +20 -0
  115. data/vendor/licenses/rust/phf_macros-0.11.3/LICENSE +20 -0
  116. data/vendor/licenses/rust/phf_shared-0.11.3/LICENSE +20 -0
  117. data/vendor/licenses/rust/pico-args-0.5.0/LICENSE +20 -0
  118. data/vendor/licenses/rust/png-0.18.1/LICENSE-APACHE +201 -0
  119. data/vendor/licenses/rust/png-0.18.1/LICENSE-MIT +25 -0
  120. data/vendor/licenses/rust/polycool-0.4.0/LICENSE-APACHE +202 -0
  121. data/vendor/licenses/rust/polycool-0.4.0/LICENSE-MIT +25 -0
  122. data/vendor/licenses/rust/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
  123. data/vendor/licenses/rust/proc-macro2-1.0.107/LICENSE-MIT +23 -0
  124. data/vendor/licenses/rust/quick-error-2.0.1/LICENSE-APACHE +202 -0
  125. data/vendor/licenses/rust/quick-error-2.0.1/LICENSE-MIT +19 -0
  126. data/vendor/licenses/rust/quote-1.0.47/LICENSE-APACHE +176 -0
  127. data/vendor/licenses/rust/quote-1.0.47/LICENSE-MIT +23 -0
  128. data/vendor/licenses/rust/rand-0.8.8/COPYRIGHT +12 -0
  129. data/vendor/licenses/rust/rand-0.8.8/LICENSE-APACHE +176 -0
  130. data/vendor/licenses/rust/rand-0.8.8/LICENSE-MIT +26 -0
  131. data/vendor/licenses/rust/rand_core-0.6.4/COPYRIGHT +12 -0
  132. data/vendor/licenses/rust/rand_core-0.6.4/LICENSE-APACHE +187 -0
  133. data/vendor/licenses/rust/rand_core-0.6.4/LICENSE-MIT +26 -0
  134. data/vendor/licenses/rust/read-fonts-0.41.0/LICENSE-APACHE +67 -0
  135. data/vendor/licenses/rust/read-fonts-0.41.0/LICENSE-MIT +25 -0
  136. data/vendor/licenses/rust/rgb-0.8.53/LICENSE +21 -0
  137. data/vendor/licenses/rust/roxmltree-0.20.0/LICENSE-APACHE +201 -0
  138. data/vendor/licenses/rust/roxmltree-0.20.0/LICENSE-MIT +21 -0
  139. data/vendor/licenses/rust/roxmltree-0.21.1/LICENSE-APACHE +201 -0
  140. data/vendor/licenses/rust/roxmltree-0.21.1/LICENSE-MIT +21 -0
  141. data/vendor/licenses/rust/ryu-1.0.23/LICENSE-APACHE +176 -0
  142. data/vendor/licenses/rust/ryu-1.0.23/LICENSE-BOOST +23 -0
  143. data/vendor/licenses/rust/serde-1.0.229/LICENSE-APACHE +176 -0
  144. data/vendor/licenses/rust/serde-1.0.229/LICENSE-MIT +23 -0
  145. data/vendor/licenses/rust/serde_core-1.0.229/LICENSE-APACHE +176 -0
  146. data/vendor/licenses/rust/serde_core-1.0.229/LICENSE-MIT +23 -0
  147. data/vendor/licenses/rust/serde_derive-1.0.229/LICENSE-APACHE +176 -0
  148. data/vendor/licenses/rust/serde_derive-1.0.229/LICENSE-MIT +23 -0
  149. data/vendor/licenses/rust/serde_json-1.0.145/LICENSE-APACHE +176 -0
  150. data/vendor/licenses/rust/serde_json-1.0.145/LICENSE-MIT +23 -0
  151. data/vendor/licenses/rust/sha2-0.10.9/LICENSE-APACHE +201 -0
  152. data/vendor/licenses/rust/sha2-0.10.9/LICENSE-MIT +27 -0
  153. data/vendor/licenses/rust/simd-adler32-0.3.10/LICENSE.md +21 -0
  154. data/vendor/licenses/rust/simplecss-0.2.2/LICENSE-APACHE +201 -0
  155. data/vendor/licenses/rust/simplecss-0.2.2/LICENSE-MIT +21 -0
  156. data/vendor/licenses/rust/siphasher-1.0.4/COPYING +7 -0
  157. data/vendor/licenses/rust/siphasher-1.0.4/LICENSE-APACHE +202 -0
  158. data/vendor/licenses/rust/siphasher-1.0.4/LICENSE-MIT +17 -0
  159. data/vendor/licenses/rust/skrifa-0.44.0/LICENSE-APACHE +67 -0
  160. data/vendor/licenses/rust/skrifa-0.44.0/LICENSE-MIT +25 -0
  161. data/vendor/licenses/rust/slotmap-1.1.1/LICENSE +19 -0
  162. data/vendor/licenses/rust/smallvec-1.16.3/LICENSE-APACHE +201 -0
  163. data/vendor/licenses/rust/smallvec-1.16.3/LICENSE-MIT +25 -0
  164. data/vendor/licenses/rust/strict-num-0.1.1/LICENSE +19 -0
  165. data/vendor/licenses/rust/svgtypes-0.16.1/LICENSE-APACHE +201 -0
  166. data/vendor/licenses/rust/svgtypes-0.16.1/LICENSE-MIT +20 -0
  167. data/vendor/licenses/rust/syn-2.0.119/LICENSE-APACHE +176 -0
  168. data/vendor/licenses/rust/syn-2.0.119/LICENSE-MIT +23 -0
  169. data/vendor/licenses/rust/syn-3.0.9/LICENSE-APACHE +176 -0
  170. data/vendor/licenses/rust/syn-3.0.9/LICENSE-MIT +23 -0
  171. data/vendor/licenses/rust/tiny-skia-0.12.0/LICENSE +30 -0
  172. data/vendor/licenses/rust/tiny-skia-path-0.12.0/LICENSE +30 -0
  173. data/vendor/licenses/rust/tinyvec-1.13.3/LICENSE-APACHE.md +202 -0
  174. data/vendor/licenses/rust/tinyvec-1.13.3/LICENSE-MIT.md +5 -0
  175. data/vendor/licenses/rust/tinyvec-1.13.3/LICENSE-ZLIB.md +11 -0
  176. data/vendor/licenses/rust/typenum-1.20.1/LICENSE +1 -0
  177. data/vendor/licenses/rust/typenum-1.20.1/LICENSE-APACHE +201 -0
  178. data/vendor/licenses/rust/typenum-1.20.1/LICENSE-MIT +21 -0
  179. data/vendor/licenses/rust/unicode-bidi-0.3.18/COPYRIGHT +8 -0
  180. data/vendor/licenses/rust/unicode-bidi-0.3.18/LICENSE-APACHE +201 -0
  181. data/vendor/licenses/rust/unicode-bidi-0.3.18/LICENSE-MIT +25 -0
  182. data/vendor/licenses/rust/unicode-ident-1.0.27/LICENSE-APACHE +176 -0
  183. data/vendor/licenses/rust/unicode-ident-1.0.27/LICENSE-MIT +23 -0
  184. data/vendor/licenses/rust/unicode-ident-1.0.27/LICENSE-UNICODE +39 -0
  185. data/vendor/licenses/rust/unicode-normalization-0.1.24/COPYRIGHT +7 -0
  186. data/vendor/licenses/rust/unicode-normalization-0.1.24/LICENSE-APACHE +201 -0
  187. data/vendor/licenses/rust/unicode-normalization-0.1.24/LICENSE-MIT +25 -0
  188. data/vendor/licenses/rust/unicode-script-0.5.8/LICENSE-APACHE +201 -0
  189. data/vendor/licenses/rust/unicode-script-0.5.8/LICENSE-MIT +27 -0
  190. data/vendor/licenses/rust/unicode-vo-0.1.0/LICENSE-APACHE +201 -0
  191. data/vendor/licenses/rust/unicode-vo-0.1.0/LICENSE-MIT +21 -0
  192. data/vendor/licenses/rust/version_check-0.9.5/LICENSE-APACHE +201 -0
  193. data/vendor/licenses/rust/version_check-0.9.5/LICENSE-MIT +19 -0
  194. data/vendor/licenses/rust/weezl-0.1.12/LICENSE-APACHE +201 -0
  195. data/vendor/licenses/rust/weezl-0.1.12/LICENSE-MIT +22 -0
  196. data/vendor/licenses/rust/xmlwriter-0.1.0/LICENSE +21 -0
  197. data/vendor/licenses/rust/zlib-rs-0.6.8/LICENSE +19 -0
  198. data/vendor/licenses/rust/zune-core-0.5.3/LICENSE-APACHE +201 -0
  199. data/vendor/licenses/rust/zune-core-0.5.3/LICENSE-MIT +21 -0
  200. data/vendor/licenses/rust/zune-core-0.5.3/LICENSE-ZLIB +19 -0
  201. data/vendor/licenses/rust/zune-jpeg-0.5.15/LICENSE-APACHE +201 -0
  202. data/vendor/licenses/rust/zune-jpeg-0.5.15/LICENSE-MIT +21 -0
  203. data/vendor/licenses/rust/zune-jpeg-0.5.15/LICENSE-ZLIB +19 -0
  204. data/vendor/licenses/zlib/LICENSE +22 -0
  205. data/vendor/manifest.yml +102 -0
  206. data/vendor/rust-dependencies.json +1696 -0
  207. metadata +256 -0
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Svgpng
4
+ # Coordinates the owned native renderer and deterministic PNG encoder.
5
+ class Renderer
6
+ SUPPORTED_TARGETS = %w[arm64-darwin x86_64-darwin x86_64-linux aarch64-linux
7
+ x86_64-linux-musl aarch64-linux-musl x64-mingw-ucrt].map(&:freeze).freeze
8
+
9
+ # Preserve the pipeline order: parse, resolve, render, convert, encode, copy.
10
+ # rubocop:disable-next Metrics/AbcSize, Metrics/MethodLength
11
+ def self.render(svg_bytes, profile:, fonts:, fallback_fonts:)
12
+ require_relative "native"
13
+ library = Native.load
14
+ source = RawInput.validate!(svg_bytes)
15
+ settings = RenderProfile.new(profile)
16
+ inputs = FontInputs.new(fonts: fonts, fallback_fonts: fallback_fonts)
17
+ layout = settings.resolve(library.root_attributes(source))
18
+ pixels, diagnostics = library.render_pixels(source, layout: layout, fonts: inputs)
19
+ straight = library.rgba_to_straight(pixels, width: layout.width, height: layout.height)
20
+ png = library.encode_rgba(straight, width: layout.width, height: layout.height)
21
+ warnings = FontWarnings.new
22
+ diagnostics.fetch("warnings", []).each { |warning| warnings.add(**warning.transform_keys(&:to_sym)) }
23
+ Result.new(png_bytes: png, width: layout.width, height: layout.height,
24
+ warnings: warnings.warnings, font_manifest: diagnostics.fetch("font_manifest", []))
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Svgpng
4
+ # Native diagnostics are copied into immutable Ruby values before native free.
5
+ module Immutable
6
+ def self.copy(value)
7
+ case value
8
+ when String then value.dup.freeze
9
+ when Array then value.map { |item| copy(item) }.freeze
10
+ when Hash then value.to_h { |key, item| [copy(key), copy(item)] }.freeze
11
+ when Integer, Symbol, NilClass, TrueClass, FalseClass then value
12
+ else raise InputError, "Unsupported diagnostic value #{value.class}"
13
+ end
14
+ end
15
+ end
16
+
17
+ # One ordered native font substitution event.
18
+ class FontSubstitutionWarning
19
+ attr_reader :requested_family, :selected_family, :style, :weight, :stretch, :scalars
20
+
21
+ # rubocop:disable-next Metrics/ParameterLists -- Mirrors the public native diagnostic fields.
22
+ def initialize(requested_family:, selected_family:, style:, weight:, stretch:, scalars:)
23
+ @requested_family = Immutable.copy(requested_family)
24
+ @selected_family = Immutable.copy(selected_family)
25
+ @style = Immutable.copy(style)
26
+ @weight = Immutable.copy(weight)
27
+ @stretch = Immutable.copy(stretch)
28
+ @scalars = Immutable.copy(scalars)
29
+ freeze
30
+ end
31
+ end
32
+
33
+ # Rendered bytes and diagnostics without native ownership.
34
+ class Result
35
+ attr_reader :png_bytes, :width, :height, :warnings, :font_manifest
36
+
37
+ def initialize(png_bytes:, width:, height:, warnings: [], font_manifest: [])
38
+ @png_bytes = png_bytes.b.freeze
39
+ @width = width
40
+ @height = height
41
+ unless warnings.is_a?(Array) && warnings.all?(FontSubstitutionWarning)
42
+ raise InputError, "Warnings must be FontSubstitutionWarning values"
43
+ end
44
+
45
+ @warnings = warnings.dup.freeze
46
+ @font_manifest = Immutable.copy(font_manifest)
47
+ freeze
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Svgpng
4
+ VERSION = "0.1.0"
5
+ end
data/lib/svgpng.rb ADDED
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "svgpng/version"
4
+ require_relative "svgpng/errors"
5
+ require_relative "svgpng/limits"
6
+ require_relative "svgpng/font_face"
7
+ require_relative "svgpng/font_inputs"
8
+ require_relative "svgpng/result"
9
+ require_relative "svgpng/font_warnings"
10
+ require_relative "svgpng/raw_input"
11
+ require_relative "svgpng/render_profile"
12
+ require_relative "svgpng/renderer"
13
+
14
+ ## Public byte-oriented rendering boundary.
15
+ module Svgpng
16
+ def self.render(svg_bytes, profile:, fonts:, fallback_fonts:)
17
+ Renderer.render(svg_bytes, profile: profile, fonts: fonts, fallback_fonts: fallback_fonts)
18
+ end
19
+ end
@@ -0,0 +1,23 @@
1
+ Third-party source and notices
2
+
3
+ The pinned rendering sources and patches are recorded in ../manifest.yml.
4
+ The complete Cargo.lock registry inventory, including inactive optional workspace
5
+ packages, is ../rust-dependencies.json. Each entry records the crate archive URL,
6
+ verified SHA-256 checksum, declared license expression, and copied license texts.
7
+ The renderer_all_targets_dependency field marks the dependency graph selected by
8
+ the renderer's normal/build features across all targets; remaining entries are
9
+ locked workspace dependencies that are not selected by that graph.
10
+
11
+ Rust crate sources are unmodified. Exact corresponding source archives, including
12
+ MPL-2.0 sources, are available at the archive_url in each inventory entry. Source
13
+ archives can be downloaded and verified with the recorded archive_sha256. Source
14
+ license terms remain those of each crate; the local bridge does not relicense them.
15
+ The embedded usvg/resvg changes are identified by the recorded upstream patch.
16
+
17
+ The resvg/ directory contains the upstream Apache-2.0 and MIT license texts.
18
+ The libpng/ and zlib/ directories preserve their source distribution licenses.
19
+ The fonts/ directory preserves fixture font licenses and embedded copyright
20
+ notices. Test fonts are not loaded implicitly by the renderer.
21
+
22
+ This inventory covers bundled third-party dependencies and test fixtures.
23
+ Platform system libraries are supplied by the target operating system.
@@ -0,0 +1,13 @@
1
+ Copyright notices read from the unmodified fixture fonts' OpenType name ID 0:
2
+
3
+ NotoSans-Regular.ttf, NotoSans-Bold.ttf and NotoSans-Italic.ttf:
4
+ Copyright 2015 Google Inc. All Rights Reserved.
5
+
6
+ NotoSans-Condensed.ttf:
7
+ Copyright 2015-2021 Google LLC. All Rights Reserved.
8
+
9
+ NotoSansDevanagari-Regular.ttf:
10
+ Copyright 2022 The Noto Project Authors (https://github.com/notofonts/devanagari)
11
+
12
+ All three fonts declare SIL Open Font License 1.1 in OpenType name ID 13.
13
+ Their complete license text is supplied in OFL-1.1.txt.
@@ -0,0 +1,94 @@
1
+ Copyright 2018 The Noto Project Authors (github.com/googlei18n/noto-fonts)
2
+
3
+ This Font Software is licensed under the SIL Open Font License,
4
+ Version 1.1.
5
+
6
+ This license is copied below, and is also available with a FAQ at:
7
+ http://scripts.sil.org/OFL
8
+
9
+ -----------------------------------------------------------
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+ -----------------------------------------------------------
12
+
13
+ PREAMBLE
14
+ The goals of the Open Font License (OFL) are to stimulate worldwide
15
+ development of collaborative font projects, to support the font
16
+ creation efforts of academic and linguistic communities, and to
17
+ provide a free and open framework in which fonts may be shared and
18
+ improved in partnership with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves. The
22
+ fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply to
27
+ any document created using the fonts or their derivatives.
28
+
29
+ DEFINITIONS
30
+ "Font Software" refers to the set of files released by the Copyright
31
+ Holder(s) under this license and clearly marked as such. This may
32
+ include source files, build scripts and documentation.
33
+
34
+ "Reserved Font Name" refers to any names specified as such after the
35
+ copyright statement(s).
36
+
37
+ "Original Version" refers to the collection of Font Software
38
+ components as distributed by the Copyright Holder(s).
39
+
40
+ "Modified Version" refers to any derivative made by adding to,
41
+ deleting, or substituting -- in part or in whole -- any of the
42
+ components of the Original Version, by changing formats or by porting
43
+ the Font Software to a new environment.
44
+
45
+ "Author" refers to any designer, engineer, programmer, technical
46
+ writer or other person who contributed to the Font Software.
47
+
48
+ PERMISSION & CONDITIONS
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of the Font Software, to use, study, copy, merge, embed,
51
+ modify, redistribute, and sell modified and unmodified copies of the
52
+ Font Software, subject to the following conditions:
53
+
54
+ 1) Neither the Font Software nor any of its individual components, in
55
+ Original or Modified Versions, may be sold by itself.
56
+
57
+ 2) Original or Modified Versions of the Font Software may be bundled,
58
+ redistributed and/or sold with any software, provided that each copy
59
+ contains the above copyright notice and this license. These can be
60
+ included either as stand-alone text files, human-readable headers or
61
+ in the appropriate machine-readable metadata fields within text or
62
+ binary files as long as those fields can be easily viewed by the user.
63
+
64
+ 3) No Modified Version of the Font Software may use the Reserved Font
65
+ Name(s) unless explicit written permission is granted by the
66
+ corresponding Copyright Holder. This restriction only applies to the
67
+ primary font name as presented to the users.
68
+
69
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+ Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except to acknowledge the contribution(s) of the
72
+ Copyright Holder(s) and the Author(s) or with their explicit written
73
+ permission.
74
+
75
+ 5) The Font Software, modified or unmodified, in part or in whole,
76
+ must be distributed entirely under this license, and must not be
77
+ distributed under any other license. The requirement for fonts to
78
+ remain under this license does not apply to any document created using
79
+ the Font Software.
80
+
81
+ TERMINATION
82
+ This license becomes null and void if any of the above conditions are
83
+ not met.
84
+
85
+ DISCLAIMER
86
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,92 @@
1
+ This Font Software is licensed under the SIL Open Font License,
2
+ Version 1.1.
3
+
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font
14
+ creation efforts of academic and linguistic communities, and to
15
+ provide a free and open framework in which fonts may be shared and
16
+ improved in partnership with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply to
25
+ any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software
36
+ components as distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to,
39
+ deleting, or substituting -- in part or in whole -- any of the
40
+ components of the Original Version, by changing formats or by porting
41
+ the Font Software to a new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION & CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed,
49
+ modify, redistribute, and sell modified and unmodified copies of the
50
+ Font Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components, in
53
+ Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the
64
+ corresponding Copyright Holder. This restriction only applies to the
65
+ primary font name as presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created using
77
+ the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,134 @@
1
+ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
2
+ =========================================
3
+
4
+ PNG Reference Library License version 2
5
+ ---------------------------------------
6
+
7
+ * Copyright (c) 1995-2026 The PNG Reference Library Authors.
8
+ * Copyright (c) 2018-2026 Cosmin Truta.
9
+ * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
10
+ * Copyright (c) 1996-1997 Andreas Dilger.
11
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
12
+
13
+ The software is supplied "as is", without warranty of any kind,
14
+ express or implied, including, without limitation, the warranties
15
+ of merchantability, fitness for a particular purpose, title, and
16
+ non-infringement. In no event shall the Copyright owners, or
17
+ anyone distributing the software, be liable for any damages or
18
+ other liability, whether in contract, tort or otherwise, arising
19
+ from, out of, or in connection with the software, or the use or
20
+ other dealings in the software, even if advised of the possibility
21
+ of such damage.
22
+
23
+ Permission is hereby granted to use, copy, modify, and distribute
24
+ this software, or portions hereof, for any purpose, without fee,
25
+ subject to the following restrictions:
26
+
27
+ 1. The origin of this software must not be misrepresented; you
28
+ must not claim that you wrote the original software. If you
29
+ use this software in a product, an acknowledgment in the product
30
+ documentation would be appreciated, but is not required.
31
+
32
+ 2. Altered source versions must be plainly marked as such, and must
33
+ not be misrepresented as being the original software.
34
+
35
+ 3. This Copyright notice may not be removed or altered from any
36
+ source or altered source distribution.
37
+
38
+
39
+ PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
40
+ -----------------------------------------------------------------------
41
+
42
+ libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
43
+ Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
44
+ derived from libpng-1.0.6, and are distributed according to the same
45
+ disclaimer and license as libpng-1.0.6 with the following individuals
46
+ added to the list of Contributing Authors:
47
+
48
+ Simon-Pierre Cadieux
49
+ Eric S. Raymond
50
+ Mans Rullgard
51
+ Cosmin Truta
52
+ Gilles Vollant
53
+ James Yu
54
+ Mandar Sahastrabuddhe
55
+ Google Inc.
56
+ Vadim Barkov
57
+
58
+ and with the following additions to the disclaimer:
59
+
60
+ There is no warranty against interference with your enjoyment of
61
+ the library or against infringement. There is no warranty that our
62
+ efforts or the library will fulfill any of your particular purposes
63
+ or needs. This library is provided with all faults, and the entire
64
+ risk of satisfactory quality, performance, accuracy, and effort is
65
+ with the user.
66
+
67
+ Some files in the "contrib" directory and some configure-generated
68
+ files that are distributed with libpng have other copyright owners, and
69
+ are released under other open source licenses.
70
+
71
+ libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
72
+ Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
73
+ libpng-0.96, and are distributed according to the same disclaimer and
74
+ license as libpng-0.96, with the following individuals added to the
75
+ list of Contributing Authors:
76
+
77
+ Tom Lane
78
+ Glenn Randers-Pehrson
79
+ Willem van Schaik
80
+
81
+ libpng versions 0.89, June 1996, through 0.96, May 1997, are
82
+ Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
83
+ and are distributed according to the same disclaimer and license as
84
+ libpng-0.88, with the following individuals added to the list of
85
+ Contributing Authors:
86
+
87
+ John Bowler
88
+ Kevin Bracey
89
+ Sam Bushell
90
+ Magnus Holmgren
91
+ Greg Roelofs
92
+ Tom Tanner
93
+
94
+ Some files in the "scripts" directory have other copyright owners,
95
+ but are released under this license.
96
+
97
+ libpng versions 0.5, May 1995, through 0.88, January 1996, are
98
+ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
99
+
100
+ For the purposes of this copyright and license, "Contributing Authors"
101
+ is defined as the following set of individuals:
102
+
103
+ Andreas Dilger
104
+ Dave Martindale
105
+ Guy Eric Schalnat
106
+ Paul Schmidt
107
+ Tim Wegner
108
+
109
+ The PNG Reference Library is supplied "AS IS". The Contributing
110
+ Authors and Group 42, Inc. disclaim all warranties, expressed or
111
+ implied, including, without limitation, the warranties of
112
+ merchantability and of fitness for any purpose. The Contributing
113
+ Authors and Group 42, Inc. assume no liability for direct, indirect,
114
+ incidental, special, exemplary, or consequential damages, which may
115
+ result from the use of the PNG Reference Library, even if advised of
116
+ the possibility of such damage.
117
+
118
+ Permission is hereby granted to use, copy, modify, and distribute this
119
+ source code, or portions hereof, for any purpose, without fee, subject
120
+ to the following restrictions:
121
+
122
+ 1. The origin of this source code must not be misrepresented.
123
+
124
+ 2. Altered versions must be plainly marked as such and must not
125
+ be misrepresented as being the original source.
126
+
127
+ 3. This Copyright notice may not be removed or altered from any
128
+ source or altered source distribution.
129
+
130
+ The Contributing Authors and Group 42, Inc. specifically permit,
131
+ without fee, and encourage the use of this source code as a component
132
+ to supporting the PNG file format in commercial products. If you use
133
+ this source code in a product, acknowledgment is not required but would
134
+ be appreciated.
@@ -0,0 +1,16 @@
1
+ MIT No Attribution
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so.
9
+
10
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+ SOFTWARE.
@@ -0,0 +1,19 @@
1
+ MIT License
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.