diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2021-01-18 23:57:11 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2021-01-19 01:11:58 -0700 |
| commit | 546987fe65deff4eeef188c0cac2c7775a1fb0c9 (patch) | |
| tree | 41efc809226a992009a353eb6b44235eab3c7286 /spec/section_spec.rb | |
| parent | 08b7a45488cab7f52d40124a90d8ed4834f4d23b (diff) | |
verify theme can set font kerning per heading level
Diffstat (limited to 'spec/section_spec.rb')
| -rw-r--r-- | spec/section_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/section_spec.rb b/spec/section_spec.rb index 7136d388..ceda2bf7 100644 --- a/spec/section_spec.rb +++ b/spec/section_spec.rb @@ -116,21 +116,21 @@ describe 'Asciidoctor::PDF::Converter - Section' do end it 'should allow theme to set font kerning per heading level' do - input = <<~'EOS' + pdf_theme = { + heading_text_transform: 'uppercase', + heading_h2_font_size: 22, + heading_h3_font_size: 22, + heading_h3_font_kerning: 'none', + } + pdf = to_pdf <<~'EOS', pdf_theme: pdf_theme, analyze: true == Wave__|__ === Wave__|__ EOS - pdf_theme = { heading_text_transform: 'uppercase' } - pdf = to_pdf input, pdf_theme: pdf_theme, analyze: true - with_kerning_position = (pdf.find_unique_text '|')[:x] - - pdf_theme[:heading_font_kerning] = 'none' - pdf = to_pdf input, pdf_theme: pdf_theme, analyze: true - without_kerning_position = (pdf.find_unique_text '|')[:x] + kerning_positions = (pdf.find_text '|').map {|it| it[:x] } - (expect with_kerning_position).to be < without_kerning_position + (expect kerning_positions[0]).to be < kerning_positions[1] end it 'should add text formatting styles to styles defined in theme for specific level' do |
