summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.adoc4
-rw-r--r--lib/asciidoctor/pdf/theme_loader.rb1
-rw-r--r--spec/theme_loader_spec.rb5
3 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index b7f7bb0f..95faa240 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -7,6 +7,10 @@ For a detailed view of what has changed, refer to the {url-repo}/commits/main[co
== Unreleased
+Improvements::
+
+* provide a fallback value for `base-font-size` when loading theme (#2343)
+
Bug Fixes::
* fix crash when smallcaps text transform is applied to a phrase (#2339)
diff --git a/lib/asciidoctor/pdf/theme_loader.rb b/lib/asciidoctor/pdf/theme_loader.rb
index 0d581ec5..465a65f1 100644
--- a/lib/asciidoctor/pdf/theme_loader.rb
+++ b/lib/asciidoctor/pdf/theme_loader.rb
@@ -83,6 +83,7 @@ module Asciidoctor
theme_data.base_text_align ||= 'left'
theme_data.base_line_height ||= 1
theme_data.base_font_color ||= '000000'
+ theme_data.base_font_size ||= 12
theme_data.code_font_family ||= (theme_data.codespan_font_family || 'Courier')
theme_data.conum_font_family ||= (theme_data.codespan_font_family || 'Courier')
if (heading_font_family = theme_data.heading_font_family)
diff --git a/spec/theme_loader_spec.rb b/spec/theme_loader_spec.rb
index a4588fd9..2916bd93 100644
--- a/spec/theme_loader_spec.rb
+++ b/spec/theme_loader_spec.rb
@@ -781,7 +781,7 @@ describe Asciidoctor::PDF::ThemeLoader do
theme = subject.load_theme (File.basename theme_path), (File.dirname theme_path)
(expect theme.base_font_family).to eql 'Times-Roman'
(expect theme.heading_font_family).to eql 'Times-Roman'
- (expect theme.base_font_size).to be_nil
+ (expect theme.base_font_size).to be 12
end
end
end
@@ -889,9 +889,10 @@ describe Asciidoctor::PDF::ThemeLoader do
(expect theme.base_text_align).to eql 'left'
(expect theme.base_line_height).to be 1
(expect theme.base_font_color).to eql '000000'
+ (expect theme.base_font_size).to be 12
(expect theme.code_font_family).to eql 'Courier'
(expect theme.conum_font_family).to eql 'Courier'
- (expect theme.to_h.keys).to have_size 6
+ (expect theme.to_h.keys).to have_size 7
end
it 'should link code and conum font family to codespan font family by default' do