vectory 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -1
- data/.github/workflows/release.yml +24 -0
- data/.gitignore +4 -0
- data/README.adoc +157 -1
- data/Rakefile +4 -0
- data/bin/vectory +9 -0
- data/emf.emf +1 -0
- data/lib/vectory/cli.rb +140 -0
- data/lib/vectory/datauri.rb +48 -0
- data/lib/vectory/emf.rb +31 -0
- data/lib/vectory/eps.rb +31 -0
- data/lib/vectory/file_magic.rb +53 -0
- data/lib/vectory/image.rb +23 -0
- data/lib/vectory/inkscape_converter.rb +72 -0
- data/lib/vectory/ps.rb +25 -0
- data/lib/vectory/svg.rb +27 -0
- data/lib/vectory/system_call.rb +49 -0
- data/lib/vectory/utils.rb +54 -0
- data/lib/vectory/vector.rb +74 -0
- data/lib/vectory/version.rb +1 -1
- data/lib/vectory.rb +34 -1
- data/spec/examples/emf2eps/img.emf +0 -0
- data/spec/examples/emf2eps/img.emf.datauri +1 -0
- data/spec/examples/emf2eps/img.eps +88 -0
- data/spec/examples/emf2ps/img.emf +0 -0
- data/spec/examples/emf2ps/img.ps +125 -0
- data/spec/examples/emf2svg/img.emf +0 -0
- data/spec/examples/emf2svg/img.svg +9 -0
- data/spec/examples/eps2emf/img.emf +0 -0
- data/spec/examples/eps2emf/img.eps +199 -0
- data/spec/examples/eps2emf/img.eps.datauri +1 -0
- data/spec/examples/eps2ps/img.eps +199 -0
- data/spec/examples/eps2ps/img.ps +549 -0
- data/spec/examples/eps2svg/img.eps +199 -0
- data/spec/examples/eps2svg/img.svg +173 -0
- data/spec/examples/eps_but_svg_extension.svg +199 -0
- data/spec/examples/img.jpg +0 -0
- data/spec/examples/ps2emf/img.emf +0 -0
- data/spec/examples/ps2emf/img.ps +549 -0
- data/spec/examples/ps2emf/img.ps.datauri +1 -0
- data/spec/examples/ps2eps/img.eps +844 -0
- data/spec/examples/ps2eps/img.ps +549 -0
- data/spec/examples/ps2svg/img.ps +549 -0
- data/spec/examples/ps2svg/img.svg +476 -0
- data/spec/examples/svg2emf/img.emf +0 -0
- data/spec/examples/svg2emf/img.svg +1 -0
- data/spec/examples/svg2emf/img.svg.datauri +1 -0
- data/spec/examples/svg2eps/img.eps +88 -0
- data/spec/examples/svg2eps/img.svg +1 -0
- data/spec/examples/svg2ps/img.ps +125 -0
- data/spec/examples/svg2ps/img.svg +1 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/support/matchers.rb +39 -0
- data/spec/support/text_matcher.rb +63 -0
- data/spec/support/vectory_helper.rb +17 -0
- data/spec/vectory/cli_spec.rb +214 -0
- data/spec/vectory/datauri_spec.rb +101 -0
- data/spec/vectory/emf_spec.rb +38 -0
- data/spec/vectory/eps_spec.rb +40 -0
- data/spec/vectory/file_magic_spec.rb +24 -0
- data/spec/vectory/inkscape_converter_spec.rb +38 -0
- data/spec/vectory/ps_spec.rb +33 -0
- data/spec/vectory/svg_spec.rb +33 -0
- data/spec/vectory/vector_spec.rb +60 -0
- data/tmp/.keep +0 -0
- data/vectory.gemspec +10 -3
- metadata +163 -20
data/lib/vectory/svg.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Vectory
|
4
|
+
class Svg < Vector
|
5
|
+
SVG = { "m" => "http://www.w3.org/2000/svg" }.freeze
|
6
|
+
|
7
|
+
def self.default_extension
|
8
|
+
"svg"
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.mimetype
|
12
|
+
"image/svg+xml"
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_emf
|
16
|
+
convert_with_inkscape("--export-type=emf", Emf)
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_eps
|
20
|
+
convert_with_inkscape("--export-type=eps", Eps)
|
21
|
+
end
|
22
|
+
|
23
|
+
def to_ps
|
24
|
+
convert_with_inkscape("--export-type=ps", Ps)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
require "open3"
|
2
|
+
|
3
|
+
module Vectory
|
4
|
+
class SystemCall
|
5
|
+
attr_reader :status, :stdout, :stderr, :cmd
|
6
|
+
|
7
|
+
def initialize(cmd)
|
8
|
+
@cmd = cmd
|
9
|
+
end
|
10
|
+
|
11
|
+
def call
|
12
|
+
log_cmd(@cmd)
|
13
|
+
|
14
|
+
execute(@cmd)
|
15
|
+
|
16
|
+
log_result
|
17
|
+
|
18
|
+
raise_error unless @status.success?
|
19
|
+
|
20
|
+
self
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def log_cmd(cmd)
|
26
|
+
Vectory.ui.debug("Cmd: '#{cmd}'")
|
27
|
+
end
|
28
|
+
|
29
|
+
def execute(cmd)
|
30
|
+
@stdout, @stderr, @status = Open3.capture3(cmd)
|
31
|
+
rescue Errno::ENOENT => e
|
32
|
+
raise SystemCallError, e.inspect
|
33
|
+
end
|
34
|
+
|
35
|
+
def log_result
|
36
|
+
Vectory.ui.debug("Status: #{@status.inspect}")
|
37
|
+
Vectory.ui.debug("Stdout: '#{@stdout.strip}'")
|
38
|
+
Vectory.ui.debug("Stderr: '#{@stderr.strip}'")
|
39
|
+
end
|
40
|
+
|
41
|
+
def raise_error
|
42
|
+
raise SystemCallError,
|
43
|
+
"Failed to run #{@cmd},\n " \
|
44
|
+
"status: #{@status.exitstatus},\n " \
|
45
|
+
"stdout: '#{@stdout.strip}',\n " \
|
46
|
+
"stderr: '#{@stderr.strip}'"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Vectory
|
4
|
+
class Utils
|
5
|
+
# Extracted from https://github.com/metanorma/metanorma-utils/blob/v1.5.2/lib/utils/image.rb
|
6
|
+
class << self
|
7
|
+
# sources/plantuml/plantuml20200524-90467-1iqek5i.png
|
8
|
+
# already includes localdir
|
9
|
+
# Check whether just the local path or the other specified relative path
|
10
|
+
# works.
|
11
|
+
def datauri(uri, local_dir = ".")
|
12
|
+
return uri if datauri?(uri) || url?(uri)
|
13
|
+
|
14
|
+
options = absolute_path?(uri) ? [uri] : [uri, File.join(local_dir, uri)]
|
15
|
+
path = options.detect do |p|
|
16
|
+
File.exist?(p) ? p : nil
|
17
|
+
end
|
18
|
+
|
19
|
+
unless path
|
20
|
+
warn "Image specified at `#{uri}` does not exist."
|
21
|
+
return uri # Return original provided location
|
22
|
+
end
|
23
|
+
|
24
|
+
encode_datauri(path)
|
25
|
+
end
|
26
|
+
|
27
|
+
def encode_datauri(path)
|
28
|
+
return nil unless File.exist?(path)
|
29
|
+
|
30
|
+
type = Marcel::MimeType.for(Pathname.new(path)) ||
|
31
|
+
'text/plain; charset="utf-8"'
|
32
|
+
|
33
|
+
bin = File.binread(path)
|
34
|
+
data = Base64.strict_encode64(bin)
|
35
|
+
"data:#{type};base64,#{data}"
|
36
|
+
rescue StandardError
|
37
|
+
warn "Data-URI encoding of `#{path}` failed."
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
|
41
|
+
def datauri?(uri)
|
42
|
+
/^data:/.match?(uri)
|
43
|
+
end
|
44
|
+
|
45
|
+
def url?(url)
|
46
|
+
%r{^[A-Z]{2,}://}i.match?(url)
|
47
|
+
end
|
48
|
+
|
49
|
+
def absolute_path?(uri)
|
50
|
+
%r{^/}.match?(uri) || %r{^[A-Z]:/}.match?(uri)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "inkscape_converter"
|
4
|
+
|
5
|
+
module Vectory
|
6
|
+
class Vector < Image
|
7
|
+
def self.from_path(path)
|
8
|
+
content = File.read(path, mode: "rb")
|
9
|
+
new(content, path)
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.default_extension
|
13
|
+
raise Vectory::NotImplementedError,
|
14
|
+
"#default_extension should be implemented in a subclass."
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.mimetype
|
18
|
+
raise Vectory::NotImplementedError,
|
19
|
+
"#mimetype should be implemented in a subclass."
|
20
|
+
end
|
21
|
+
|
22
|
+
attr_reader :initial_path
|
23
|
+
|
24
|
+
def initialize(content = nil, initial_path = nil)
|
25
|
+
super(content)
|
26
|
+
|
27
|
+
@initial_path = initial_path
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_uri
|
31
|
+
Datauri.from_vector(self)
|
32
|
+
end
|
33
|
+
|
34
|
+
def convert_with_inkscape(inkscape_options, target_class)
|
35
|
+
with_file(self.class.default_extension) do |input_path|
|
36
|
+
output_extension = target_class.default_extension
|
37
|
+
output_path = InkscapeConverter.instance.convert(input_path,
|
38
|
+
output_extension,
|
39
|
+
inkscape_options)
|
40
|
+
|
41
|
+
target_class.from_path(output_path)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def write(path = nil)
|
46
|
+
target_path = path || @path || tmp_path
|
47
|
+
File.binwrite(target_path, @content)
|
48
|
+
@path = File.expand_path(target_path)
|
49
|
+
|
50
|
+
self
|
51
|
+
end
|
52
|
+
|
53
|
+
def path
|
54
|
+
@path || raise(NotWrittenToDiskError)
|
55
|
+
end
|
56
|
+
|
57
|
+
private
|
58
|
+
|
59
|
+
def with_file(input_extension)
|
60
|
+
Dir.mktmpdir do |dir|
|
61
|
+
input_path = File.join(dir, "image.#{input_extension}")
|
62
|
+
File.binwrite(input_path, @content)
|
63
|
+
|
64
|
+
yield input_path
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def tmp_path
|
69
|
+
dir = Dir.mktmpdir
|
70
|
+
filename = "image.#{self.class.default_extension}"
|
71
|
+
File.join(dir, filename)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
data/lib/vectory/version.rb
CHANGED
data/lib/vectory.rb
CHANGED
@@ -1,8 +1,41 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "logger"
|
3
4
|
require_relative "vectory/version"
|
5
|
+
require_relative "vectory/utils"
|
6
|
+
require_relative "vectory/image"
|
7
|
+
require_relative "vectory/datauri"
|
8
|
+
require_relative "vectory/vector"
|
9
|
+
require_relative "vectory/eps"
|
10
|
+
require_relative "vectory/ps"
|
11
|
+
require_relative "vectory/emf"
|
12
|
+
require_relative "vectory/svg"
|
4
13
|
|
5
14
|
module Vectory
|
6
15
|
class Error < StandardError; end
|
7
|
-
|
16
|
+
|
17
|
+
class ConversionError < Error; end
|
18
|
+
|
19
|
+
class SystemCallError < Error; end
|
20
|
+
|
21
|
+
class InkscapeNotFoundError < Error; end
|
22
|
+
|
23
|
+
class NotImplementedError < Error; end
|
24
|
+
|
25
|
+
class NotWrittenToDiskError < Error; end
|
26
|
+
|
27
|
+
def self.ui
|
28
|
+
@ui ||= Logger.new(STDOUT).tap do |logger|
|
29
|
+
logger.level = ENV['VECTORY_LOG'] || Logger::WARN
|
30
|
+
logger.formatter = proc { |severity, datetime, progname, msg| "#{msg}\n" }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.root_path
|
35
|
+
Pathname.new(File.dirname(__dir__))
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.convert(image, format)
|
39
|
+
image.convert(format)
|
40
|
+
end
|
8
41
|
end
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
data:image/emf;base64,AQAAANQAAAAAAAAAAAAAAPsEAAD7BAAAAAAAAAAAAACLCgAAiwoAACBFTUYAAAEAMAQAACgAAAACAAAANAAAAGwAAAAAAAAA3ScAAH0zAADYAAAAFwEAAAAAAAAAAAAAAAAAAMBLAwDYQQQASQBuAGsAcwBjAGEAcABlACAAMQAuADMAIAAoADAAZQAxADUAMABlAGQALAAgADIAMAAyADMALQAwADcALQAyADEAKQAgAAAAZgBpAGwAZQAzAC4AcwB2AGcALgBlAG0AZgAAAAAAAAARAAAADAAAAAEAAAAkAAAAJAAAAAAAgD8AAAAAAAAAAAAAgD8AAAAAAAAAAAIAAABGAAAALAAAACAAAABTY3JlZW49MTAyMDV4MTMxODFweCwgMjE2eDI3OW1tAEYAAAAwAAAAIwAAAERyYXdpbmc9MTAwLjB4MTAwLjBweCwgMjYuNXgyNi41bW0AABIAAAAMAAAAAQAAABMAAAAMAAAAAgAAABYAAAAMAAAAGAAAABgAAAAMAAAAAAAAABQAAAAMAAAADQAAACcAAAAYAAAAAQAAAAAAAAAAAJkABgAAACUAAAAMAAAAAQAAADsAAAAIAAAAGwAAABAAAACkBAAAcQIAAAUAAAA0AAAAAAAAAAAAAAD//////////wMAAACkBAAAqAMAAKgDAACkBAAAcQIAAKQEAAAFAAAANAAAAAAAAAAAAAAA//////////8DAAAAOgEAAKQEAAA/AAAAqAMAAD8AAABxAgAABQAAADQAAAAAAAAAAAAAAP//////////AwAAAD8AAAA6AQAAOgEAAD8AAABxAgAAPwAAAAUAAAA0AAAAAAAAAAAAAAD//////////wMAAACoAwAAPwAAAKQEAAA6AQAApAQAAHECAAA9AAAACAAAADwAAAAIAAAAPgAAABgAAAAAAAAAAAAAAP//////////JQAAAAwAAAAFAACAKAAAAAwAAAABAAAAJwAAABgAAAABAAAAAAAAAP///wAGAAAAJQAAAAwAAAABAAAAOwAAAAgAAAAbAAAAEAAAAJ0BAABFAQAANgAAABAAAADPAwAARQEAAAUAAAA0AAAAAAAAAAAAAAD//////////wMAAABfBAAA7QEAAGQEAADjAgAA2wMAAJEDAAAFAAAANAAAAAAAAAAAAAAA//////////8DAAAAUgMAAD4EAABhAgAAcwQAAJ0BAAAOBAAANgAAABAAAACdAQAAyQIAADYAAAAQAAAA4gIAAMkCAAA2AAAAEAAAAOICAAAaAgAANgAAABAAAACdAQAAGgIAAD0AAAAIAAAAPAAAAAgAAAA+AAAAGAAAAAAAAAAAAAAA//////////8lAAAADAAAAAUAAIAoAAAADAAAAAEAAAAOAAAAFAAAAAAAAAAAAAAAMAQAAA==
|
@@ -0,0 +1,88 @@
|
|
1
|
+
%!PS-Adobe-3.0 EPSF-3.0
|
2
|
+
%%Creator: cairo 1.17.9 (https://cairographics.org)
|
3
|
+
%%CreationDate: Mon Oct 2 11:24:42 2023
|
4
|
+
%%Pages: 1
|
5
|
+
%%DocumentData: Clean7Bit
|
6
|
+
%%LanguageLevel: 2
|
7
|
+
%%BoundingBox: 3 5 72 74
|
8
|
+
%%EndComments
|
9
|
+
%%BeginProlog
|
10
|
+
50 dict begin
|
11
|
+
/q { gsave } bind def
|
12
|
+
/Q { grestore } bind def
|
13
|
+
/cm { 6 array astore concat } bind def
|
14
|
+
/w { setlinewidth } bind def
|
15
|
+
/J { setlinecap } bind def
|
16
|
+
/j { setlinejoin } bind def
|
17
|
+
/M { setmiterlimit } bind def
|
18
|
+
/d { setdash } bind def
|
19
|
+
/m { moveto } bind def
|
20
|
+
/l { lineto } bind def
|
21
|
+
/c { curveto } bind def
|
22
|
+
/h { closepath } bind def
|
23
|
+
/re { exch dup neg 3 1 roll 5 3 roll moveto 0 rlineto
|
24
|
+
0 exch rlineto 0 rlineto closepath } bind def
|
25
|
+
/S { stroke } bind def
|
26
|
+
/f { fill } bind def
|
27
|
+
/f* { eofill } bind def
|
28
|
+
/n { newpath } bind def
|
29
|
+
/W { clip } bind def
|
30
|
+
/W* { eoclip } bind def
|
31
|
+
/BT { } bind def
|
32
|
+
/ET { } bind def
|
33
|
+
/BDC { mark 3 1 roll /BDC pdfmark } bind def
|
34
|
+
/EMC { mark /EMC pdfmark } bind def
|
35
|
+
/cairo_store_point { /cairo_point_y exch def /cairo_point_x exch def } def
|
36
|
+
/Tj { show currentpoint cairo_store_point } bind def
|
37
|
+
/TJ {
|
38
|
+
{
|
39
|
+
dup
|
40
|
+
type /stringtype eq
|
41
|
+
{ show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse
|
42
|
+
} forall
|
43
|
+
currentpoint cairo_store_point
|
44
|
+
} bind def
|
45
|
+
/cairo_selectfont { cairo_font_matrix aload pop pop pop 0 0 6 array astore
|
46
|
+
cairo_font exch selectfont cairo_point_x cairo_point_y moveto } bind def
|
47
|
+
/Tf { pop /cairo_font exch def /cairo_font_matrix where
|
48
|
+
{ pop cairo_selectfont } if } bind def
|
49
|
+
/Td { matrix translate cairo_font_matrix matrix concatmatrix dup
|
50
|
+
/cairo_font_matrix exch def dup 4 get exch 5 get cairo_store_point
|
51
|
+
/cairo_font where { pop cairo_selectfont } if } bind def
|
52
|
+
/Tm { 2 copy 8 2 roll 6 array astore /cairo_font_matrix exch def
|
53
|
+
cairo_store_point /cairo_font where { pop cairo_selectfont } if } bind def
|
54
|
+
/g { setgray } bind def
|
55
|
+
/rg { setrgbcolor } bind def
|
56
|
+
/d1 { setcachedevice } bind def
|
57
|
+
/cairo_data_source {
|
58
|
+
CairoDataIndex CairoData length lt
|
59
|
+
{ CairoData CairoDataIndex get /CairoDataIndex CairoDataIndex 1 add def }
|
60
|
+
{ () } ifelse
|
61
|
+
} def
|
62
|
+
/cairo_flush_ascii85_file { cairo_ascii85_file status { cairo_ascii85_file flushfile } if } def
|
63
|
+
/cairo_image { image cairo_flush_ascii85_file } def
|
64
|
+
/cairo_imagemask { imagemask cairo_flush_ascii85_file } def
|
65
|
+
%%EndProlog
|
66
|
+
%%BeginSetup
|
67
|
+
%%EndSetup
|
68
|
+
%%Page: 1 1
|
69
|
+
%%BeginPageSetup
|
70
|
+
%%PageBoundingBox: 3 5 72 74
|
71
|
+
%%EndPageSetup
|
72
|
+
q 3 5 69 69 rectclip
|
73
|
+
1 0 0 -1 0 77 cm q
|
74
|
+
0 0 0.6 rg
|
75
|
+
71.281 37.5 m 71.281 56.16 56.16 71.281 37.5 71.281 c 18.84 71.281 3.781
|
76
|
+
56.16 3.781 37.5 c 3.781 18.84 18.84 3.781 37.5 3.781 c 56.16 3.781 71.281
|
77
|
+
18.84 71.281 37.5 c h
|
78
|
+
71.281 37.5 m f
|
79
|
+
1 g
|
80
|
+
24.781 19.5 m 58.5 19.5 l 67.141 29.578 67.441 44.34 59.219 54.781 c 51
|
81
|
+
65.16 36.539 68.34 24.781 62.281 c 24.781 42.781 l 44.281 42.781 l 44.281
|
82
|
+
32.281 l 24.781 32.281 l h
|
83
|
+
24.781 19.5 m f
|
84
|
+
Q Q
|
85
|
+
showpage
|
86
|
+
%%Trailer
|
87
|
+
end
|
88
|
+
%%EOF
|
Binary file
|
@@ -0,0 +1,125 @@
|
|
1
|
+
%!PS-Adobe-3.0
|
2
|
+
%%Creator: cairo 1.17.9 (https://cairographics.org)
|
3
|
+
%%CreationDate: Fri Oct 6 12:34:05 2023
|
4
|
+
%%Pages: 1
|
5
|
+
%%DocumentData: Clean7Bit
|
6
|
+
%%LanguageLevel: 2
|
7
|
+
%%DocumentMedia: 27x27mm 77 77 0 () ()
|
8
|
+
%%BoundingBox: 3 5 72 74
|
9
|
+
%%EndComments
|
10
|
+
%%BeginProlog
|
11
|
+
/languagelevel where
|
12
|
+
{ pop languagelevel } { 1 } ifelse
|
13
|
+
2 lt { /Helvetica findfont 12 scalefont setfont 50 500 moveto
|
14
|
+
(This print job requires a PostScript Language Level 2 printer.) show
|
15
|
+
showpage quit } if
|
16
|
+
/q { gsave } bind def
|
17
|
+
/Q { grestore } bind def
|
18
|
+
/cm { 6 array astore concat } bind def
|
19
|
+
/w { setlinewidth } bind def
|
20
|
+
/J { setlinecap } bind def
|
21
|
+
/j { setlinejoin } bind def
|
22
|
+
/M { setmiterlimit } bind def
|
23
|
+
/d { setdash } bind def
|
24
|
+
/m { moveto } bind def
|
25
|
+
/l { lineto } bind def
|
26
|
+
/c { curveto } bind def
|
27
|
+
/h { closepath } bind def
|
28
|
+
/re { exch dup neg 3 1 roll 5 3 roll moveto 0 rlineto
|
29
|
+
0 exch rlineto 0 rlineto closepath } bind def
|
30
|
+
/S { stroke } bind def
|
31
|
+
/f { fill } bind def
|
32
|
+
/f* { eofill } bind def
|
33
|
+
/n { newpath } bind def
|
34
|
+
/W { clip } bind def
|
35
|
+
/W* { eoclip } bind def
|
36
|
+
/BT { } bind def
|
37
|
+
/ET { } bind def
|
38
|
+
/BDC { mark 3 1 roll /BDC pdfmark } bind def
|
39
|
+
/EMC { mark /EMC pdfmark } bind def
|
40
|
+
/cairo_store_point { /cairo_point_y exch def /cairo_point_x exch def } def
|
41
|
+
/Tj { show currentpoint cairo_store_point } bind def
|
42
|
+
/TJ {
|
43
|
+
{
|
44
|
+
dup
|
45
|
+
type /stringtype eq
|
46
|
+
{ show } { -0.001 mul 0 cairo_font_matrix dtransform rmoveto } ifelse
|
47
|
+
} forall
|
48
|
+
currentpoint cairo_store_point
|
49
|
+
} bind def
|
50
|
+
/cairo_selectfont { cairo_font_matrix aload pop pop pop 0 0 6 array astore
|
51
|
+
cairo_font exch selectfont cairo_point_x cairo_point_y moveto } bind def
|
52
|
+
/Tf { pop /cairo_font exch def /cairo_font_matrix where
|
53
|
+
{ pop cairo_selectfont } if } bind def
|
54
|
+
/Td { matrix translate cairo_font_matrix matrix concatmatrix dup
|
55
|
+
/cairo_font_matrix exch def dup 4 get exch 5 get cairo_store_point
|
56
|
+
/cairo_font where { pop cairo_selectfont } if } bind def
|
57
|
+
/Tm { 2 copy 8 2 roll 6 array astore /cairo_font_matrix exch def
|
58
|
+
cairo_store_point /cairo_font where { pop cairo_selectfont } if } bind def
|
59
|
+
/g { setgray } bind def
|
60
|
+
/rg { setrgbcolor } bind def
|
61
|
+
/d1 { setcachedevice } bind def
|
62
|
+
/cairo_data_source {
|
63
|
+
CairoDataIndex CairoData length lt
|
64
|
+
{ CairoData CairoDataIndex get /CairoDataIndex CairoDataIndex 1 add def }
|
65
|
+
{ () } ifelse
|
66
|
+
} def
|
67
|
+
/cairo_flush_ascii85_file { cairo_ascii85_file status { cairo_ascii85_file flushfile } if } def
|
68
|
+
/cairo_image { image cairo_flush_ascii85_file } def
|
69
|
+
/cairo_imagemask { imagemask cairo_flush_ascii85_file } def
|
70
|
+
/cairo_set_page_size {
|
71
|
+
% Change paper size, but only if different from previous paper size otherwise
|
72
|
+
% duplex fails. PLRM specifies a tolerance of 5 pts when matching paper size
|
73
|
+
% so we use the same when checking if the size changes.
|
74
|
+
/setpagedevice where {
|
75
|
+
pop currentpagedevice
|
76
|
+
/PageSize known {
|
77
|
+
2 copy
|
78
|
+
currentpagedevice /PageSize get aload pop
|
79
|
+
exch 4 1 roll
|
80
|
+
sub abs 5 gt
|
81
|
+
3 1 roll
|
82
|
+
sub abs 5 gt
|
83
|
+
or
|
84
|
+
} {
|
85
|
+
true
|
86
|
+
} ifelse
|
87
|
+
{
|
88
|
+
2 array astore
|
89
|
+
2 dict begin
|
90
|
+
/PageSize exch def
|
91
|
+
/ImagingBBox null def
|
92
|
+
currentdict end
|
93
|
+
setpagedevice
|
94
|
+
} {
|
95
|
+
pop pop
|
96
|
+
} ifelse
|
97
|
+
} {
|
98
|
+
pop
|
99
|
+
} ifelse
|
100
|
+
} def
|
101
|
+
%%EndProlog
|
102
|
+
%%BeginSetup
|
103
|
+
%%EndSetup
|
104
|
+
%%Page: 1 1
|
105
|
+
%%BeginPageSetup
|
106
|
+
%%PageMedia: 27x27mm
|
107
|
+
%%PageBoundingBox: 3 5 72 74
|
108
|
+
77 77 cairo_set_page_size
|
109
|
+
%%EndPageSetup
|
110
|
+
q 3 5 69 69 rectclip
|
111
|
+
1 0 0 -1 0 77 cm q
|
112
|
+
0 0 0.6 rg
|
113
|
+
71.281 37.5 m 71.281 56.16 56.16 71.281 37.5 71.281 c 18.84 71.281 3.781
|
114
|
+
56.16 3.781 37.5 c 3.781 18.84 18.84 3.781 37.5 3.781 c 56.16 3.781 71.281
|
115
|
+
18.84 71.281 37.5 c h
|
116
|
+
71.281 37.5 m f
|
117
|
+
1 g
|
118
|
+
24.781 19.5 m 58.5 19.5 l 67.141 29.578 67.441 44.34 59.219 54.781 c 51
|
119
|
+
65.16 36.539 68.34 24.781 62.281 c 24.781 42.781 l 44.281 42.781 l 44.281
|
120
|
+
32.281 l 24.781 32.281 l h
|
121
|
+
24.781 19.5 m f
|
122
|
+
Q Q
|
123
|
+
showpage
|
124
|
+
%%Trailer
|
125
|
+
%%EOF
|
Binary file
|
@@ -0,0 +1,9 @@
|
|
1
|
+
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1275.0000" height="1275.0000">
|
3
|
+
<g transform="translate(-0.0000, -0.0000)">
|
4
|
+
<g transform="matrix(1.0000 0.0000 0.0000 1.0000 0.0000 0.0000)">
|
5
|
+
<path d="M 1188.0000,625.0000 C 1188.0000,936.0000 936.0000,1188.0000 625.0000,1188.0000 C 314.0000,1188.0000 63.0000,936.0000 63.0000,625.0000 C 63.0000,314.0000 314.0000,63.0000 625.0000,63.0000 C 936.0000,63.0000 1188.0000,314.0000 1188.0000,625.0000 Z " fill="#000099" stroke="none" />
|
6
|
+
<path d="M 413.0000,325.0000 L 975.0000,325.0000 C 1119.0000,493.0000 1124.0000,739.0000 987.0000,913.0000 C 850.0000,1086.0000 609.0000,1139.0000 413.0000,1038.0000 L 413.0000,713.0000 L 738.0000,713.0000 L 738.0000,538.0000 L 413.0000,538.0000 Z " fill="#FFFFFF" stroke="none" />
|
7
|
+
</g>
|
8
|
+
</g>
|
9
|
+
</svg>
|
Binary file
|
@@ -0,0 +1,199 @@
|
|
1
|
+
%!PS-Adobe-3.0 EPSF-3.0
|
2
|
+
%%Document-Fonts: Times-Roman
|
3
|
+
%%Title: circle.eps
|
4
|
+
%%Creator: PS_Write.F
|
5
|
+
%%CreationDate: 02-Aug-99
|
6
|
+
%%Pages: 1
|
7
|
+
%%BoundingBox: 36 36 576 756
|
8
|
+
%%LanguageLevel: 1
|
9
|
+
%%EndComments
|
10
|
+
%%BeginProlog
|
11
|
+
%%EndProlog
|
12
|
+
/inch {72 mul} def
|
13
|
+
/Palatino-Roman findfont
|
14
|
+
1.00 inch scalefont
|
15
|
+
setfont
|
16
|
+
0.0000 0.0000 0.0000 setrgbcolor
|
17
|
+
%% Page: 1 1
|
18
|
+
save
|
19
|
+
63 153 moveto
|
20
|
+
newpath
|
21
|
+
63 153 moveto
|
22
|
+
549 153 lineto
|
23
|
+
stroke
|
24
|
+
newpath
|
25
|
+
549 153 moveto
|
26
|
+
549 639 lineto
|
27
|
+
stroke
|
28
|
+
newpath
|
29
|
+
549 639 moveto
|
30
|
+
63 639 lineto
|
31
|
+
stroke
|
32
|
+
newpath
|
33
|
+
63 639 moveto
|
34
|
+
63 153 lineto
|
35
|
+
stroke
|
36
|
+
newpath
|
37
|
+
360 261 108 0 360 arc
|
38
|
+
closepath stroke
|
39
|
+
newpath
|
40
|
+
361 357 moveto
|
41
|
+
358 358 lineto
|
42
|
+
353 356 lineto
|
43
|
+
348 353 lineto
|
44
|
+
342 347 lineto
|
45
|
+
336 340 lineto
|
46
|
+
329 331 lineto
|
47
|
+
322 321 lineto
|
48
|
+
315 309 lineto
|
49
|
+
307 296 lineto
|
50
|
+
300 283 lineto
|
51
|
+
292 268 lineto
|
52
|
+
285 253 lineto
|
53
|
+
278 237 lineto
|
54
|
+
271 222 lineto
|
55
|
+
266 206 lineto
|
56
|
+
260 191 lineto
|
57
|
+
256 177 lineto
|
58
|
+
252 164 lineto
|
59
|
+
249 152 lineto
|
60
|
+
247 141 lineto
|
61
|
+
246 131 lineto
|
62
|
+
246 123 lineto
|
63
|
+
247 117 lineto
|
64
|
+
248 113 lineto
|
65
|
+
251 111 lineto
|
66
|
+
254 110 lineto
|
67
|
+
259 112 lineto
|
68
|
+
264 115 lineto
|
69
|
+
270 121 lineto
|
70
|
+
276 128 lineto
|
71
|
+
283 137 lineto
|
72
|
+
290 147 lineto
|
73
|
+
297 159 lineto
|
74
|
+
305 172 lineto
|
75
|
+
312 185 lineto
|
76
|
+
320 200 lineto
|
77
|
+
327 215 lineto
|
78
|
+
334 231 lineto
|
79
|
+
341 246 lineto
|
80
|
+
346 262 lineto
|
81
|
+
352 277 lineto
|
82
|
+
356 291 lineto
|
83
|
+
360 304 lineto
|
84
|
+
363 316 lineto
|
85
|
+
365 327 lineto
|
86
|
+
366 337 lineto
|
87
|
+
366 345 lineto
|
88
|
+
365 351 lineto
|
89
|
+
364 355 lineto
|
90
|
+
361 357 lineto
|
91
|
+
stroke
|
92
|
+
newpath
|
93
|
+
171 261 moveto
|
94
|
+
171 531 lineto
|
95
|
+
stroke
|
96
|
+
newpath
|
97
|
+
198 261 moveto
|
98
|
+
198 531 lineto
|
99
|
+
stroke
|
100
|
+
newpath
|
101
|
+
225 261 moveto
|
102
|
+
225 531 lineto
|
103
|
+
stroke
|
104
|
+
newpath
|
105
|
+
252 261 moveto
|
106
|
+
252 531 lineto
|
107
|
+
stroke
|
108
|
+
newpath
|
109
|
+
279 261 moveto
|
110
|
+
279 531 lineto
|
111
|
+
stroke
|
112
|
+
newpath
|
113
|
+
306 261 moveto
|
114
|
+
306 531 lineto
|
115
|
+
stroke
|
116
|
+
newpath
|
117
|
+
333 261 moveto
|
118
|
+
333 531 lineto
|
119
|
+
stroke
|
120
|
+
newpath
|
121
|
+
360 261 moveto
|
122
|
+
360 531 lineto
|
123
|
+
stroke
|
124
|
+
newpath
|
125
|
+
387 261 moveto
|
126
|
+
387 531 lineto
|
127
|
+
stroke
|
128
|
+
newpath
|
129
|
+
414 261 moveto
|
130
|
+
414 531 lineto
|
131
|
+
stroke
|
132
|
+
newpath
|
133
|
+
441 261 moveto
|
134
|
+
441 531 lineto
|
135
|
+
stroke
|
136
|
+
newpath
|
137
|
+
171 261 moveto
|
138
|
+
441 261 lineto
|
139
|
+
stroke
|
140
|
+
newpath
|
141
|
+
171 288 moveto
|
142
|
+
441 288 lineto
|
143
|
+
stroke
|
144
|
+
newpath
|
145
|
+
171 315 moveto
|
146
|
+
441 315 lineto
|
147
|
+
stroke
|
148
|
+
newpath
|
149
|
+
171 342 moveto
|
150
|
+
441 342 lineto
|
151
|
+
stroke
|
152
|
+
newpath
|
153
|
+
171 369 moveto
|
154
|
+
441 369 lineto
|
155
|
+
stroke
|
156
|
+
newpath
|
157
|
+
171 396 moveto
|
158
|
+
441 396 lineto
|
159
|
+
stroke
|
160
|
+
newpath
|
161
|
+
171 423 moveto
|
162
|
+
441 423 lineto
|
163
|
+
stroke
|
164
|
+
newpath
|
165
|
+
171 450 moveto
|
166
|
+
441 450 lineto
|
167
|
+
stroke
|
168
|
+
newpath
|
169
|
+
171 477 moveto
|
170
|
+
441 477 lineto
|
171
|
+
stroke
|
172
|
+
newpath
|
173
|
+
171 504 moveto
|
174
|
+
441 504 lineto
|
175
|
+
stroke
|
176
|
+
newpath
|
177
|
+
171 531 moveto
|
178
|
+
441 531 lineto
|
179
|
+
stroke
|
180
|
+
newpath
|
181
|
+
306 396 5 0 360 arc
|
182
|
+
closepath stroke
|
183
|
+
0.0000 1.0000 0.0000 setrgbcolor
|
184
|
+
newpath
|
185
|
+
387 477 54 0 90 arc
|
186
|
+
stroke
|
187
|
+
171 261 moveto
|
188
|
+
0.0000 0.0000 0.0000 setrgbcolor
|
189
|
+
/Palatino-Roman findfont
|
190
|
+
0.250 inch scalefont
|
191
|
+
setfont
|
192
|
+
(This is "circle.plot".) show
|
193
|
+
171 342 moveto
|
194
|
+
/Palatino-Roman findfont
|
195
|
+
0.125 inch scalefont
|
196
|
+
setfont
|
197
|
+
(This is small print.) show
|
198
|
+
restore showpage
|
199
|
+
%%Trailer
|