hexapdf 0.20.3 → 0.20.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/CHANGELOG.md +7 -0
- data/lib/hexapdf/font/type1_wrapper.rb +14 -15
- data/lib/hexapdf/version.rb +1 -1
- data/test/hexapdf/font/test_type1_wrapper.rb +4 -0
- data/test/hexapdf/test_writer.rb +2 -2
- 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: f88aacce2ba9f2df02fdeaf17019871c9f8e1f7ab9202aa4dd8af89b86394c5e
|
4
|
+
data.tar.gz: bca3c34f6f71da1ae6df8f81c98c69e3bdda09f71f195b46979e16be91a7e1b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ac8a3205b04705614dfa42fb0e73994aa7ccca90f23c73a0e7b8ba9f9932d18059ced2a62ecefd68c8f5425e3a354f51d8101e3b1b642d11312dbd3510ff1a6
|
7
|
+
data.tar.gz: 410c1cac0e07dfeda869d70a69370af74f255dcd17feb057064b39448b61d4494ea0bc7a05e99eefaa7a2459cc32bab4c01240b00dad9a6f63c83b32bc2176c2
|
data/CHANGELOG.md
CHANGED
@@ -212,24 +212,23 @@ module HexaPDF
|
|
212
212
|
|
213
213
|
# Creates a PDF object representing the wrapped font for the given PDF document.
|
214
214
|
def create_pdf_object(document)
|
215
|
-
fd = document.
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
215
|
+
fd = document.add({Type: :FontDescriptor,
|
216
|
+
FontName: @wrapped_font.font_name.intern,
|
217
|
+
FontWeight: @wrapped_font.weight_class,
|
218
|
+
FontBBox: @wrapped_font.bounding_box,
|
219
|
+
ItalicAngle: @wrapped_font.italic_angle || 0,
|
220
|
+
Ascent: @wrapped_font.ascender || 0,
|
221
|
+
Descent: @wrapped_font.descender || 0,
|
222
|
+
CapHeight: @wrapped_font.cap_height,
|
223
|
+
XHeight: @wrapped_font.x_height,
|
224
|
+
StemH: @wrapped_font.dominant_horizontal_stem_width,
|
225
|
+
StemV: @wrapped_font.dominant_vertical_stem_width || 0})
|
226
226
|
fd.flag(:fixed_pitch) if @wrapped_font.metrics.is_fixed_pitch
|
227
227
|
fd.flag(@wrapped_font.metrics.character_set == 'Special' ? :symbolic : :nonsymbolic)
|
228
|
-
fd.must_be_indirect = true
|
229
228
|
|
230
|
-
dict = document.
|
231
|
-
|
232
|
-
|
229
|
+
dict = document.add({Type: :Font, Subtype: :Type1,
|
230
|
+
BaseFont: @wrapped_font.font_name.intern,
|
231
|
+
FontDescriptor: fd})
|
233
232
|
dict.font_wrapper = self
|
234
233
|
|
235
234
|
document.register_listener(:complete_objects) do
|
data/lib/hexapdf/version.rb
CHANGED
@@ -103,5 +103,9 @@ describe HexaPDF::Font::Type1Wrapper do
|
|
103
103
|
it "sets the circular reference" do
|
104
104
|
assert_same(@times_wrapper, @times_wrapper.pdf_object.font_wrapper)
|
105
105
|
end
|
106
|
+
|
107
|
+
it "makes sure that the PDF dictionaries are indirect" do
|
108
|
+
assert(@times_wrapper.pdf_object.indirect?)
|
109
|
+
end
|
106
110
|
end
|
107
111
|
end
|
data/test/hexapdf/test_writer.rb
CHANGED
@@ -40,7 +40,7 @@ describe HexaPDF::Writer do
|
|
40
40
|
219
|
41
41
|
%%EOF
|
42
42
|
3 0 obj
|
43
|
-
<</Producer(HexaPDF version 0.20.
|
43
|
+
<</Producer(HexaPDF version 0.20.4)>>
|
44
44
|
endobj
|
45
45
|
xref
|
46
46
|
3 1
|
@@ -72,7 +72,7 @@ describe HexaPDF::Writer do
|
|
72
72
|
141
|
73
73
|
%%EOF
|
74
74
|
6 0 obj
|
75
|
-
<</Producer(HexaPDF version 0.20.
|
75
|
+
<</Producer(HexaPDF version 0.20.4)>>
|
76
76
|
endobj
|
77
77
|
2 0 obj
|
78
78
|
<</Length 10>>stream
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexapdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Leitner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cmdparse
|