summaryrefslogtreecommitdiff
path: root/spec/font_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-07-25 23:57:32 -0600
committerDan Allen <dan.j.allen@gmail.com>2019-07-26 00:14:26 -0600
commit78ae6302c557ad968e82e48e3010a2699c8c1ce4 (patch)
tree0429d45dedfa949d8d07ff0d429e760d08628793 /spec/font_spec.rb
parentaa3c1913617cfffec1ff2b6a2dc4b1ed48163e48 (diff)
test that essential characters are replaced with suitable replacements when using AFM font
Diffstat (limited to 'spec/font_spec.rb')
-rw-r--r--spec/font_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/font_spec.rb b/spec/font_spec.rb
index dcb2bbe2..0568135c 100644
--- a/spec/font_spec.rb
+++ b/spec/font_spec.rb
@@ -49,6 +49,28 @@ describe 'Asciidoctor::PDF::Converter - Font' do
(expect text[0][:string]).to eql %(#{not_glyph} to #{not_glyph})
}).to log_message severity: :WARN, message: %(The following text could not be fully converted to the Windows-1252 character set:\n| α to ω)
end
+
+ it 'should replace essential characters with suitable replacements to avoid warnings' do
+ with_memory_logger do |logger|
+ pdf_theme = {
+ base_font_family: 'Helvetica'
+ }
+ pdf = to_pdf <<~'EOS', pdf_theme: pdf_theme, analyze: true
+ :experimental:
+
+ * disc
+ ** circle
+ *** square
+
+ no{zwsp}space
+
+ button:[Save]
+ EOS
+ (expect logger).to be_empty if logger
+ (expect pdf.find_text font_name: 'Helvetica').to have_size pdf.text.size
+ (expect pdf.lines).to eql [%(\u2022disc), '-circle', %(\u00b7square), 'nospace', 'button:[Save]']
+ end
+ end
end
context 'Kerning' do