Re: Problem with NFD normalized Unicode in PDF
Posted by
mojavelinux on
Mar 25, 2020; 9:47am
URL: https://discuss.asciidoctor.org/Problem-with-NFD-normalized-Unicode-in-PDF-tp7780p7785.html
Btw, the font isn't going to matter. The problem is not the font. It's the translation of the character sequence to the font glyph. The code that handles that is only considering the NFC form.
-Dan
Miki,
I was not aware that these two forms even existed. I did a little digging and it turns out this is something that the PDF generator, Prawn, needs to handle. Asciidoctor PDF isn't the one responsible for interpreting the text. Asciidoctor PDF passes the text though to the PDF generator to encode into PDF objects. So something's going wrong at that level. You'll need to report it here:
https://github.com/prawnpdf/prawn
We could add a test for this to track the situation.
Since the visible result is the same, the workaround I propose is to use an ifdef conditional to output the NFC form in both cases when converting to PDF. At least then you don't see the right glyph instead of the notdef glyph.
Best Regards,
-Dan
On Tue, Mar 24, 2020 at 4:00 AM Miki Tebeka [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
Hi All,
I'm writing a book on programming and want to show NFC & NFD normalized Unicode. The NFD version is not rendered well on PDF.
Here's a short example:
I once went to Kraków, it's a nice city. (NFC)
I once went to Kraków, it's a nice city. (NFD)
You can view "asciidoctor-pdf city.adoc" result at https://www.dropbox.com/s/9luy50tveup7zxh/adoc-nfd.png?dl=0 (for some reason I can't insert an image).
I've tried to change the code font using a custom theme but it didn't help. Any idea on how to solve this?
Thanks,
Miki
--
--