vectory 0.10.0 → 0.10.1

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: 1e936512c4967e596a23bb3ec650978a5ba0b92b0851463b3989e80d61d15f3c
4
- data.tar.gz: 21366c8069cfd18995bbc6b98eae96b18de8a29feea85213c63735a76dda2782
3
+ metadata.gz: fbf800fda7352c671459d15edf027eebb640c22e15d442ea56c4d53a8776fd2b
4
+ data.tar.gz: ee2f5cc26a74337d76323da92f1a6abde859436022a976eac8966421aa86c86a
5
5
  SHA512:
6
- metadata.gz: 115b63b774e9b2466804d710bb38f89acd34f01822afeeeb83c294a905889ac366c4ade6b8a7d3997b0dfbe948d943df7268f298486ce8ea04dc5ea069a35bde
7
- data.tar.gz: 2253728a79e8a9ffa1f511328d9c22439e7eae3a695447f0fad16881878f85d3cc0fe5942ef4dca126f2b9d8860ca4b3a69d6110ef47fb3bf9b9a20605d43f58
6
+ metadata.gz: c080dbacd92170ef37bc37664caba98f95378ef90730985734dd5568a4db4a43416c09a90cacc1fb2392b121ceb117ce3474ad9c8ae301652d8c6ca030cc1d98
7
+ data.tar.gz: 617496862f207a82ce61695638cbb5b5061d230e18c1f8835bdb3183e763075460539fc9398ed1c1a28352e0615b1a7bad6c62165b525a6ec3ce912d95cead7b
data/README.adoc CHANGED
@@ -23,7 +23,7 @@ ____
23
23
 
24
24
  Vectory relies on the following software to be installed:
25
25
 
26
- * https://github.com/metanorma/emf2svg-ruby[emf2svg-ruby]
26
+ * https://github.com/claricle/emfsvg[emfsvg]
27
27
  * https://inkscape.org[Inkscape]
28
28
  * https://www.ghostscript.com/[Ghostscript]
29
29
 
@@ -10,7 +10,7 @@ How Vectory converts between vector image formats.
10
10
 
11
11
  == Overview
12
12
 
13
- Vectory supports pairwise conversion between EPS, PS, EMF, SVG, and PDF formats. Conversions are performed through external tools (Inkscape, Ghostscript, emf2svg) with a unified Ruby interface.
13
+ Vectory supports pairwise conversion between EPS, PS, EMF, SVG, and PDF formats. Conversions are performed through external tools (Inkscape, Ghostscript) and the emfsvg gem, with a unified Ruby interface.
14
14
 
15
15
  == Conversion Paths
16
16
 
@@ -20,11 +20,9 @@ Inkscape handles direct conversions between SVG and other formats:
20
20
 
21
21
  * **SVG → EPS**: Export SVG to Encapsulated PostScript
22
22
  * **SVG → PS**: Export SVG to PostScript
23
- * **SVG → EMF**: Export SVG to Enhanced Metafile
24
23
  * **SVG → PDF**: Export SVG to PDF
25
24
  * **EPS → SVG**: Import EPS and export to SVG
26
25
  * **PS → SVG**: Import PS and export to SVG
27
- * **EMF → SVG**: Import EMF and export to SVG
28
26
  * **PDF → SVG**: Import PDF and export to SVG
29
27
 
30
28
  [source,ruby]
@@ -50,15 +48,18 @@ svg = eps.to_svg # Internally: EPS → PDF → SVG
50
48
 
51
49
  This two-step process ensures accurate dimension preservation from EPS/PS files.
52
50
 
53
- === EMF Conversions (via emf2svg)
51
+ === EMF Conversions (via emfsvg)
54
52
 
55
- EMF files are converted using the emf2svg gem:
53
+ EMF files are converted using the emfsvg gem:
56
54
 
57
55
  [source,ruby]
58
56
  ----
59
57
  # EMF to SVG conversion
60
58
  emf = Vectory::Emf.from_path("chart.emf")
61
- svg = emf.to_svg # Uses emf2svg gem
59
+ svg = emf.to_svg # Uses emfsvg gem
60
+
61
+ # SVG to EMF conversion (also emfsvg, no Inkscape needed)
62
+ emf = Vectory::Svg.from_path("chart.svg").to_emf
62
63
  ----
63
64
 
64
65
  == Conversion Matrix
@@ -69,7 +70,7 @@ svg = emf.to_svg # Uses emf2svg gem
69
70
 
70
71
  |SVG|EPS|Inkscape
71
72
  |SVG|PS|Inkscape
72
- |SVG|EMF|Inkscape
73
+ |SVG|EMF|emfsvg gem
73
74
  |SVG|PDF|Inkscape
