astefanutti / decktape

PDF exporter for HTML presentations
MIT License
2.19k stars 176 forks source link

Unicode characters from remarkjs in different locale #195

Closed utdrmac closed 4 years ago

utdrmac commented 5 years ago

I wish I had more information to offer, but here's all I have. My slides are written in RemarkJS and I used decktape in the following format to create my pdf:

decktape --chrome-arg=--allow-file-access-from-files --chrome-arg=--disable-web-security remark kubernetes.html ~/Desktop/kubernetes_20190930a.pdf

My bash env shows LANG=en_US.UTF-8 After I exported the PDF, I shared it with 30 others. They all had various PDF readers, on mac, linux and windows. Many of them used different locales (I was the only "USA" guy). The issue was when copying and pasting monospaced text, the - (hyphen, dash) got "translated" into some other character. It looked like a dash, but when pasted to a linux bash prompt, became something else that looked like dash, but was not. This caused command line utils with -flags to fail.

I wish I had an example to show, but I was presenting and didn't have a chance to investigate further. Anyone experience such an issue? Should I change my LANG to something different? Is this a font issue?

utdrmac commented 5 years ago

I do have an example! Attached is 1 slide from my PDF deck and a screenshot of the result copy/paste on macos hyphen-issue.pdf

hyphen-issue-result
astefanutti commented 5 years ago

When I copy from your PDF, I get: kubectl apply <00ad>f deploy/rbac.yaml, so it looks like it contains a soft hyphen instead of a regular one.

I've tried with other presentations, like https://astefanutti.github.io/decktape/examples/remark-js-coloured-terminal.pdf, and copying commands with regular dash works.

Would you mind double-checking that your source contains regular dash or try replacing the soft ones?

utdrmac commented 5 years ago

I had never heard of 'soft hyphen' before. I'm on a 2016 macbook pro and I'm just typing the 'hyphen' key next to '+' key. Using plain text editor, utf8 mode, English keyboard. I just re-printed the entire PDF and doesn't seem to be an issue now when I copy shell commands. Hrm. I'll keep investigating.

astefanutti commented 4 years ago

Let me close this. Feel free to re-open if the analysis above is not correct.