Skip to content

Commit

Permalink
backport fix for #2453 add fallback character for placeholder charact…
Browse files Browse the repository at this point in the history
…er when using AFM font
  • Loading branch information
mojavelinux committed Oct 5, 2023
1 parent 04b4e5f commit 2662aaf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Bug Fixes::

* show dot leaders in TOC entry if toclevels is increased for a given section (#2441)
* decouple tests from path of PWD (#2444)
* add fallback character for placeholder character when using AFM font (#2453)

== 2.3.9 (2023-06-28) - @mojavelinux

Expand Down
1 change: 1 addition & 0 deletions lib/asciidoctor/pdf/ext/prawn/font/afm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Prawn::Font::AFM
?\u200b => '',
?\u202f => ?\u00a0,
?\u2009 => ' ',
?\u2063 => ?\u00ad,
?\u25e6 => '-',
?\u25aa => ?\u00b7,
}
Expand Down
15 changes: 15 additions & 0 deletions spec/image_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2165,6 +2165,21 @@ def traverse node
(expect to_file).to visually_match 'image-inline-scale-down-height.pdf'
end

it 'should not warn about missing glyph for image placeholder char when using AFM font' do
(expect do
pdf = to_pdf <<~'END', attribute_overrides: { 'pdf-theme' => 'base' }, analyze: :image
:pdf-page-size: A6
:pdf-page-layout: landscape
before
image:square.png[pdfwidth=7cm]
END
(expect (images = pdf.images)).to have_size 1
(expect images[0][:page_number]).to be 2
end).to not_log_message using_log_level: :INFO
end

it 'should scale image down to fit available height inside delimited block', visual: true do
to_file = to_pdf_file <<~'EOS', 'image-inline-in-block-scale-down-height.pdf'
:pdf-page-size: A6
Expand Down

0 comments on commit 2662aaf

Please sign in to comment.