74
75
 
75
76
  |EPS|SVG|Ghostscript + Inkscape (two-step)
@@ -80,7 +81,7 @@ svg = emf.to_svg # Uses emf2svg gem
80
81
  |PS|PDF|Ghostscript
81
82
  |PS|EPS|Via PDF intermediate
82
83
 
83
- |EMF|SVG|emf2svg gem
84
+ |EMF|SVG|emfsvg gem
84
85
  |EMF|EPS|Via SVG intermediate
85
86
  |EMF|PS|Via SVG intermediate
86
87
 
@@ -116,7 +117,7 @@ Vector graphics maintain full precision through conversions. Rasterization does
116
117
 
117
118
  * **Direct conversions** (via Inkscape): ~1-3 seconds for typical files
118
119
  * **Two-step conversions** (EPS/PS → SVG): ~2-5 seconds (Ghostscript + Inkscape)
119
- * **EMF conversions** (via emf2svg): ~1-2 seconds
120
+ * **EMF conversions** (via emfsvg): ~1-2 seconds
120
121
 
121
122
  === Caching
122
123
 
@@ -111,13 +111,13 @@ pdf = eps.to_pdf # BoundingBox preserved from EPS
111
111
 
112
112
  == Gem Dependencies
113
113
 
114
- === emf2svg
114
+ === emfsvg
115
115
 
116
116
  **Purpose**: EMF format support
117
117
 
118
- **Version**: ~> 1.0
118
+ **Version**: ~> 0.1
119
119
 
120
- emf2svg provides EMF to SVG conversion without external tool dependencies.
120
+ emfsvg provides EMF to SVG conversion in pure Ruby, with no external tool dependency.
121
121
 
122
122
  **Integration**:
123
123
 
@@ -125,7 +125,7 @@ emf2svg provides EMF to SVG conversion without external tool dependencies.
125
125
  ----
126
126
  # Automatic conversion
127
127
  emf = Vectory::Emf.from_path("chart.emf")
128
- svg = emf.to_svg # Uses emf2svg internally
128
+ svg = emf.to_svg # Uses emfsvg internally
129
129
  ----
130
130
 
131
131
  **Features**:
@@ -295,8 +295,8 @@ Downgrade to Inkscape 1.3.0
295
295
  **Ghostscript not found**::
296
296
  Install Ghostscript or set `GHOSTSCRIPT_PATH`
297
297
 
298
- **emf2svg conversion fails**::
299
- Ensure emf2svg gem is installed: `gem install emf2svg`
298
+ **emfsvg conversion fails**::
299
+ Ensure emfsvg gem is installed: `gem install emfsvg`
300
300
 
301
301
  == See Also
302
302
 
@@ -73,11 +73,11 @@ Vectory uses different external tools depending on the source and target formats
73
73
 
74
74
  Inkscape handles direct conversions to and from SVG format.
75
75
 
76
- === Direct Conversions (via emf2svg)
76
+ === Direct Conversions (via emfsvg)
77
77
 
78
- * **EMF → SVG** (via emf2svg gem)
78
+ * **EMF → SVG** (via emfsvg gem)
79
79
 
80
- The emf2svg gem provides native EMF to SVG conversion without external tool dependencies.
80
+ The emfsvg gem provides native EMF to SVG conversion in pure Ruby, with no external tool dependency.
81
81
 
82
82
  === Two-Step Conversions (via Ghostscript + Inkscape)
83
83
 
@@ -99,7 +99,7 @@ This two-step process preserves BoundingBox information from EPS/PS files.
99
99
  |Inkscape
100
100
 
101
101
  |SVG ↔ EMF
102
- |Inkscape (SVG→EMF), emf2svg (EMF→SVG)
102
+ |emfsvg gem (both directions)
103
103
 
104
104
  |SVG ↔ PDF
105
105
  |Inkscape
@@ -114,7 +114,7 @@ This two-step process preserves BoundingBox information from EPS/PS files.
114
114
  |Ghostscript + Inkscape (two-step)
115
115
 
116
116
  |EMF → SVG
117
- |emf2svg gem
117
+ |emfsvg gem (SVG → EMF also uses emfsvg)
118
118
  |===
119
119
 
120
120
  See link:conversion/[Conversion Features] for detailed conversion paths and options.
@@ -133,7 +133,7 @@ Comprehensive guide to all external tools and gems.
133
133
  +
134
134
  * **Inkscape** - Primary conversion engine for SVG, EPS, PS, EMF, PDF
135
135
  * **Ghostscript** - EPS/PS to PDF conversion with BoundingBox preservation
