Fonts & Character SetsGreek Font not recognized

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Greek Font not recognized

Post by AleCes »

Hello everybody,

I've got a Greek-only font (no Latin characters) that polyglossia none the less refuses to recognize as a Greek font! :o

Minimum example:

Code: Select all

\documentclass[a5paper, openany, 10pt]{book}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{GFS Didot Classic}
\usepackage{polyglossia}
\setmainlanguage[variant=poly]{greek}

\begin{document}
Ἤμουν στὸ σπίτι μου ἐγὼ.
\end{document}
I didn't manage to upload the font here because OTF extension isn't allowed but you can download it here.

The error message I get is the following:

Code: Select all

! Package polyglossia Error: The current roman font does not contain the Greek script!
(polyglossia)                Please define \greekfont with \newfontfamily.

See the polyglossia package documentation for explanation.
Type  H <return>  for immediate help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Greek Font not recognized

Post by Johannes_B »

Doing what is suggested seems to do the trick pretty well, i think?

Code: Select all

\documentclass[a5paper, openany, 10pt]{book}
\usepackage{fontspec}
\newfontfamily\greekfont[Mapping=TeX]{GFSDidot_Classic.otf}
\usepackage{polyglossia}
\setmainlanguage[variant=poly]{greek}

\begin{document}
\greekfont
Ἤμουν στὸ σπίτι μου ἐγὼ.
\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Re: Greek Font not recognized

Post by AleCes »

Hello Johannes_B!

Actually, the error message says the font doesn't have a Greek typeface, no?
Anyway, thanks for the tip! ;)
Post Reply