summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-07-09 12:55:12 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-07-09 12:56:14 -0600
commite7db4e8ee2c8c19d3cf073dc37330e07a916e93c (patch)
tree51128a1b84909e7149d909ab1fef40db3a34f440 /lib
parente28df627d49979deaef7faa285087ab6977b1f7a (diff)
pass root font size to AsciiDoc table cell implementation to avoid making it public
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/pdf/converter.rb4
-rw-r--r--lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb3
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index 2c1f9952..774b08ac 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -27,8 +27,6 @@ module Asciidoctor
attr_accessor :font_scale
- attr_reader :root_font_size
-
attr_reader :index
attr_reader :theme
@@ -2109,7 +2107,7 @@ module Asciidoctor
end
# NOTE: line metrics get applied when AsciiDoc content is converted
cell_line_metrics = nil
- asciidoc_cell = ::Prawn::Table::Cell::AsciiDoc.new self, (cell_data.merge content: cell.inner_document, padding: body_cell_padding)
+ asciidoc_cell = ::Prawn::Table::Cell::AsciiDoc.new self, (cell_data.merge content: cell.inner_document, padding: body_cell_padding, root_font_size: @root_font_size)
cell_data = { content: asciidoc_cell, source_location: cell.source_location }
end
if cell_line_metrics
diff --git a/lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb b/lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb
index 07406237..106bc29e 100644
--- a/lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb
+++ b/lib/asciidoctor/pdf/ext/prawn-table/cell/asciidoc.rb
@@ -7,6 +7,7 @@ module Prawn
include ::Asciidoctor::Logging
attr_accessor :align
+ attr_accessor :root_font_size
attr_accessor :valign
def initialize pdf, opts = {}
@@ -109,7 +110,7 @@ module Prawn
prev_font_color, pdf.font_color = pdf.font_color, font_color if font_color
font_family ||= font_info[:family]
if font_size
- prev_font_scale, pdf.font_scale = pdf.font_scale, (font_size.to_f / @pdf.root_font_size)
+ prev_font_scale, pdf.font_scale = pdf.font_scale, (font_size.to_f / @root_font_size)
else
font_size = font_info[:size]
end