vectory 0.10.1 → 0.10.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbf800fda7352c671459d15edf027eebb640c22e15d442ea56c4d53a8776fd2b
4
- data.tar.gz: ee2f5cc26a74337d76323da92f1a6abde859436022a976eac8966421aa86c86a
3
+ metadata.gz: 50d97784f6629c9150bb2da21c151ba9f5a971e0c949bcb40c6f1e56a56a9e0c
4
+ data.tar.gz: 1494199096329b53ec283fc424df6b49fcb1a0f95271b841e8289ee7d2e7fb49
5
5
  SHA512:
6
- metadata.gz: c080dbacd92170ef37bc37664caba98f95378ef90730985734dd5568a4db4a43416c09a90cacc1fb2392b121ceb117ce3474ad9c8ae301652d8c6ca030cc1d98
7
- data.tar.gz: 617496862f207a82ce61695638cbb5b5061d230e18c1f8835bdb3183e763075460539fc9398ed1c1a28352e0615b1a7bad6c62165b525a6ec3ce912d95cead7b
6
+ metadata.gz: 13129736f9ec596505e93e5e2b8904928be9dfb98ee9198259b34bdfecfdcbc2e0ca35e8e99133af06f9e65899434c55873f7bb5c94f42951360d13e6d812fc6
7
+ data.tar.gz: 4daa37bcf802de4eaac71466694b229d6fee62e10b11237253f05a4e855da18b7646fcd14d4530ae8961ebf49b6cfcc60887b29761e4096ac65a885224fa9ec9
@@ -32,21 +32,22 @@ svg_to_eps = Vectory::Svg.from_path("diagram.svg").to_eps
32
32
  eps_to_svg = Vectory::Eps.from_path("diagram.eps").to_svg
33
33
  ----
34
34
 
35
- === Two-Step Conversions (EPS/PS → SVG)
35
+ === Direct Conversions (via postsvg)
36
36
 
37
- EPS and PS files are converted to SVG through a PDF intermediate:
38
-
39
- 1. **EPS/PS → PDF** (via Ghostscript): Preserves BoundingBox information
40
- 2. **PDF → SVG** (via Inkscape): Converts PDF to SVG
37
+ EPS and PS files are converted to SVG directly by the postsvg gem (pure Ruby, no Ghostscript or Inkscape):
41
38
 
42
39
  [source,ruby]
43
40
  ----
44
- # Two-step conversion (automatic)
45
41
  eps = Vectory::Eps.from_path("diagram.eps")
46
- svg = eps.to_svg # Internally: EPS → PDF → SVG
42
+ svg = eps.to_svg # Uses postsvg directly
43
+
44
+ ps = Vectory::Ps.from_path("diagram.ps")
45
+ svg = ps.to_svg # Also postsvg
47
46
  ----
48
47
 
49
- This two-step process ensures accurate dimension preservation from EPS/PS files.
48
+ postsvg reads the `%%BoundingBox` DSC comment to size the viewBox. Limitations: text/font rendering, image embedding, gradients/patterns, CMYK, and PS Level 2/3 advanced operators are not yet supported by postsvg upstream — EPS/PS files using those features will silently degrade.
49
+
50
+ === Two-Step Conversions (EPS/PS → PDF/PS/EMF)
50
51
 
51
52
  === EMF Conversions (via emfsvg)
52
53
 
@@ -73,11 +74,11 @@ emf = Vectory::Svg.from_path("chart.svg").to_emf
73
74
  |SVG|EMF|emfsvg gem
74
75
  |SVG|PDF|Inkscape
75
76
 
76
- |EPS|SVG|Ghostscript + Inkscape (two-step)
77
+ |EPS|SVG|postsvg gem
77
78
  |EPS|PDF|Ghostscript
78
79
  |EPS|PS|Via PDF intermediate
79
80
 
80
- |PS|SVG|Ghostscript + Inkscape (two-step)
81
+ |PS|SVG|postsvg gem
81
82
  |PS|PDF|Ghostscript
82
83
  |PS|EPS|Via PDF intermediate
83
84
 
@@ -68,23 +68,30 @@ Vectory uses different external tools depending on the source and target formats
68
68
 
69
69
  === Direct Conversions (via Inkscape)
70
70
 
71
- * **SVG → EPS/PS/EMF/PDF** (via Inkscape export)
72
- * **EPS/PS/EMF/PDF → SVG** (via Inkscape import)
71
+ * **SVG → EPS/PS/PDF** (via Inkscape export)
72
+ * **PDF → SVG** (via Inkscape import)
73
73
 
