Entmatix · 2022-08-11 12:11
Hello, folks.
I used to export my agenda view to pdf to share it across my devices (no, I don't like mobile versions of emacs/org-mode, I prefer pdf). Parts of my init.el:
```
(setq org-agenda-exporter-settings
'((org-agenda-span 'week)
(org-agenda-add-entry-text-maxlines 100)
(ps-print-color-p 'black-white)
(ps-font-size 16)
(org-texinfo-coding-system 'utf-8)
(ps-number-of-columns 1)
(ps-landscape-mode t)))
(defun custom/agenda/save-and-export ()
(interactive)
(org-save-all-org-buffers)
(org-agenda-goto-today)
(custom/agenda/export-current-view))
(defun custom/agenda/export-current-view ()
(interactive)
(org-agenda-write "~/NC/org/agenda.pdf"))
```
If some text wasn’t in english in resulting pdf I get question marks instead of characters. Like it's wrong encoding:
```
Sched.12x: TODO ??????????
Sched.12x: TODO ?????????? ???????
Sched.11x: TODO ??????????
Sched.10x: TODO ????????? ?????? miniDV
```
I googled this, but found nothing helpful. Can anybody explain how to fix it?
Upd. Just tried to set utf-8 for everything I've found.
```
(set-language-environment "UTF-8")
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
```
No success...
Hamilton950B · 2022-08-11 13:36
Are you sure the font embedded in the pdf has glyphs for those characters? Can you try a different font?
Entmatix · 2022-08-11 14:34
Hello, Hamilton950B! My default font is Liberation Mono.
```
(set-face-attribute 'default nil :font "Liberation Mono" :height 190)
```
It definitely supports characters in Deutsch. I use this font everywhere: in terminal, emacs itself, ms word, etc. It renders fine. You think it could still it be a problem?
Hamilton950B · 2022-08-11 15:36
That's the font on your screen. I'm talking about the one in the pdf. There are tools like pdffonts that will tell you what fonts your pdf uses and whether they are embedded in the pdf.
If it was some non-latin script this could be the problem. But if it's German then it's unlikely. Also unlikely to be an encoding problem, because the latin characters should still render.
Entmatix · 2022-08-12 05:07
I see.
```
pdffonts agenda.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
IBENGI+Helvetica-Bold Type 1C WinAnsi yes yes no 7 0
HJLQMU+Helvetica Type 1C WinAnsi yes yes no 9 0
VBBEWE+Courier Type 1C Custom yes yes no 11 0
```
AFAIU winansi == cp1252. I don't have anything relative to cp1252 in my emacs config. Could this be ghostscript, that is involved into conversion process?
Hamilton950B · 2022-08-12 13:44
cp1252 could be a problem. I don't know how the conversion to pdf works other than that it uses ps2pdf. Sorry I can't be any more help.