Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including
Stack Overflow
, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this community
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Copying the output with SumatraPDF even shows regular space characters between the letters and a line break between the words:
Hello World!
Hello World!
H e l l o
W o r l d !
(Copying it with Adobe Reader XI Win, however, yields three identical lines.)
This problem doesn't occur with LuaLaTeX:
The OCR-layer-text for LuaLaTeX is flawless as well, using either PDF viewer.
I assume this is a XeTeX bug? Can I circumvent it somehow?
I'm using MiKTeX 2.9, and version 2.33 of the DejaVu fonts, which I think came preinstalled with Windows (7), at least I can't recall manually installing these fonts. This version seems to be the current version, at any rate.
P.S.: If someone can recommend another monospaced font for code that a) goes well with Linux Libertine and b) contains lowercase Greek letters, that'd be helpful, too. But that just as an aside :)
.
–
–
Have you tried specifying the fonts in more detail?
I've tested the following in MiKTeX 2.9 without a problem.
\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{
Extension = .ttf ,
Ligatures = TeX ,
UprightFont = * ,
ItalicFont = *-Oblique ,
BoldFont = *-Bold ,
BoldItalicFont = *-BoldOblique
\setmainfont[ItalicFont = *-Italic, BoldItalicFont = *-BoldItalic]{DejaVuSerif}
\setsansfont{DejaVuSans}
\setmonofont{DejaVuSansMono}
\begin{document}
Hello World!
\textsf{Hello World!}
\texttt{Hello World!}
\end{document}
You do need to have the dejavu
package installed.
–
–
The problem turned out to be more or less the same as in \setmainfont{Linux Libertine O} uses pfb files instead of otf: XeLaTeX didn't even use the Windows fonts, but the ones in the texmf tree (which for some reason seem to be flawed). The solution is the same as for the other question: Tell MiKTeX not to use those.
Here's how to do that:
Open your localfonts2.conf
file. You may have several versions of this file in different places; the one that works for me is in C:\Users\doncherry\AppData\Roaming\MiKTeX\2.9\fontconfig\config
(“Admin” MiKTeX installation). The file should look like this:
<?xml version="1.0"?>
<fontconfig>
<selectfont>
<rejectfont>
<glob>C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/dejavu/*</glob>
</rejectfont>
</selectfont>
</fontconfig>
With this configuration, everything works for me. According to Khaled Hosny, this specification will not be necessary anymore in the future, perhaps in MiKTeX 3.0.
Update:
While not using the Type1 fonts makes the problem go away, the Type 1 fonts still were buggy somehow. I contacted the author of the dejavu
package; he identified the problem (too big Em Size) and said it would be fixed in a future version of the package.
–
–