2

I tried to use FakeBold feature of fontspec in a simple text that mix Latin letters with Greek inside the same word. My problem is that the output seems Utf8 but actually it is not! I noticed that when I tried to copy and paste the output of following code in a text editor(TeXworks) then 1) Some characters are in ? 2)there is no space between the first word Γεννaται(in bold) and the second one

(in my case the output is ΓεννaταιΓεννaται Γενν?ται)

Could you please explain me this strange behavior?

    \documentclass[letterpaper, 12pt]{article} 
        \usepackage[no-math]{fontspec} 
        \usepackage{polyglossia}
        \setmainlanguage{greek} 
        \setmainfont{Arial}
        \begin{document}
        \addfontfeature{FakeBold=2}Γεννaται\addfontfeature{FakeBold=0} Γεννaται Γεννάται
        \end{document}

Notes: Each of the above lines are written in different lines in TeXworks. I used MikTeX and XeLaTeX engine.

  • Why not using \textbf{Γεννaται} Γεννaται Γεννάται? – egreg Feb 2 '17 at 18:37
  • I see no problem. Spaces can always disappear - this depends on the pdf viewer. Glyphs can disappear if the font you are using doesn't contain them. Btw: pdf doesn't contain utf8. – Ulrike Fischer Feb 2 '17 at 18:37
  • @egreg Sometimes, it is vary usefull to have different boldness in the text – kornaros Feb 2 '17 at 18:43
  • @ Ulrike Fischer Have you tried to copy paste this simlpe output? I used very simple glyphs and the output seems ok. But the problem starts when I try to copy -paste the output! – kornaros Feb 2 '17 at 18:43
  • @kornaros No, it wouldn't be. – egreg Feb 2 '17 at 18:47
1

The command \addfontfeatures{...} gobbles spaces following it, which is a good thing in general; use

\addfontfeature{FakeBold=2}Γεννaται\addfontfeature{FakeBold=0}\ Γεννaται Γεννάται

if you really want to use this awkward style. In general, \addfontfeatures should be used sparingly and (almost) never in a document. Moreover, since it respects grouping, doing

{\addfontfeature{FakeBold=2}Γεννaται} Γεννaται Γεννάται

would be easier.

However, this should better be

\textbf{Γεννaται} Γεννaται Γεννάται

All examples typeset the same

enter image description here

If your font doesn't have boldface, define it in the font setup. I'll make an example with EB Garamond

\documentclass[letterpaper, 12pt]{article}
\usepackage[no-math]{fontspec}
\usepackage{polyglossia}
\setmainlanguage{greek}

\setmainfont{EB Garamond}[
  BoldFont=*,
  BoldFeatures={FakeBold=4},
]

\begin{document}

\textbf{Γεννaται} Γεννaται Γεννάται

\end{document}

enter image description here

About the ?, I believe it's a problem of copy-pasting, dependent on the operating system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.