dieses 0.0.2 → 0.0.3
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 +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/dieses/application/canvas.rb +19 -13
- data/lib/dieses/application/mixins/scribes.rb +4 -4
- data/lib/dieses/application/sheet.rb +2 -1
- data/lib/dieses/application/sheets/copperplate.rb +2 -2
- data/lib/dieses/application/sheets/cursive.rb +1 -1
- data/lib/dieses/application/sheets/italics.rb +1 -1
- data/lib/dieses/application/sheets/lettering.rb +2 -2
- data/lib/dieses/application/sheets/spencerian.rb +2 -2
- data/lib/dieses/application/sheets/thumbnail.rb +13 -9
- data/lib/dieses/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e460b0467bf1fb5b34295fb10d8cb1a477b45c3ce46b00f75c7b910c51277c60
|
4
|
+
data.tar.gz: 8b689557c7f6357840f7a549acba2f1e3eba31464fbbbbce77fb0e4007ae1e72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c64d445a336625cb86715d975914eafa3c00150139d66bd9a996bba4231e79871df2697ee3d680e22647190fd3d23435d09d530057f294e404182e4faf3b85
|
7
|
+
data.tar.gz: 0be3ede03b34c7c64df50ebdf7c3a5bd72b72a98c93d84f8927dd17282b96ed1e714ec38ddf614c36d4a80e359970a8bed5aed9adec475e1c3110460f6c6aea8
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,17 @@ Changelog
|
|
3
3
|
|
4
4
|
All notable changes to this project will be documented in this file.
|
5
5
|
|
6
|
+
[0.0.3] - 2021-08-25
|
7
|
+
--------------------
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- Allow styling per sheet
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
|
15
|
+
- Reimplement sheets/thumbnail
|
16
|
+
|
6
17
|
[0.0.2] - 2021-08-21
|
7
18
|
--------------------
|
8
19
|
|
@@ -10,11 +10,15 @@ module Dieses
|
|
10
10
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
11
11
|
<svg xmlns="http://www.w3.org/2000/svg" width="%{width}mm" height="%{height}mm" viewBox="0 0 %{width} %{height}" shape-rendering="geometricPrecision" %{header}>
|
12
12
|
<style>
|
13
|
-
svg
|
14
|
-
|
15
|
-
.
|
16
|
-
.
|
17
|
-
.
|
13
|
+
svg { stroke: %8{color}; }
|
14
|
+
svg { stroke-width: %8{medium}; }
|
15
|
+
.altcolor { stroke: %8{altcolor}; }
|
16
|
+
.extrafine { stroke-width: %8{extrafine}; }
|
17
|
+
.fine { stroke-width: %8{fine}; }
|
18
|
+
.medium { stroke-width: %8{medium}; }
|
19
|
+
.broad { stroke-width: %8{broad}; }
|
20
|
+
.extrabroad { stroke-width: %8{extrabroad}; }
|
21
|
+
.dashed { stroke-dasharray: %8{dashed}; }
|
18
22
|
</style>
|
19
23
|
<g id="sheet">
|
20
24
|
%{content}
|
@@ -55,16 +59,18 @@ module Dieses
|
|
55
59
|
DEFAULT_LINEWIDTH = 0.04
|
56
60
|
DEFAULT_DASHES = [2, 2].freeze
|
57
61
|
|
58
|
-
def variables(**kwargs) # rubocop:disable Metrics/PerceivedComplexity
|
62
|
+
def variables(**kwargs) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/PerceivedComplexity
|
59
63
|
paper.to_h.merge(kwargs).tap do |variables|
|
60
|
-
linewidth = (variables[:medium] || DEFAULT_LINEWIDTH).to_f
|
64
|
+
linewidth = (variables[:linewidth] || variables[:medium] || DEFAULT_LINEWIDTH).to_f
|
61
65
|
|
62
|
-
variables[:color]
|
63
|
-
variables[:altcolor]
|
64
|
-
variables[:medium]
|
65
|
-
variables[:
|
66
|
-
variables[:
|
67
|
-
variables[:
|
66
|
+
variables[:color] ||= DEFAULT_COLOR
|
67
|
+
variables[:altcolor] ||= DEFAULT_ALTCOLOR
|
68
|
+
variables[:medium] ||= linewidth.to_s
|
69
|
+
variables[:extrafine] ||= (linewidth / 4.0).to_s
|
70
|
+
variables[:fine] ||= (linewidth / 2.0).to_s
|
71
|
+
variables[:broad] ||= (linewidth * 2.0).to_s
|
72
|
+
variables[:extrabroad] ||= (linewidth * 4.0).to_s
|
73
|
+
variables[:dashed] ||= DEFAULT_DASHES.map(&:to_s).join(' ')
|
68
74
|
end
|
69
75
|
end
|
70
76
|
end
|
@@ -43,20 +43,20 @@ module Dieses
|
|
43
43
|
|
44
44
|
module Bundle
|
45
45
|
def quartet
|
46
|
-
hline :ascender, :
|
46
|
+
hline :ascender, :broad, after: proc { height }
|
47
47
|
hline :waist, :altcolor, after: proc { x_height }
|
48
48
|
hline :base, after: proc { height }
|
49
|
-
hline :descender, :
|
49
|
+
hline :descender, :broad, after: proc { gap }
|
50
50
|
end
|
51
51
|
|
52
52
|
# codebeat:disable[ABC]
|
53
53
|
def sextet
|
54
|
-
hline :ascender2, :
|
54
|
+
hline :ascender2, :broad, after: proc { height }
|
55
55
|
hline :ascender1, :dashed, after: proc { height }
|
56
56
|
hline :waist, :altcolor, after: proc { x_height }
|
57
57
|
hline :base, after: proc { height }
|
58
58
|
hline :descender1, :dashed, after: proc { height }
|
59
|
-
hline :descender2, :
|
59
|
+
hline :descender2, :broad, after: proc { gap }
|
60
60
|
end
|
61
61
|
# codebeat:enable[ABC]
|
62
62
|
end
|
@@ -35,6 +35,7 @@ module Dieses
|
|
35
35
|
klass.define :proto
|
36
36
|
klass.define :variants, default: {}
|
37
37
|
klass.define :param, default: Param.new
|
38
|
+
klass.define :style, default: Param.new
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
@@ -81,7 +82,7 @@ module Dieses
|
|
81
82
|
|
82
83
|
def produce(**kwargs)
|
83
84
|
call
|
84
|
-
canvas.render(**kwargs)
|
85
|
+
canvas.render(variables: self.class.style.to_h, **kwargs)
|
85
86
|
end
|
86
87
|
|
87
88
|
private
|
@@ -8,8 +8,8 @@ module Dieses
|
|
8
8
|
|
9
9
|
include Mixins::Scribes[:sextet].with unit: [5, 7], ratio: [3/2r, 2/1r]
|
10
10
|
|
11
|
-
cline :slant, :
|
12
|
-
cline :connective, :
|
11
|
+
cline :slant, :fine, angle: 55.0
|
12
|
+
cline :connective, :fine, :dashed, angle: 50.0
|
13
13
|
|
14
14
|
def call
|
15
15
|
scribes
|
@@ -17,8 +17,8 @@ module Dieses
|
|
17
17
|
hline :hline
|
18
18
|
vline :vline
|
19
19
|
|
20
|
-
cline :slant, :
|
21
|
-
cline :connective, :
|
20
|
+
cline :slant, :fine, angle: 52.0
|
21
|
+
cline :connective, :fine, :dashed, angle: 30.0
|
22
22
|
|
23
23
|
def call
|
24
24
|
lines multiple: param.square
|
@@ -8,8 +8,8 @@ module Dieses
|
|
8
8
|
|
9
9
|
include Mixins::Scribes[:sextet].with unit: [5, 7], ratio: [3/2r, 2/1r]
|
10
10
|
|
11
|
-
cline :slant, :
|
12
|
-
cline :connective, :
|
11
|
+
cline :slant, :fine, angle: 52.0
|
12
|
+
cline :connective, :fine, :dashed, angle: 30.0
|
13
13
|
|
14
14
|
def call
|
15
15
|
scribes
|
@@ -6,16 +6,20 @@ module Dieses
|
|
6
6
|
class Thumbnail < Sheet
|
7
7
|
sheet :thumbnail, 'Thumbnails'
|
8
8
|
|
9
|
+
style linewidth: 0.3, color: '#007f80'
|
10
|
+
|
9
11
|
DENSITY = {
|
10
|
-
'1': Param.(row:
|
11
|
-
'
|
12
|
-
'
|
13
|
-
'4': Param.(row:
|
12
|
+
'1': Param.(row: 5, col: 3, width: 10, height: 10),
|
13
|
+
'2': Param.(row: 4, col: 4, width: 8, height: 10),
|
14
|
+
'3': Param.(row: 5, col: 5, width: 6, height: 8),
|
15
|
+
'4': Param.(row: 6, col: 5, width: 6, height: 6)
|
14
16
|
}.freeze
|
15
17
|
|
16
|
-
variate density:
|
17
|
-
self.name = density
|
18
|
-
|
18
|
+
variate density: DENSITY.keys, unit: 5 do
|
19
|
+
self.name = density
|
20
|
+
|
21
|
+
param = DENSITY[density]
|
22
|
+
self.desc = "Density #{density} (#{param.row}x#{param.col} thumbnails on A4 paper)"
|
19
23
|
end
|
20
24
|
|
21
25
|
def call
|
@@ -25,9 +29,9 @@ module Dieses
|
|
25
29
|
repeat row do
|
26
30
|
repeat col do
|
27
31
|
rect :rect, width: width, height: height
|
28
|
-
right(width + 1)
|
32
|
+
right(width + 1.25)
|
29
33
|
end
|
30
|
-
down(height + 1)
|
34
|
+
down(height + 1.25)
|
31
35
|
end
|
32
36
|
end
|
33
37
|
end
|
data/lib/dieses/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dieses
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Recai Oktaş
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|