Skip to content

Commit

Permalink
resolves #2453 add fallback character for placeholder character when …
Browse files Browse the repository at this point in the history
…using AFM font (PR #2454)
  • Loading branch information
mojavelinux authored Oct 5, 2023
1 parent f1aa523 commit b356aae
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 @@ -52,6 +52,7 @@ Bug Fixes::
* prevent special character substitution from interfering with callouts in plain verbatim block (#2390)
* remove deprecated, undocumented `svg-font-family` theme key (the correct key is `svg-fallback-font-family`)
* 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 @@ -2245,6 +2245,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 <<~'END', 'image-inline-in-block-scale-down-height.pdf'
:pdf-page-size: A6
Expand Down

0 comments on commit b356aae

Please sign in to comment.