74
74
  Inkscape handles direct conversions to and from SVG format.
75
75
 
76
76
  === Direct Conversions (via emfsvg)
77
77
 
78
- * **EMF SVG** (via emfsvg gem)
78
+ * **SVG EMF** (via emfsvg gem, both directions)
79
79
 
80
- The emfsvg gem provides native EMF to SVG conversion in pure Ruby, with no external tool dependency.
80
+ The emfsvg gem provides bidirectional EMF SVG conversion in pure Ruby, with no external tool dependency.
81
+
82
+ === Direct Conversions (via postsvg)
83
+
84
+ * **EPS → SVG** (via postsvg gem)
85
+ * **PS → SVG** (via postsvg gem)
86
+
87
+ The postsvg gem converts PS/EPS to SVG in pure Ruby, with no external tool dependency.
81
88
 
82
89
  === Two-Step Conversions (via Ghostscript + Inkscape)
83
90
 
84
- * **EPS → PDF → SVG** (Ghostscript for EPS→PDF, Inkscape for PDF→SVG)
85
- * **PS → PDF → SVG** (Ghostscript for PS→PDF, Inkscape for PDF→SVG)
91
+ * **EPS → PDF → SVG** (legacy path; replaced by postsvg for `Eps#to_svg`)
92
+ * **PS → PDF → SVG** (legacy path; replaced by postsvg for `Ps#to_svg`)
86
93
 
87
- This two-step process preserves BoundingBox information from EPS/PS files.
94
+ EPS/PS PDF and EPS/PS → PS/EMF (via PDF intermediate) still go through Ghostscript.
88
95
 
89
96
  === Conversion Tool Matrix
90
97
 
@@ -95,11 +95,12 @@ Vectory uses a flexible conversion pipeline:
95
95
  Some conversions are direct:
96
96
  * **SVG → EPS/PS/PDF**: Via Inkscape
97
97
  * **SVG ↔ EMF**: Via emfsvg (both directions, pure Ruby)
98
+ * **EPS → SVG** and **PS → SVG**: Via postsvg (pure Ruby)
98
99
 
99
100
  === Two-Step Conversions
100
101
 
101
102
  Other conversions use an intermediate PDF format:
102
- * **EPS/PS → PDF → SVG**: Via Ghostscript + Inkscape
103
+ * **EPS/PS → PDF → {PS,EMF}**: Via Ghostscript + Inkscape
103
104
 
104
105
  This two-step conversion ensures:
105
106
  * BoundingBox preservation from EPS/PS
data/lib/vectory/eps.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "postsvg"
4
+
3
5
  module Vectory
4
6
  class Eps < Vector
5
7
  def self.default_extension
@@ -24,7 +26,7 @@ module Vectory
24
26
  end
25
27
 
26
28
  def to_svg
27
- to_pdf.to_svg
29
+ Svg.from_content(Postsvg.convert(content))
28
30
  end
29
31
 
30
32
  def to_emf
data/lib/vectory/ps.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "postsvg"
4
+
3
5
  module Vectory
4
6
  class Ps < Vector
5
7
  def self.default_extension
@@ -28,7 +30,7 @@ module Vectory
28
30
  end
29
31
 
30
32
  def to_svg
31
- to_pdf.to_svg
33
+ Svg.from_content(Postsvg.convert(content))
32
34
  end
33
35
 
34
36
  def to_pdf
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vectory
4
- VERSION = "0.10.1"
4
+ VERSION = "0.10.2"
5
5
  end
data/vectory.gemspec CHANGED
@@ -31,6 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "image_size", ">= 3.2.0"
32
32
  spec.add_dependency "marcel", "~> 1.0"
33
33
  spec.add_dependency "nokogiri", "~> 1.14"
34
+ spec.add_dependency "postsvg", "~> 0.1"
34
35
  spec.add_dependency "thor", "~> 1.0"
35
36
  spec.add_dependency "ukiryu", "~> 0.3.0"
36
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vectory
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-26 00:00:00.000000000 Z
11
+ date: 2026-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -86,6 +86,20 @@ dependencies:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '1.14'
89
+ - !ruby/object:Gem::Dependency
90
+ name: postsvg
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.1'
96
+ type: :runtime
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.1'
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: thor
91
105
  requirement: !ruby/object:Gem::Requirement