obf 0.9.8.30 → 0.9.8.31
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/lib/obf/pdf.rb +14 -21
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 239d820afb7dc6da2f8acf5987caa95c6678811093a3810bf92da9a6091010a8
|
|
4
|
+
data.tar.gz: 32500a980838e9e326cce0e25afbd69e6b02991a5c682cb46c4259663dc673d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c469f2e6d1d24f7ff2c2a1313e627b2f8565f75cb3e992c151a9704574a2fd3e6bdf5ca4ce5e4505071a4d23b041102919a57d25b85eea36163ffefb0ddad1fe
|
|
7
|
+
data.tar.gz: 47a2ce4bfd802e4e6aa208dcf82379bf1e0fab72e3de404aa38079e6ec69e1618a920c76133adafaf85e324dadd633d8144e29ca6bd744336a1805e4533af945
|
data/lib/obf/pdf.rb
CHANGED
|
@@ -44,25 +44,19 @@ module OBF::PDF
|
|
|
44
44
|
}
|
|
45
45
|
pdf = Prawn::Document.new(doc_opts)
|
|
46
46
|
# remember: https://www.alphabet-type.com/tools/charset-checker/
|
|
47
|
-
pdf.font_families.update('THFahKwangBold' => {
|
|
48
|
-
|
|
49
|
-
})
|
|
50
|
-
pdf.font_families.update('MiedingerBook' => {
|
|
51
|
-
|
|
52
|
-
})
|
|
53
|
-
pdf.
|
|
54
|
-
normal: {font: 'TimesNewRoman', file: File.expand_path('../../TimesNewRoman.ttf', __FILE__)}
|
|
55
|
-
})
|
|
56
|
-
pdf.font_families.update('Arial' => {
|
|
57
|
-
normal: {font: 'Arial', file: File.expand_path('../../Arial.ttf', __FILE__)}
|
|
58
|
-
})
|
|
59
|
-
pdf.fallback_fonts = ['Times-Roman', 'THFahKwangBold', 'MiedingerBook', 'Arial']
|
|
47
|
+
# pdf.font_families.update('THFahKwangBold' => {
|
|
48
|
+
# normal: {font: 'THFahKwangBold', file: File.expand_path('../../THFahKwangBold.ttf', __FILE__)}
|
|
49
|
+
# })
|
|
50
|
+
# pdf.font_families.update('MiedingerBook' => {
|
|
51
|
+
# normal: {font: 'MiedingerBook', file: File.expand_path('../../MiedingerBook.ttf', __FILE__)}
|
|
52
|
+
# })
|
|
53
|
+
# pdf.fallback_fonts = ['Times-Roman', 'THFahKwangBold', 'MiedingerBook', 'Helvetica']
|
|
60
54
|
|
|
61
55
|
font = opts['font'] if opts['font'] && File.exists?(opts['font'])
|
|
62
56
|
if font && File.exists?(font)
|
|
63
|
-
pdf.font(font)
|
|
57
|
+
# pdf.font(font)
|
|
64
58
|
else
|
|
65
|
-
|
|
59
|
+
# pdf.font('Times-Roman')
|
|
66
60
|
end
|
|
67
61
|
|
|
68
62
|
multi_render_paths = []
|
|
@@ -141,7 +135,6 @@ module OBF::PDF
|
|
|
141
135
|
# b.generate_download('1_2', 'pdf', {'include' => 'all', 'headerless' => true, 'symbol_background' => 'transparent'})
|
|
142
136
|
def self.build_page(pdf, obj, options)
|
|
143
137
|
OBF::Utils.as_progress_percent(0, 1.0) do
|
|
144
|
-
pdf.font(options['font']) if options['font'] && File.exists?(options['font'])
|
|
145
138
|
doc_width = 11*72 - 72
|
|
146
139
|
doc_height = 8.5*72 - 72
|
|
147
140
|
default_radius = 3
|
|
@@ -157,7 +150,7 @@ module OBF::PDF
|
|
|
157
150
|
if !options['headerless']
|
|
158
151
|
header_height = 80
|
|
159
152
|
pdf.bounding_box([0, doc_height], :width => doc_width, :height => header_height) do
|
|
160
|
-
pdf.font(
|
|
153
|
+
# pdf.font('Helvetica')
|
|
161
154
|
pdf.line_width = 2
|
|
162
155
|
pdf.font_size 16
|
|
163
156
|
pdf.fill_color "eeeeee"
|
|
@@ -249,6 +242,7 @@ module OBF::PDF
|
|
|
249
242
|
end
|
|
250
243
|
|
|
251
244
|
# board
|
|
245
|
+
# pdf.font(options['font']) if options['font'] && File.exists?(options['font'])
|
|
252
246
|
pdf.font_size 12
|
|
253
247
|
padding = 10
|
|
254
248
|
grid_height = doc_height - header_height - text_height - (padding * 2)
|
|
@@ -351,9 +345,9 @@ module OBF::PDF
|
|
|
351
345
|
font = File.expand_path('../../MiedingerBook.ttf', __FILE__)
|
|
352
346
|
end
|
|
353
347
|
if font && File.exists?(font)
|
|
354
|
-
pdf.font(font)
|
|
348
|
+
# pdf.font(font)
|
|
355
349
|
else
|
|
356
|
-
pdf.font(
|
|
350
|
+
# pdf.font('Times-Roman')
|
|
357
351
|
end
|
|
358
352
|
direction = text.match(rtl_regex) ? :rtl : :ltr
|
|
359
353
|
if options['text_case'] == 'upper'
|
|
@@ -409,7 +403,6 @@ module OBF::PDF
|
|
|
409
403
|
pdf.text_box text, :at => [0, vertical], :width => button_width, :height => text_height, :align => :center, :valign => :center, :overflow => :shrink_to_fit, :direction => direction
|
|
410
404
|
end
|
|
411
405
|
end
|
|
412
|
-
pdf.font(options['font']) if options['font'] && File.exists?(options['font'])
|
|
413
406
|
end
|
|
414
407
|
index = col + (row * obj['grid']['columns'])
|
|
415
408
|
OBF::Utils.update_current_progress(index.to_f / (obj['grid']['rows'] * obj['grid']['columns']).to_f)
|
|
@@ -420,7 +413,7 @@ module OBF::PDF
|
|
|
420
413
|
# footer
|
|
421
414
|
pdf.fill_color "bbbbbb"
|
|
422
415
|
obj['name'] = nil if obj['name'] == 'Unnamed Board'
|
|
423
|
-
pdf.font(
|
|
416
|
+
# pdf.font('Helvetica')
|
|
424
417
|
if OBF::PDF.footer_text || obj['name']
|
|
425
418
|
text = [obj['name'], OBF::PDF.footer_text].compact.join(', ')
|
|
426
419
|
offset = options['pages'] ? 400 : 300
|