This question is related to this one: XeLaTeX - special unicode characters
I've got the same problem of missing unicode characters in my PDF when generated with XeLaTeX.
I used the following example code:
\documentclass[varwidth]{standalone}
\usepackage{fontspec}
\setmainfont{Linux Libertine}
\usepackage{listings}
\begin{document}
These characters are working - +ľščťžýáí˝¨˘˛˙´°'
These aren't - ├ └
\begin{lstlisting}
Listing: ├ └
\end{lstlisting}
\end{document}
I tried different fonts with the same results. I've checked in my LibreOffice Writer that the missing characters are included within the given font.
My OS is Linux (Manjaro) and I run XeLaTeX via the terminal.
Does someone got an idea what the underlying problem is?
Solutions:
The problem is indeed that the font is not suited for the characters I would like to have.
One solution by Marijn is shown below utilizing a package for such missing characters.
Another way is depicted in this blog post where a fallback font is implemented: https://blog.michael.franzl.name/2014/12/10/xelatex-unicode-font-fallback-unsupported-characters/ Repost of the working example code:
\documentclass[]{book}
\usepackage{fontspec}
\setmainfont{Junicode}
\newfontfamily\myregularfont{Junicode}
\newfontfamily\mychinesefont{IPAexMincho}
\usepackage[CJK]{ucharclasses}
\setTransitionsForCJK{\mychinesefont}{\myregularfont}
\begin{document}
Latin text. Chinese text: 紫薇北斗星 Modern greek: Διαμ πριμα εσθ ατ, κυο πχιλωσοπηια Ancient greek: Μῆνιν ἄειδε, θεά, Πηληϊάδεω Ἀχιλῆος. And regular latin text.
\end{document}