idml 0.2.2 → 0.2.4
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/Gemfile.lock +5 -12
- data/TODO.pdf/65-pdfrb-019-integration.md +29 -0
- data/idml.gemspec +1 -1
- data/lib/idml/render/renderers/text_frame_renderer.rb +10 -4
- data/lib/idml/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 820fb71d72a5017eb34973c4a6fdd67ee5bcd7d10a11391c40dbeed7b7d7af7f
|
|
4
|
+
data.tar.gz: 4f451cec97a6c9aa653bb2d443630fc1a27d1c4b4f1d9514f5d84ece917f9c6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e87bcf39867cc0a98a791edb97c47fdadc8739a8fe23dd33cae0c86dcfb402e1f0acf217cbfe28c49c4c501e58089c2b7418a94fa5568b8979ab24676c9dd3a9
|
|
7
|
+
data.tar.gz: 9d09a038c13d8d18e4b81012ef791a59ce54a64b7a91cb1d0a93364f1651576477f6db07a0a103e94aad7204b54f9b3e7ce7e2d202c81c76e31daf0f92d564a7
|
data/Gemfile.lock
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
idml (0.2.
|
|
4
|
+
idml (0.2.4)
|
|
5
5
|
bigdecimal
|
|
6
6
|
fontisan
|
|
7
7
|
lutaml-model (~> 0.8.18)
|
|
8
|
-
pdfrb
|
|
8
|
+
pdfrb
|
|
9
9
|
rubyzip
|
|
10
10
|
thor
|
|
11
11
|
|
|
12
12
|
PATH
|
|
13
13
|
remote: /Users/mulgogi/src/claricle/pdfrb
|
|
14
14
|
specs:
|
|
15
|
-
pdfrb (0.
|
|
16
|
-
lutaml-model (>= 0.7.0)
|
|
15
|
+
pdfrb (0.4.0)
|
|
17
16
|
thor
|
|
18
17
|
|
|
19
18
|
GEM
|
|
@@ -42,7 +41,6 @@ GEM
|
|
|
42
41
|
ffi (1.17.4-arm-linux-gnu)
|
|
43
42
|
ffi (1.17.4-arm-linux-musl)
|
|
44
43
|
ffi (1.17.4-arm64-darwin)
|
|
45
|
-
ffi (1.17.4-x64-mingw-ucrt)
|
|
46
44
|
ffi (1.17.4-x86_64-darwin)
|
|
47
45
|
ffi (1.17.4-x86_64-linux-gnu)
|
|
48
46
|
ffi (1.17.4-x86_64-linux-musl)
|
|
@@ -83,8 +81,6 @@ GEM
|
|
|
83
81
|
racc (~> 1.4)
|
|
84
82
|
nokogiri (1.19.4-arm64-darwin)
|
|
85
83
|
racc (~> 1.4)
|
|
86
|
-
nokogiri (1.19.4-x64-mingw-ucrt)
|
|
87
|
-
racc (~> 1.4)
|
|
88
84
|
nokogiri (1.19.4-x86_64-darwin)
|
|
89
85
|
racc (~> 1.4)
|
|
90
86
|
nokogiri (1.19.4-x86_64-linux-gnu)
|
|
@@ -165,7 +161,6 @@ PLATFORMS
|
|
|
165
161
|
arm-linux-gnu
|
|
166
162
|
arm-linux-musl
|
|
167
163
|
arm64-darwin
|
|
168
|
-
x64-mingw-ucrt
|
|
169
164
|
x86_64-darwin
|
|
170
165
|
x86_64-linux-gnu
|
|
171
166
|
x86_64-linux-musl
|
|
@@ -199,12 +194,11 @@ CHECKSUMS
|
|
|
199
194
|
ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564
|
|
200
195
|
ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95
|
|
201
196
|
ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
|
|
202
|
-
ffi (1.17.4-x64-mingw-ucrt) sha256=f6ff9618cfccc494138bddade27aa06c74c6c7bc367a1ea1103d80c2fcb9ed35
|
|
203
197
|
ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496
|
|
204
198
|
ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
|
|
205
199
|
ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
|
|
206
200
|
fontisan (0.4.45) sha256=2337ca0205f806647b24b8cac57aa34f3769473026ae6f52dc36bde0feed6c62
|
|
207
|
-
idml (0.2.
|
|
201
|
+
idml (0.2.4)
|
|
208
202
|
json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a
|
|
209
203
|
language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
|
|
210
204
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
@@ -218,7 +212,6 @@ CHECKSUMS
|
|
|
218
212
|
nokogiri (1.19.4-arm-linux-gnu) sha256=a301313e38bb065d68239e79734bcd6f56fb6efaacebde29e9abf2a4735340ca
|
|
219
213
|
nokogiri (1.19.4-arm-linux-musl) sha256=588923c101bcfa78869734d247d25b598674323e7f22474fc468f6e5647311eb
|
|
220
214
|
nokogiri (1.19.4-arm64-darwin) sha256=a46db9853286e6597b36ebc6953817d15acf3a299583eb3f89fdc6f91dd63527
|
|
221
|
-
nokogiri (1.19.4-x64-mingw-ucrt) sha256=051da97b8eccfdb5444fed40246a35e10d7298b9efe759b4cd25455ea04c587e
|
|
222
215
|
nokogiri (1.19.4-x86_64-darwin) sha256=7fd17057d3e1f00e9954a74b3cd76595d3d4a5ef233b7ed9599047c204f70551
|
|
223
216
|
nokogiri (1.19.4-x86_64-linux-gnu) sha256=379fae440b28915e3f19d752ce2dcf8465ed2b2fbefd2a7ca0dd497bc981a06a
|
|
224
217
|
nokogiri (1.19.4-x86_64-linux-musl) sha256=17dfb7c1fa194ae02fbf7c51a7afc8d278045ab3fdacfd86f91d02d7b274470b
|
|
@@ -226,7 +219,7 @@ CHECKSUMS
|
|
|
226
219
|
paint (2.3.0) sha256=327d623e4038619d5bd99ae5db07973859cd78400c7f0329eea283cef8e83be5
|
|
227
220
|
parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356
|
|
228
221
|
parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
|
|
229
|
-
pdfrb (0.
|
|
222
|
+
pdfrb (0.4.0)
|
|
230
223
|
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
|
231
224
|
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
|
|
232
225
|
rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# TODO PDF 65: pdfrb 0.19.0 feature integration
|
|
2
|
+
|
|
3
|
+
## Status: PARTIALLY DONE
|
|
4
|
+
|
|
5
|
+
## What was implemented
|
|
6
|
+
|
|
7
|
+
1. **Canvas#text_lines**: TextFrameRenderer uses `canvas.text_lines`
|
|
8
|
+
instead of N separate `canvas.text` calls per line. Single batch
|
|
9
|
+
call for all lines within a run.
|
|
10
|
+
|
|
11
|
+
## What remains (pdfrb bugs)
|
|
12
|
+
|
|
13
|
+
2. **glyph_width for TTF**: pdfrb 0.19.0 has `Fonts#glyph_width` but
|
|
14
|
+
returns 0 for TrueType fonts (bug: "undefined method glyph_id_for
|
|
15
|
+
for String"). Standard 14 Type1 fonts work correctly. Cannot
|
|
16
|
+
replace FontMetrics/Fontisan until this is fixed.
|
|
17
|
+
|
|
18
|
+
3. **Pdfrb::FontResolver**: Returns nil for common fonts (Helvetica.ttc
|
|
19
|
+
on macOS). Cannot replace Fontisan-based resolver yet.
|
|
20
|
+
|
|
21
|
+
4. **Font subsetting**: `Fonts#add` accepts `**opts` but `subset: true`
|
|
22
|
+
behavior unverified. Standard 14 fonts don't need FontFile embedding.
|
|
23
|
+
|
|
24
|
+
## Acceptance criteria
|
|
25
|
+
|
|
26
|
+
- [x] TextFrameRenderer uses canvas.text_lines
|
|
27
|
+
- [ ] FontMetrics replaced with pdfrb glyph_width (blocked by TTF bug)
|
|
28
|
+
- [ ] FontResolver replaced with Pdfrb::FontResolver (blocked by .ttc)
|
|
29
|
+
- [ ] Font subsetting verified
|
data/idml.gemspec
CHANGED
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
|
31
31
|
spec.add_dependency "bigdecimal"
|
|
32
32
|
spec.add_dependency "fontisan"
|
|
33
33
|
spec.add_dependency "lutaml-model", "~> 0.8.18"
|
|
34
|
-
spec.add_dependency "pdfrb"
|
|
34
|
+
spec.add_dependency "pdfrb"
|
|
35
35
|
spec.add_dependency "rubyzip"
|
|
36
36
|
spec.add_dependency "thor"
|
|
37
37
|
|
|
@@ -95,15 +95,21 @@ module Idml
|
|
|
95
95
|
glyphs: glyphs, frame_width: box[:width],
|
|
96
96
|
)
|
|
97
97
|
|
|
98
|
+
line_texts = []
|
|
98
99
|
lines.each do |line|
|
|
99
100
|
break if baseline_y < box[:y]
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
canvas.text(line_text, at: [box[:x], baseline_y],
|
|
103
|
-
font: context.font_ps_name,
|
|
104
|
-
size: size)
|
|
102
|
+
line_texts << line.glyphs.map { |g| [g.codepoint].pack("U") }.join
|
|
105
103
|
baseline_y -= size * LEADING_FACTOR
|
|
106
104
|
end
|
|
105
|
+
|
|
106
|
+
if line_texts.any?
|
|
107
|
+
canvas.text_lines(line_texts,
|
|
108
|
+
font: context.font_ps_name,
|
|
109
|
+
size: size,
|
|
110
|
+
at: [box[:x], box[:y] + box[:height] - size],
|
|
111
|
+
leading: size * LEADING_FACTOR)
|
|
112
|
+
end
|
|
107
113
|
baseline_y
|
|
108
114
|
end
|
|
109
115
|
private_class_method :render_run_lines
|
data/lib/idml/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: idml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose
|
|
@@ -57,14 +57,14 @@ dependencies:
|
|
|
57
57
|
requirements:
|
|
58
58
|
- - ">="
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: 0
|
|
60
|
+
version: '0'
|
|
61
61
|
type: :runtime
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
65
|
- - ">="
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: 0
|
|
67
|
+
version: '0'
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: rubyzip
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -205,6 +205,7 @@ files:
|
|
|
205
205
|
- TODO.pdf/62-pdfrb-015-migration.md
|
|
206
206
|
- TODO.pdf/63-replace-fontmetrics-with-pdfrb.md
|
|
207
207
|
- TODO.pdf/64-pipeline-cli-optimizations.md
|
|
208
|
+
- TODO.pdf/65-pdfrb-019-integration.md
|
|
208
209
|
- TODO.pdf/README.md
|
|
209
210
|
- exe/idml
|
|
210
211
|
- idml.gemspec
|