asciidoctor-pdf 2.3.10 → 2.3.12

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: 53465d3756b672a087912f7052c98da2174506d348ae415702b6ad0923c35887
4
- data.tar.gz: 81156616786953961b86a747720fdb1c92117a7645df0faba24b02e96bec4635
3
+ metadata.gz: f6d4fcd7f484c87480980add66936d91a6fd83a96509a1a0bf54edbd297827d9
4
+ data.tar.gz: f87f24fe33309886cdad555f0a31981a6c23d50192611ee954fe25c722031bd7
5
5
  SHA512:
6
- metadata.gz: 73d88491443fdafb5086bf4a122c3910631e547ef118b4ff4b23dffcbb315d7fb21a7335fc41db778b0d11bf5f851d3cae9df1b838fa342d3e5cf73cbe0f259d
7
- data.tar.gz: cbd1fe371ed58d54c76770ef7abda45a080bb84dcbece1e5f60bda8a260668538ee5f71b92088b67ea71b9b29ed01cf6746fa9568a123366080a1e2fcdbb1c2e
6
+ metadata.gz: c8496b8e15d1a3ea1c65da73e3a1233a71475fa972e384559a74a06e6b92d8454367dece149793719f915d687a1382160b75c38e86e21c62fc833f4bc1e6214b
7
+ data.tar.gz: 6c74e398c951bfc82637cfb8fe701f0c38849841a327016f987795451db0541c76d1a68a84c08a443d3142f8012f5b313feb6bd9993c3910929848a39a289fa4
data/CHANGELOG.adoc CHANGED
@@ -5,6 +5,39 @@
5
5
  This document provides a high-level view of the changes to the {project-name} by release.
6
6
  For a detailed view of what has changed, refer to the {url-repo}/commits/main[commit history] on GitHub.
7
7
 
