asciidoctor-pdf-cjk-kai_gen_gothic 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,229 @@
1
+ font:
2
+ catalog:
3
+ KaiGen Gothic TW:
4
+ normal: KaiGenGothicTW-Regular.ttf
5
+ bold: KaiGenGothicTW-Bold.ttf
6
+ italic: KaiGenGothicTW-Regular-Italic.ttf
7
+ bold_italic: KaiGenGothicTW-Bold-Italic.ttf
8
+ Roboto Mono:
9
+ normal: RobotoMono-Regular.ttf
10
+ bold: RobotoMono-Bold.ttf
11
+ italic: RobotoMono-Italic.ttf
12
+ bold_italic: RobotoMono-BoldItalic.ttf
13
+ fallbacks:
14
+ - KaiGen Gothic TW
15
+ page:
16
+ background_color: ffffff
17
+ layout: portrait
18
+ # NOTE multiply inches by 72 to get pt values
19
+ #margin: [0.5 * 72, 0.67 * 72, 0.67 * 72, 0.67 * 72]
20
+ margin: [0.5in, 0.67in, 0.67in, 0.67in]
21
+ # size can be a named size (e.g., A4) or custom dimensions (e.g., [8.25in, 11.69in])
22
+ size: Letter
23
+ base:
24
+ # color as hex string (leading # is optional)
25
+ font_color: 333333
26
+ # color as RGB array
27
+ #font_color: [51, 51, 51]
28
+ # color as CMYK array (approximated)
29
+ #font_color: [0, 0, 0, 0.92]
30
+ #font_color: [0, 0, 0, 92%]
31
+ font_family: KaiGen Gothic TW
32
+ # choose one of these font_size/line_height_length combinations
33
+ #font_size: 14
34
+ #line_height_length: 20
35
+ #font_size: 11.25
36
+ #line_height_length: 18
37
+ #font_size: 11.2
38
+ #line_height_length: 16
39
+ font_size: 10.5
40
+ #line_height_length: 15
41
+ # correct line height for Noto Serif metrics
42
+ line_height_length: 15
43
+ #font_size: 11.25
44
+ #line_height_length: 18
45
+ line_height: $base_line_height_length / $base_font_size
46
+ font_size_large: round($base_font_size * 1.25)
47
+ font_size_small: round($base_font_size * 0.85)
48
+ font_size_min: $base_font_size * 0.75
49
+ font_style: normal
50
+ align: justify
51
+ border_radius: 4
52
+ border_width: 0.5
53
+ border_color: eeeeee
54
+ # FIXME vertical_rhythm is weird; we should think in terms of ems
55
+ #vertical_rhythm: $base_line_height_length * 2 / 3
56
+ # correct line height for Noto Serif metrics
57
+ vertical_rhythm: $base_line_height_length
58
+ horizontal_rhythm: $base_line_height_length
59
+ link:
60
+ font_color: 428bca
61
+ # literal is currently used for inline monospaced in prose and table cells
62
+ literal:
63
+ font_color: b12146
64
+ font_family: Roboto Mono
65
+ heading:
66
+ #font_color: 181818
67
+ font_color: $base_font_color
68
+ font_family: $base_font_family
69
+ # h1 is used for part titles
70
+ h1_font_size: floor($base_font_size * 2.6)
71
+ # h2 is used for chapter titles
72
+ h2_font_size: floor($base_font_size * 2.15)
73
+ h3_font_size: round($base_font_size * 1.7)
74
+ h4_font_size: $base_font_size_large
75
+ h5_font_size: $base_font_size
76
+ h6_font_size: $base_font_size_small
77
+ font_style: bold
78
+ #line_height: 1.4
79
+ # correct line height for Noto Serif metrics
80
+ line_height: 1.2
81
+ margin_top: $vertical_rhythm * 0.2
82
+ margin_bottom: $vertical_rhythm * 0.8
83
+ title_page:
84
+ align: right
85
+ title_top: 55%
86
+ title_font_size: $heading_h1_font_size
87
+ title_font_color: 999999
88
+ title_line_height: 0.9
89
+ subtitle_font_size: $heading_h3_font_size
90
+ subtitle_font_style: bold_italic
91
+ subtitle_line_height: 1
92
+ authors_margin_top: $base_font_size * 1.25
93
+ authors_font_size: $base_font_size_large
94
+ authors_font_color: 181818
95
+ revision_margin_top: $base_font_size * 1.25
96
+ #prose:
97
+ # margin_top: 0
98
+ # margin_bottom: $vertical_rhythm
99
+ block:
100
+ #margin_top: 0
101
+ #margin_bottom: $vertical_rhythm
102
+ padding: [$vertical_rhythm, $vertical_rhythm * 1.25, $vertical_rhythm, $vertical_rhythm * 1.25]
103
+ # code is used for source blocks (perhaps change to source or listing?)
104
+ caption:
105
+ font_style: italic
106
+ align: left
107
+ # FIXME perhaps set line_height instead of / in addition to margins?
108
+ margin_inside: $vertical_rhythm * 0.25
109
+ margin_outside: 0
110
+ code:
111
+ font_color: $base_font_color
112
+ #font_family: Liberation Mono
113
+ #font_size: floor($base_font_size * 0.9)
114
+ #font_size: 10
115
+ #padding: [9.5, 9.5, 9.5, 9.5]
116
+ # LiberationMono carries extra gap below line
117
+ #padding: [10, 10, 7.5, 10]
118
+ #line_height: 1.45
119
+ font_family: $literal_font_family
120
+ font_size: ceil($base_font_size)
121
+ #padding: [$base_font_size, $code_font_size, $base_font_size, $code_font_size]
122
+ padding: $code_font_size
123
+ line_height: 1.25
124
+ background_color: f5f5f5
125
+ border_color: cccccc
126
+ border_radius: $base_border_radius
127
+ border_width: 0.75
128
+ blockquote:
129
+ font_color: $base_font_color
130
+ font_size: $base_font_size_large
131
+ border_width: 5
132
+ border_color: $base_border_color
133
+ cite_font_size: $base_font_size_small
134
+ cite_font_color: 999999
135
+ sidebar:
136
+ border_color: $page_background_color
137
+ border_radius: $base_border_radius
138
+ border_width: $base_border_width
139
+ background_color: eeeeee
140
+ title_font_color: $heading_font_color
141
+ title_font_family: $heading_font_family
142
+ title_font_size: $heading_h4_font_size
143
+ title_font_style: $heading_font_style
144
+ title_align: center
145
+ example:
146
+ border_color: $base_border_color
147
+ border_radius: $base_border_radius
148
+ border_width: 0.75
149
+ background_color: transparent
150
+ admonition:
151
+ border_color: $base_border_color
152
+ border_width: $base_border_width
153
+ conum:
154
+ font_family: $literal_font_family
155
+ font_color: $literal_font_color
156
+ font_size: $base_font_size
157
+ line_height: 4 / 3
158
+ image:
159
+ align_default: left
160
+ scaled_width_default: 0.5
161
+ lead:
162
+ # QUESTION what about $base_font_size_large?
163
+ #font_size: floor($base_line_height_length * 0.8)
164
+ #font_size: floor($base_font_size * 1.15)
165
+ #line_height: 1.3
166
+ font_size: $base_font_size_large
167
+ line_height: 1.4
168
+ abstract:
169
+ #font_color: 404040
170
+ font_color: 5c6266
171
+ font_size: $lead_font_size
172
+ line_height: $lead_line_height
173
+ font_style: italic
174
+ thematic_break:
175
+ border_color: $base_border_color
176
+ margin_top: $vertical_rhythm * 0.5
177
+ margin_bottom: $vertical_rhythm * 1.5
178
+ description_list:
179
+ term_font_style: italic
180
+ description_indent: $horizontal_rhythm * 1.25
181
+ outline_list:
182
+ indent: $horizontal_rhythm * 1.5
183
+ # NOTE item_spacing applies to list items that do not have complex content
184
+ item_spacing: $vertical_rhythm / 2
185
+ #marker_font_color: 404040
186
+ table:
187
+ background_color: $page_background_color
188
+ #head_background_color: <hex value>
189
+ #head_font_color: $base_font_color
190
+ even_row_background_color: f9f9f9
191
+ #odd_row_background_color: <hex value>
192
+ foot_background_color: f0f0f0
193
+ border_color: dddddd
194
+ border_width: $base_border_width
195
+ # HACK accounting for line-height
196
+ cell_padding: [3, 3, 6, 3]
197
+ toc:
198
+ indent: $horizontal_rhythm
199
+ dot_leader_color: dddddd
200
+ #dot_leader_content: ". "
201
+ line_height: 1.4
202
+ # NOTE In addition to footer, header is also supported
203
+ footer:
204
+ font_size: $base_font_size_small
205
+ font_color: $base_font_color
206
+ # NOTE if background_color is set, background and border will span width of page
207
+ border_color: dddddd
208
+ border_width: 0.25
209
+ height: $base_line_height_length * 2.5
210
+ padding: [$base_line_height_length / 2, 1, 0, 1]
211
+ valign: top
212
+ #image_valign: <alignment> or <number>
213
+ # additional attributes for content:
214
+ # * {page-count}
215
+ # * {page-number}
216
+ # * {document-title}
217
+ # * {document-subtitle}
218
+ # * {chapter-title}
219
+ # * {section-title}
220
+ # * {section-or-chapter-title}
221
+ recto_content:
222
+ #right: '{section-or-chapter-title} | {page-number}'
223
+ #right: '{document-title} | {page-number}'
224
+ right: '{page-number}'
225
+ #center: '{page-number}'
226
+ verso_content:
227
+ #left: '{page-number} | {chapter-title}'
228
+ left: '{page-number}'
229
+ #center: '{page-number}'
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'open-uri'
4
+
5
+ FontsDir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'data', 'fonts'))
6
+
7
+ Fonts = %w(
8
+ KaiGenGothicCN-Bold-Italic.ttf
9
+ KaiGenGothicCN-Bold.ttf
10
+ KaiGenGothicCN-Regular-Italic.ttf
11
+ KaiGenGothicCN-Regular.ttf
12
+ KaiGenGothicJP-Bold-Italic.ttf
13
+ KaiGenGothicJP-Bold.ttf
14
+ KaiGenGothicJP-Regular-Italic.ttf
15
+ KaiGenGothicJP-Regular.ttf
16
+ KaiGenGothicKR-Bold-Italic.ttf
17
+ KaiGenGothicKR-Bold.ttf
18
+ KaiGenGothicKR-Regular-Italic.ttf
19
+ KaiGenGothicKR-Regular.ttf
20
+ KaiGenGothicTW-Bold-Italic.ttf
21
+ KaiGenGothicTW-Bold.ttf
22
+ KaiGenGothicTW-Regular-Italic.ttf
23
+ KaiGenGothicTW-Regular.ttf
24
+ RobotoMono-Bold.ttf
25
+ RobotoMono-BoldItalic.ttf
26
+ RobotoMono-Italic.ttf
27
+ RobotoMono-Regular.ttf
28
+ )
29
+
30
+ Dir.chdir(FontsDir) do
31
+ Fonts.each_with_index do |name, index|
32
+ puts "[#{index + 1}/#{Fonts.count}] Downloading #{name}"
33
+ File.open(name, 'wb') do |file|
34
+ file.write open("https://github.com/chloerei/asciidoctor-pdf-cjk-kai_gen_gothic/releases/download/v0.1.0-fonts/#{name}").read
35
+ end
36
+ end
37
+ end
38
+
39
+ puts "Done"
@@ -0,0 +1 @@
1
+ require "asciidoctor/pdf/cjk/kai_gen_gothic"
@@ -0,0 +1,12 @@
1
+ require "asciidoctor/pdf/cjk"
2
+ require "asciidoctor/pdf/cjk/kai_gen_gothic/version"
3
+ require "asciidoctor/pdf/cjk/kai_gen_gothic/theme_loader.rb"
4
+
5
+ module Asciidoctor
6
+ module Pdf
7
+ module CJK
8
+ module KaiGenGothic
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ module Asciidoctor
2
+ module Pdf
3
+ class ThemeLoader
4
+ DataDir.replace ::File.expand_path(::File.join(::File.dirname(__FILE__), '..', '..', '..', '..', '..', 'data'))
5
+ ThemesDir.replace ::File.join DataDir, 'themes'
6
+ FontsDir.replace ::File.join DataDir, 'fonts'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Asciidoctor
2
+ module Pdf
3
+ module CJK
4
+ module KaiGenGothic
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: asciidoctor-pdf-cjk-kai_gen_gothic
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Rei
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-07-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: asciidoctor-pdf-cjk
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.10'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.10'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: ''
70
+ email:
71
+ - chloerei@gmail.com
72
+ executables:
73
+ - asciidoctor-pdf-cjk-kai_gen_gothic-install
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - Gemfile
79
+ - LICENSE.txt
80
+ - README.md
81
+ - Rakefile
82
+ - asciidoctor-pdf-cjk-kai_gen_gothic.gemspec
83
+ - bin/build_fonts
84
+ - bin/console
85
+ - bin/convert_italic.pe
86
+ - bin/setup
87
+ - data/fonts/.gitkeep
88
+ - data/themes/KaiGenGothicCN-theme.yml
89
+ - data/themes/KaiGenGothicJP-theme.yml
90
+ - data/themes/KaiGenGothicKR-theme.yml
91
+ - data/themes/KaiGenGothicTW-theme.yml
92
+ - exe/asciidoctor-pdf-cjk-kai_gen_gothic-install
93
+ - lib/asciidoctor-pdf-cjk-kai_gen_gothic.rb
94
+ - lib/asciidoctor/pdf/cjk/kai_gen_gothic.rb
95
+ - lib/asciidoctor/pdf/cjk/kai_gen_gothic/theme_loader.rb
96
+ - lib/asciidoctor/pdf/cjk/kai_gen_gothic/version.rb
97
+ homepage: ''
98
+ licenses: []
99
+ metadata: {}
100
+ post_install_message: |2+
101
+
102
+ ======================
103
+
104
+ Run this command to download required fonts:"
105
+
106
+ $ asciidoctor-pdf-cjk-kai_gen_gothic-install
107
+
108
+ ======================
109
+
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 2.4.7
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: ''
129
+ test_files: []