Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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
Miki Tebeka | miki@353solutions.com | @tebeka
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
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, ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
In reply to this post by Miki Tebeka
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 On Wed, Mar 25, 2020 at 3:46 AM Dan Allen <[hidden email]> wrote:
... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
It looks like we can simply call the unicode_normalize method on the text to automatically translate to NFC. text.unicode_normalize I see a place where we could do this in Asciidoctor PDF. If you open an issue, I will consider doing that. https://github.com/asciidoctor/asciidoctor-pdf/issues -Dan On Wed, Mar 25, 2020 at 3:47 AM mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by mojavelinux
Thanks. I've submitted https://github.com/prawnpdf/prawn/issues/1154
Miki Tebeka | miki@353solutions.com | @tebeka
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by mojavelinux
That could be a nice workaround. My original intent that the text in the PDF will be in NFD as well, I'll print a notice now.
Miki Tebeka | miki@353solutions.com | @tebeka
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
FWIW I've found out the the IBM Plex Mono font does the job.
(You can view the book at https://gum.co/Qkmou)
Miki Tebeka | miki@353solutions.com | @tebeka
|
Free forum by Nabble | Edit this page |