8
+ == 2.3.12 (2024-02-02) - @mojavelinux
9
+
10
+ Improvements::
11
+
12
+ * add combining characters to bundled fonts (#2482)
13
+
14
+ Bug Fixes::
15
+
16
+ * ensure indentation is preserved at page transition of index when media=prepress; prevents margin from shifting to the left (#2480)
17
+
18
+ === Details
19
+
20
+ {url-repo}/releases/tag/v2.3.12[git tag] | {url-repo}/compare/v2.3.11\...v2.3.12[full diff]
21
+
22
+ == 2.3.11 (2024-01-23) - @mojavelinux
23
+
24
+ Enhancements::
25
+
26
+ * upgrade prawn-svg dependency to 0.33.x (PR #2469)
27
+
28
+ Improvements::
29
+
30
+ * extract shared `smallcaps` method from `TextTransform#smallcaps_pcdata` to make it easier to override
31
+ * assign node to `@node` instance variable on table instance to make it easer to access from Prawn::Table extension (#2471)
32
+
33
+ Bug Fixes::
34
+
35
+ * ensure color spaces are set on page before adding running content (#2477)
36
+
37
+ === Details
38
+
39
+ {url-repo}/releases/tag/v2.3.11[git tag] | {url-repo}/compare/v2.3.10\...v2.3.11[full diff]
40
+
8
41
  == 2.3.10 (2023-12-04) - @mojavelinux
9
42
 
10
43
  Bug Fixes::
data/README.adoc CHANGED
@@ -1,6 +1,6 @@
1
1
  = Asciidoctor PDF: A native PDF converter for AsciiDoc
2
2
  Dan Allen <https://github.com/mojavelinux[@mojavelinux]>; Sarah White <https://github.com/graphitefriction[@graphitefriction]>
3
- v2.3.10, 2023-12-04
3
+ v2.3.12, 2024-02-02
4
4
  // Settings:
5
5
  :experimental:
6
6
  :idprefix:
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  s.add_runtime_dependency 'matrix', '~> 0.4' # required until prawn >= 2.5.0 is released
39
39
  s.add_runtime_dependency 'prawn-table', '~> 0.2.0'
40
40
  s.add_runtime_dependency 'prawn-templates', '~> 0.1.0'
41
- s.add_runtime_dependency 'prawn-svg', '~> 0.32.0'
41
+ s.add_runtime_dependency 'prawn-svg', '~> 0.33.0'
42
42
  s.add_runtime_dependency 'prawn-icon', '~> 3.0.0'
43
43
  s.add_runtime_dependency 'concurrent-ruby', '~> 1.1'
44
44
  s.add_runtime_dependency 'treetop', '~> 1.6.0'
@@ -9,6 +9,7 @@ The following changes were made using fontforge to produce mplus1p-regular-fallb
9
9
  ** Latin Extended-A (U+0100–U+017f)
10
10
  ** Latin Extended-B (U+0180–U+024f)
11
11
  ** IPA (U+0259, U+02b0–U+02ff)
12
+ ** Combining characters (U+0300-U+030F) (used for NFD normalized forms of characters with a diacritical mark)
12
13
  ** Greek (U+0370–U+03ff)
13
14
  ** Cyrillic (U+0400–U+04ff)
14
15
  ** Vietnamese (U+01a0–U01b0, U+1ea0–U1ef9)
@@ -10,6 +10,7 @@ The following changes were made using fontforge to produce the notosans-*-subset
10
10
  ** Basic Latin (U+0020–U+007e)
11
11
  ** Latin-1 Supplement (U+00a0–U+00fd)
12
12
  ** Latin Extended-A (U+0100–U+017f)
13
+ ** Combining characters (U+0300-U+030F) (used for NFD normalized forms of characters with a diacritical mark)
13
14
  ** Greek (U+0370–U+03ff)
14
15
  ** Cyrillic (U+0400–U+04ff)
15
16
  ** Vietnamese (U+01a0–U01b0, U+1ea0–U1ef9)
@@ -10,6 +10,7 @@ The following changes were made using fontforge to produce the notoserif-*-subse
10
10
  ** Basic Latin (U+0020–U+007e)
11
11
  ** Latin-1 Supplement (U+00a0–U+00fd)
12
12
  ** Latin Extended-A (U+0100–U+017f)
13
+ ** Combining characters (U+0300-U+030F) (used for NFD normalized forms of characters with a diacritical mark)
13
14
  ** Greek (U+0370–U+03ff)
14
15
  ** Cyrillic (U+0400–U+04ff)
15
16
  ** Vietnamese (U+01a0–U01b0, U+1ea0–U1ef9)
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -166,6 +166,7 @@ module Asciidoctor
166
166
  doc.attributes['outline-title'] = '' if doc.attr_unspecified? 'outline-title'
167
167
  doc.attributes['pagenums'] = '' if doc.attr_unspecified? 'pagenums'
168
168
 
169
+ # NOTE: & prefix required here to pass resolved method as block of on_page_create method
169
170
  on_page_create(&(method :init_page).curry[doc])
170
171
 
171
172
  marked_page_number = page_number
@@ -632,7 +633,7 @@ module Asciidoctor
632
633
  return convert_abstract sect
633
634
  elsif (index_section = sectname == 'index') && @index.empty?
634
635
  # override numbered_title to hide entry from TOC
635
- sect.define_singleton_method :numbered_title, &->(*) { '' }
636
+ sect.define_singleton_method :numbered_title, ->(*) { '' }
636
637
  return
637
638
  end
638
639
  title = sect.numbered_title formal: true
@@ -1809,9 +1810,6 @@ module Asciidoctor
1809
1810
  rendered_w = (svg_obj.resize height: (rendered_h = available_h)).output_width if rendered_h > available_h
1810
1811
  end
1811
1812
  add_dest_for_block node if node.id
1812
- # NOTE: workaround to fix Prawn not adding fill and stroke commands on page that only has an image;
1813
- # breakage occurs when running content (stamps) are added to page
1814
- update_colors if graphic_state.color_space.empty?
1815
1813
  ink_caption node, category: :image, end: :top, block_align: alignment, block_width: rendered_w, max_width: caption_max_width if caption_end == :top && node.title?
1816
1814
  image_y = y
1817
1815
  # NOTE: prawn-svg does not compute :at for alignment correctly in column box, so resort to our own logic
@@ -1851,9 +1849,6 @@ module Asciidoctor
1851
1849
  rendered_w = (image_info.calc_image_dimensions height: (rendered_h = available_h))[0] if rendered_h > available_h
1852
1850
  end
1853
1851
  add_dest_for_block node if node.id
1854
- # NOTE: workaround to fix Prawn not adding fill and stroke commands on page that only has an image;
1855
- # breakage occurs when running content (stamps) are added to page
1856
- update_colors if graphic_state.color_space.empty?
1857
1852
  ink_caption node, category: :image, end: :top, block_align: alignment, block_width: rendered_w, max_width: caption_max_width if caption_end == :top && node.title?
1858
1853
  image_y = y
1859
1854
  left = bounds.left
@@ -2268,6 +2263,7 @@ module Asciidoctor
2268
2263
 
2269
2264
  left_padding = right_padding = nil
2270
2265
  table table_data, table_settings do
2266
+ instance_variable_set :@node, node
2271
2267
  # NOTE: cell_style must be applied manually to be compatible with both prawn-table 0.2.2 and prawn-table 0.2.3
2272
2268
  cells.style cell_style
2273
2269
  @column_widths = column_widths unless column_widths.empty?
@@ -3590,7 +3586,16 @@ module Asciidoctor
3590
3586
 
3591
3587
  pagenums_enabled = doc.attr? 'pagenums'
3592
3588
  periphery_layout_cache = {}
3593
- # NOTE: this block is invoked during PDF generation, after #write -> #render_file and thus after #convert_document
3589
+ # NOTE: Prawn fails to properly set color spaces on empty pages, but repeater relies on them
3590
+ # prefer simpler fix below call to repeat; keep this workaround in case that workaround stops working
3591
+ #(content_start_page_number..num_pages).each do |pgnum|
3592
+ # next if (disable_on_pages.include? pgnum) || (pg = state.pages[pgnum - 1]).imported_page? || !pg.graphic_state.color_space.empty?
3593
+ # go_to_page pgnum
3594
+ # set_color_space :fill, (color_space graphic_state.fill_color)
3595
+ # set_color_space :stroke, (color_space graphic_state.stroke_color)
3596
+ #end
3597
+ #go_to_page content_start_page_number if page_number != content_start_page_number
3598
+ # NOTE: this block is invoked during PDF generation, during call to #write -> #render_file and thus after #convert_document
3594
3599
  repeat (content_start_page_number..num_pages), dynamic: true do
3595
3600
  pgnum = page_number
3596
3601
  # NOTE: don't write on pages which are imported / inserts (otherwise we can get a corrupt PDF)
@@ -3701,7 +3706,12 @@ module Asciidoctor
3701
3706
  end
3702
3707
  end
3703
3708
  end
3704
-
3709
+ # NOTE: force repeater to consult color spaces on current page instead of the page on which repeater was created
3710
+ # if this stops working, use the commented code above repeat call instead
3711
+ unless (repeater_graphic_state = repeaters[-1].instance_variable_get :@graphic_state).singleton_methods.include? :color_space
3712
+ # NOTE: must convert override method to proc since we're are changing bind argument
3713
+ repeater_graphic_state.define_singleton_method :color_space, (method :page_color_space).to_proc
3714
+ end
3705
3715
  go_to_page prev_page_number
3706
3716
  nil
3707
3717
  end
@@ -4382,7 +4392,6 @@ module Asciidoctor
4382
4392
 
4383
4393
  def start_new_chapter chapter
4384
4394
  start_new_page unless at_page_top?
4385
- # TODO: must call update_colors before advancing to next page if start_new_page is called in ink_chapter_title
4386
4395
  start_new_page if @ppbook && verso_page? && !(chapter.option? 'nonfacing')
4387
4396
  end
4388
4397
 
@@ -5062,6 +5071,10 @@ module Asciidoctor
5062
5071
  nil
5063
5072
  end
5064
5073
 
5074
+ def page_color_space
5075
+ page.graphic_state.color_space
5076
+ end
5077
+
5065
5078
  def remove_tmp_files
5066
5079
  @tmp_files.reject! {|_, path| path ? (unlink_tmp_file path) : true }
5067
5080
  end
@@ -15,8 +15,11 @@ Prawn::Document::ColumnBox.prepend (Module.new do
15
15
  initial_margins = doc.page.margins
16
16
  parent_.move_past_bottom
17
17
  if doc.page.margins != initial_margins
18
- doc.bounds = self.class.new doc, parent_, [(margin_box = doc.margin_box).absolute_left, @y],
18
+ doc.bounds = bounds = self.class.new doc, parent_, [(margin_box = doc.margin_box).absolute_left, @y],
19
19
  columns: @columns, reflow_margins: @reflow_margins, spacer: @spacer, width: margin_box.width, height: @height
20
+ # ensure indentation is preserved across page break
21
+ bounds.add_left_padding @total_left_padding if @total_left_padding > 0
22
+ bounds.add_right_padding @total_right_padding if @total_right_padding > 0
20
23
  end
21
24
  nil
22
25
  end
@@ -59,12 +59,16 @@ module Asciidoctor
59
59
 
60
60
  def smallcaps_pcdata string
61
61
  if XMLMarkupRx.match? string
62
- string.gsub(PCDATAFilterRx) { $2 ? ($2.tr LowerAlphaChars, SmallCapsChars) : $1 }
62
+ string.gsub(PCDATAFilterRx) { $2 ? (smallcaps $2) : $1 }
63
63
  else
64
- string.tr LowerAlphaChars, SmallCapsChars
64
+ smallcaps string
65
65
  end
66
66
  end
67
67
 
68
+ def smallcaps string
69
+ string.tr LowerAlphaChars, SmallCapsChars
70
+ end
71
+
68
72
  # Apply the text transform to the specified text.
69
73
  #
70
74
  # Supported transform values are "uppercase", "lowercase", or "none" (passed
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Asciidoctor
4
4
  module PDF
5
- VERSION = '2.3.10'
5
+ VERSION = '2.3.12'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.10
4
+ version: 2.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Allen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-12-04 00:00:00.000000000 Z
12
+ date: 2024-02-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: asciidoctor
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 0.32.0
90
+ version: 0.33.0
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.32.0
97
+ version: 0.33.0
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: prawn-icon
100
100
  requirement: !ruby/object:Gem::Requirement