136
- * **emf2svg** - EMF format support via Ruby gem
136
+ * **emfsvg** - EMF format support via pure-Ruby gem
137
137
  * **moxml** - XML/HTML parsing for Metanorma integration
138
138
 
139
139
  link:timeout-handling/[**Timeout and Error Handling**]::
@@ -93,8 +93,8 @@ Vectory uses a flexible conversion pipeline:
93
93
  === Direct Conversions
94
94
 
95
95
  Some conversions are direct:
96
- * **SVG → EPS/PS/EMF/PDF**: Via Inkscape
97
- * **EMF SVG**: Via emf2svg
96
+ * **SVG → EPS/PS/PDF**: Via Inkscape
97
+ * **SVG EMF**: Via emfsvg (both directions, pure Ruby)
98
98
 
99
99
  === Two-Step Conversions
100
100
 
@@ -13,7 +13,7 @@ This guide covers installing Vectory and its external dependencies on different
13
13
 
14
14
  * **Inkscape** - Primary conversion tool for most format conversions
15
15
  * **Ghostscript** - EPS/PS to PDF conversion with bounding box preservation
16
- * **emf2svg** (gem) - EMF format support
16
+ * **emfsvg** (gem) - EMF format support
17
17
 
18
18
  == Installing the Gem
19
19
 
@@ -56,8 +56,8 @@ Vectory requires external tools for vector image conversion. These tools are inv
56
56
  |PostScript and PDF interpreter
57
57
  |EPS/PS → PDF conversion (bounding box preservation)
58
58
 
59
- |**emf2svg**
60
- |EMF to SVG converter (Ruby gem)
59
+ |**emfsvg**
60
+ |EMF to SVG converter (Ruby gem, pure Ruby)
61
61
  |EMF → SVG conversion
62
62
 
63
63
  |**moxml**
@@ -140,9 +140,9 @@ gs --version
140
140
  # 10.02.0 (or similar)
141
141
  ----
142
142
 
143
- === emf2svg (Ruby Gem)
143
+ === emfsvg (Ruby Gem)
144
144
 
145
- The `emf2svg` gem is automatically installed with Vectory. It handles:
145
+ The `emfsvg` gem is automatically installed with Vectory. It handles:
146
146
 
147
147
  * **EMF → SVG**: Converts Windows Enhanced Metafile format to SVG
148
148
  * **Windows format support**: Provides EMF format support on all platforms
@@ -196,7 +196,7 @@ To prevent timeouts, Vectory automatically sets `DISPLAY=""` on macOS for headle
196
196
  |Ghostscript
197
197
  |Install via Homebrew; standard Unix behavior
198
198
 
199
- |emf2svg gem
199
+ |emfsvg gem
200
200
  |Works natively on macOS
201
201
  |===
202
202
 
@@ -219,7 +219,7 @@ Windows has specific considerations for external tools:
219
219
  |Ghostscript
220
220
  |Install from 32-bit or 64-bit installer; must be in PATH
221
221
 
222
- |emf2svg gem
222
+ |emfsvg gem
223
223
  |Works natively on Windows
224
224
  |===
225
225
 
@@ -237,7 +237,7 @@ Standard Unix behavior applies on Linux distributions.
237
237
  |Ghostscript
238
238
  |Standard package; may need `gsfonts` for full functionality
239
239
 
240
- |emf2svg gem
240
+ |emfsvg gem
241
241
  |Works natively on Linux
242
242
  |===
243
243
 
@@ -44,7 +44,7 @@ Inkscape conversion, quality considerations.
44
44
  link:emf-to-svg[**Converting EMF to SVG**]::
45
45
  EMF to SVG conversion workflow.
46
46
  +
47
- emf2svg integration, output validation.
47
+ emfsvg integration, output validation.
48
48
 
49
49
  == Integration Guides
50
50
 
data/docs/index.adoc CHANGED
@@ -20,7 +20,7 @@ Vectory helps you:
20
20
 
21
21
  * **Convert** between vector image formats (EPS, PS, EMF, SVG, PDF)
22
22
  * **Preserve** document metadata and bounding boxes
23
- * **Leverage** external tools (Inkscape, Ghostscript, emf2svg) for reliable conversions
23
+ * **Leverage** external tools (Inkscape, Ghostscript) and the emfsvg gem for reliable conversions
24
24
  * **Process** images from files, content, or data URIs
25
25
  * **Query** image dimensions without full rendering
26
26
 
@@ -125,9 +125,9 @@ Vectory requires external tools for vector image conversion:
125
125
 
126
126
  === Ruby Gems (installed automatically)
127
127
 
128
- * **emf2svg** (~> 1.0)
128
+ * **emfsvg** (~> 0.1)
129
129
  ** for EMF → SVG conversion
