thumb_gen 0.2.0 → 0.2.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 +4 -4
- data/README.md +12 -3
- data/fonts/NotoSansKR-Bold.ttf +0 -0
- data/fonts/NotoSansKR-Regular.ttf +0 -0
- data/fonts/NotoSansKR-Thin.ttf +0 -0
- data/fonts/NotoSansSC-Bold.ttf +0 -0
- data/fonts/NotoSansSC-Regular.ttf +0 -0
- data/fonts/NotoSansSC-Thin.ttf +0 -0
- data/lib/thumb_gen/test.rb +54 -0
- data/lib/thumb_gen/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3afc45cc8b694142b79f2cb82e3c03ec4e871894c218bede07a9c28f53fba77
|
4
|
+
data.tar.gz: 405767838d151c46427641ff2a5fa4264fa21ceec2cdf48327c2290fe9f7e24c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b72ee8d31e58373006a83097ae077a59af16bf5bd50740fefa353791768f1beef4f927b1ba2fe0ace9e85daa6f0e6b71c687e117c8c872a612cd7292665f0dac
|
7
|
+
data.tar.gz: '0814c2366fdba305f9bb14c66019baeca5e40bd7950990526525be48b0b744887c17645eddd19e612aeddb0d2ffc6485b5560394e13d8214ba3e08a4db21a358'
|
data/README.md
CHANGED
@@ -86,9 +86,6 @@ ThumbGen.generate(output_path, background_url, texts, options)
|
|
86
86
|
> Font files like `Roboto-BoldItalic.ttf` are bundled in the gem’s `fonts/` folder.
|
87
87
|
Use only the filename **without extension** as the `font:` value.
|
88
88
|
|
89
|
-
- NotoSansJP-Regular
|
90
|
-
- NotoSansJP-Bold
|
91
|
-
- NotoSansJP-Thin
|
92
89
|
- PublicSans-Regular
|
93
90
|
- PublicSans-Bold
|
94
91
|
- PublicSans-BoldItalic
|
@@ -100,6 +97,18 @@ Use only the filename **without extension** as the `font:` value.
|
|
100
97
|
- Roboto-Italic
|
101
98
|
- Roboto-Thin
|
102
99
|
- Roboto-ThinItalic
|
100
|
+
- For Japanese:
|
101
|
+
- NotoSansJP-Regular
|
102
|
+
- NotoSansJP-Bold
|
103
|
+
- NotoSansJP-Thin
|
104
|
+
- For Korean:
|
105
|
+
- NotoSansKR-Regular
|
106
|
+
- NotoSansKR-Bold
|
107
|
+
- NotoSansKR-Thin
|
108
|
+
- For Simplified Chinese
|
109
|
+
- NotoSansSC-Regular
|
110
|
+
- NotoSansSC-Bold
|
111
|
+
- NotoSansSC-Thin
|
103
112
|
|
104
113
|
---
|
105
114
|
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'thumb_gen/generator'
|
4
|
+
|
5
|
+
module ThumbGen
|
6
|
+
# rubocop:disable all
|
7
|
+
module Test
|
8
|
+
def self.generate_sample
|
9
|
+
output_path = 'sample_output.jpg'
|
10
|
+
background_url = 'sample_input.jpg'
|
11
|
+
texts = [
|
12
|
+
{
|
13
|
+
text: 'ThumbGen is a Ruby gem that simplifies the creation of article thumbnails',
|
14
|
+
wrapped_width: 800,
|
15
|
+
font: 'PublicSans-Bold',
|
16
|
+
font_size: 80,
|
17
|
+
color: '#047857',
|
18
|
+
outline_color: '#f8fafc',
|
19
|
+
outline_width: 1,
|
20
|
+
gravity: 'northwest',
|
21
|
+
position_x: 40,
|
22
|
+
position_y: 120
|
23
|
+
},
|
24
|
+
{
|
25
|
+
text: '5 min read',
|
26
|
+
wrapped_width: 800,
|
27
|
+
font: 'Roboto-Italic',
|
28
|
+
font_size: 48,
|
29
|
+
color: '#09090b',
|
30
|
+
gravity: 'southwest',
|
31
|
+
position_x: 400,
|
32
|
+
position_y: 40
|
33
|
+
},
|
34
|
+
{
|
35
|
+
text: 'My Blog',
|
36
|
+
wrapped_width: 1280,
|
37
|
+
font: 'Roboto-BoldItalic',
|
38
|
+
font_size: 64,
|
39
|
+
color: '#86198f',
|
40
|
+
gravity: 'northeast',
|
41
|
+
position_x: 200,
|
42
|
+
position_y: 30
|
43
|
+
}
|
44
|
+
]
|
45
|
+
options = {
|
46
|
+
width: 1280,
|
47
|
+
height: 720,
|
48
|
+
format: 'jpg'
|
49
|
+
}
|
50
|
+
ThumbGen::Generator.new(output_path, background_url, texts, options).generate
|
51
|
+
end
|
52
|
+
end
|
53
|
+
# rubocop:enable all
|
54
|
+
end
|
data/lib/thumb_gen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thumb_gen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- YutoYasunaga
|
@@ -41,6 +41,12 @@ files:
|
|
41
41
|
- fonts/NotoSansJP-Bold.ttf
|
42
42
|
- fonts/NotoSansJP-Regular.ttf
|
43
43
|
- fonts/NotoSansJP-Thin.ttf
|
44
|
+
- fonts/NotoSansKR-Bold.ttf
|
45
|
+
- fonts/NotoSansKR-Regular.ttf
|
46
|
+
- fonts/NotoSansKR-Thin.ttf
|
47
|
+
- fonts/NotoSansSC-Bold.ttf
|
48
|
+
- fonts/NotoSansSC-Regular.ttf
|
49
|
+
- fonts/NotoSansSC-Thin.ttf
|
44
50
|
- fonts/PublicSans-Bold.ttf
|
45
51
|
- fonts/PublicSans-BoldItalic.ttf
|
46
52
|
- fonts/PublicSans-Regular.ttf
|
@@ -54,6 +60,7 @@ files:
|
|
54
60
|
- fonts/Roboto-ThinItalic.ttf
|
55
61
|
- lib/thumb_gen.rb
|
56
62
|
- lib/thumb_gen/generator.rb
|
63
|
+
- lib/thumb_gen/test.rb
|
57
64
|
- lib/thumb_gen/utils.rb
|
58
65
|
- lib/thumb_gen/version.rb
|
59
66
|
- sample_input.jpg
|
@@ -80,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
87
|
- !ruby/object:Gem::Version
|
81
88
|
version: '0'
|
82
89
|
requirements: []
|
83
|
-
rubygems_version: 3.
|
90
|
+
rubygems_version: 3.7.0
|
84
91
|
specification_version: 4
|
85
92
|
summary: Auto generate customized thumbnails for articles.
|
86
93
|
test_files: []
|