hexapdf 0.20.3 → 0.20.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edc0879019c00378efa5e596e5a24db8d094e8baf682f434c052e62f6a84a563
4
- data.tar.gz: 9eb7a38c31ae34d9bdf2d4006a01419b29d0c21faabd9b6b2ff31a3079c4617f
3
+ metadata.gz: f88aacce2ba9f2df02fdeaf17019871c9f8e1f7ab9202aa4dd8af89b86394c5e
4
+ data.tar.gz: bca3c34f6f71da1ae6df8f81c98c69e3bdda09f71f195b46979e16be91a7e1b7
5
5
  SHA512:
6
- metadata.gz: 259aa6bcd520b74bec173c91d92b660681d09f0543287783aacc216fbf633c754e3d05dbcd56e84bff3227551e074193bbcf9d2d79d9435dad33dff6d85f89bf
7
- data.tar.gz: 91ba8e27297a9c0769b19531e219987b749e8d356911bd03f22e579dff66cb90788efe1db8a56eb10ee4405eca39469022bafe6aebf597be4faf2285a908d1d5
6
+ metadata.gz: 2ac8a3205b04705614dfa42fb0e73994aa7ccca90f23c73a0e7b8ba9f9932d18059ced2a62ecefd68c8f5425e3a354f51d8101e3b1b642d11312dbd3510ff1a6
7
+ data.tar.gz: 410c1cac0e07dfeda869d70a69370af74f255dcd17feb057064b39448b61d4494ea0bc7a05e99eefaa7a2459cc32bab4c01240b00dad9a6f63c83b32bc2176c2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.20.4 - 2022-01-26
2
+
3
+ ### Fixed
4
+
5
+ * Regression when using Type1 font with different encodings
6
+
7
+
1
8
  ## 0.20.3 - 2022-01-24
2
9
 
3
10
  ### 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.wrap({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})
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.wrap({Type: :Font, Subtype: :Type1,
231
- BaseFont: @wrapped_font.font_name.intern,
232
- FontDescriptor: fd})
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
@@ -37,6 +37,6 @@
37
37
  module HexaPDF
38
38
 
39
39
  # The version of HexaPDF.
40
- VERSION = '0.20.3'
40
+ VERSION = '0.20.4'
41
41
 
42
42
  end
@@ -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
@@ -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.3)>>
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.3)>>
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.3
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-24 00:00:00.000000000 Z
11
+ date: 2022-01-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cmdparse