130
- ** provides Windows EMF format support
130
+ ** pure-Ruby; provides Windows EMF format support
131
131
 
132
132
  * **moxml** (~> 0.5)
133
133
  ** for XML/HTML parsing (Metanorma integration)
@@ -102,7 +102,7 @@ emf = Vectory::Emf.from_path("chart.emf")
102
102
  svg = emf.to_svg
103
103
  ----
104
104
 
105
- Uses the emf2svg gem for conversion.
105
+ Uses the emfsvg gem for conversion.
106
106
 
107
107
  === Vectory::Pdf
108
108
 
@@ -77,8 +77,8 @@ Ghostscript requirements and usage.
77
77
  +
78
78
  EPS/PS to PDF conversion, bounding box handling.
79
79
 
80
- link:emf2svg[**emf2svg**]::
81
- emf2svg gem integration.
80
+ link:emfsvg[**emfsvg**]::
81
+ emfsvg gem integration.
82
82
  +
83
83
  EMF format support and limitations.
84
84
 
@@ -113,8 +113,8 @@ Some conversions are direct:
113
113
 
114
114
  [source,text]
115
115
  ----
116
- SVG → Inkscape → EPS/PS/EMF/PDF
117
- EMF emf2svg SVG
116
+ SVG → Inkscape → EPS/PS/PDF
117
+ SVG emfsvg EMF
118
118
  ----
119
119
 
120
120
  === Two-Step Conversions
@@ -33,7 +33,7 @@ Direct conversions vs. two-step conversions through PDF.
33
33
  link:external-dependencies[**External Dependencies Overview**]::
34
34
  Comprehensive guide to all external tools and gems.
35
35
  +
36
- Inkscape, Ghostscript, emf2svg, moxml - their purposes and how Vectory integrates with them.
36
+ Inkscape, Ghostscript, emfsvg, moxml - their purposes and how Vectory integrates with them.
37
37
 
38
38
  link:inkscape-wrapper[**Inkscape Wrapper**]::
39
39
  Singleton pattern implementation for Inkscape integration.
@@ -45,8 +45,8 @@ Ghostscript integration for EPS/PS to PDF conversion.
45
45
  +
46
46
  BoundingBox preservation, PDF generation, command-line options.
47
47
 
48
- link:emf2svg-integration[**emf2svg Integration**]::
49
- EMF format support via the emf2svg gem.
48
+ link:emfsvg-integration[**emfsvg Integration**]::
49
+ EMF format support via the emfsvg gem.
50
50
  +
51
51
  Windows EMF conversion, cross-platform compatibility.
52
52
 
data/lib/vectory/emf.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "emf2svg"
3
+ require "emfsvg"
4
4
 
5
5
  module Vectory
6
6
  class Emf < Vector
@@ -28,13 +28,7 @@ module Vectory
28
28
  end
29
29
 
30
30
  def to_svg
31
- Dir.mktmpdir do |dir|
32
- input_path = File.join(dir, "image.emf")
33
- File.binwrite(input_path, content)
34
-
35
- svg_content = Emf2svg.from_file(input_path)
36
- Svg.from_content(svg_content)
37
- end
31
+ Svg.from_content(Emfsvg.from_bytes(content))
38
32
  end
39
33
 
40
34
  def to_eps
data/lib/vectory/svg.rb CHANGED
@@ -32,12 +32,7 @@ module Vectory
32
32
  end
33
33
 
34
34
  def to_emf
35
- InkscapeWrapper.convert(
36
- content: content,
37
- input_format: :svg,
38
- output_format: :emf,
39
- output_class: Emf,
40
- )
35
+ Emf.from_content(Emfsvg.from_svg(content))
41
36
  end
42
37
 
43
38
  def to_eps
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vectory
4
- VERSION = "0.10.0"
4
+ VERSION = "0.10.1"
5
5
  end
data/vectory.gemspec CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.required_ruby_version = ">= 3.1.0"
28
28
 
29
29
  spec.add_dependency "base64"
30
- spec.add_dependency "emf2svg"
30
+ spec.add_dependency "emfsvg", "~> 0.1", ">= 0.1.2"
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"
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.0
4
+ version: 0.10.1
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-05-06 00:00:00.000000000 Z
11
+ date: 2026-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -25,19 +25,25 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: emf2svg
28
+ name: emfsvg
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.1'
31
34
  - - ">="
32
35
  - !ruby/object:Gem::Version
33
- version: '0'
36
+ version: 0.1.2
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '0.1'
38
44
  - - ">="
39
45
  - !ruby/object:Gem::Version
40
- version: '0'
46
+ version: 0.1.2
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: image_size
43
49
  requirement: !ruby/object:Gem::Requirement