Login  Register

Re: Unicode characters not converted in pdf.

Posted by mojavelinux on Feb 08, 2019; 11:14am
URL: https://discuss.asciidoctor.org/Unicode-characters-not-converted-in-pdf-tp6703p6712.html

Thanks for the analysis, Marc.

This appears to be a bug in Prawn's font handling. I tried to use the Prawn API directly with the raw glyph using a font that has that character and it still produces a square box. Perhaps Prawn stops looking for glyphs after a certain threshold.

I recommend submitting an issue for this at https://github.com/prawnpdf/prawn/ with the following test script:

require 'prawn'
 
Prawn::Document.generate 'missing-glyph.pdf' do
  def register_font data
    font_families.update data.inject({}) {|accum, (key, val)| accum[key.to_s] = val; accum }
  end
   
  register_font NotoSerif: {
    normal: '/usr/share/fonts/dejavu/DejaVuSerif.ttf'
  }

  font :NotoSerif do
    text '𝜎'
  end
end

Cheers,

-Dan

On Fri, Feb 8, 2019 at 3:57 AM 1marc1 [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi,

I just tried this as well with a font that has character #120590. The PDF output prints a square as if to indicate that the glyph isn't available. When I replace 120590 in the source with 64 (the number for the @ symbol) it works fine.

I created a table (and used asciidoctor-pdf to turn it into a pdf file) showing a whole range of glyphs:
Glyphs 120512 - 120679

All but a few of the glyphs in the table above are available in the font that I use.

When looking at a lower range (1748 - 1915), I found that the table is representative of the glyphs that are in the font:
Glyphs 1748 - 1915

Perhaps this helps someone in troubleshooting.

Marc.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Unicode-characters-not-converted-in-pdf-tp6703p6711.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux