[Tex/LaTex] How to use Adobe Source Sans’ greek letters

fontssourcesanspro

I know the font has support for the greek language. Are those characters accessible in pdfLateX?


MWE

\documentclass{article}
\usepackage[utf8]{inputenx}
\usepackage[english,greek]{babel}
\usepackage[default]{sourcesanspro}
\usepackage[T1]{fontenc}
\begin{document}
α a $\alpha$
\end{document}

gives me the following error (caused by the greek option for babel):

miktex-makemf: The grtm source file could not be found.

Running hbf2gf.exe...


hbf2gf (CJK ver. 4.8.3)



Couldn't find `grtm.cfg'

miktex-maketfm: No creation rule for font grtm10.

! Font LGR/ptm/m/n/10=grtm10 at 10.0pt not loadable: Metric (TFM) file not foun
d.
<to be read again> 
                   relax 
l.2 \select@language{greek}

EDIT:

Errata corrige: the following code does not print any letter in Source Sans.
I've mistaken upright greek CM for Source Sans…

Note that

\documentclass{article}
\usepackage[utf8]{inputenx}
\usepackage[default]{sourcesanspro}
\usepackage[LGR]{fontenc}% changed the encoding
\begin{document}
α a $\alpha$
\end{document}

prints the greek letters (the first two in Source Sans, the third one in CM), but the "a" is now an alpha, too.

Best Answer

The problem

Currently, Source Sans Pro does not come with the LGR encoding. This means that when you run your second MWE, the following errors are shown:

LaTeX Font Warning: Font shape `LGR/SourceSansPro-LF/m/n' undefined
(Font)              using `LGR/cmr/m/n' instead on input line 6.

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

Solution: LGR for Source Sans Pro

I've built the font with the LGR encoding. Your MWE now results in the following:

three alphas

What you see here is the correct behaviour: the LGR encoding only includes Greek symbols.

This really needs more testing, for which I have created a branch. From there you can also download Source Sans Pro with LGR support.

Finally, to get the result you want, you need to switch font encoding halfway:

\documentclass{article}
\usepackage[utf8]{inputenx}
\usepackage[default]{sourcesanspro}
\usepackage[OT1,LGR]{fontenc}% changed the encoding
\begin{document}
α {\fontencoding{OT1}\selectfont a} $\alpha$
\end{document}

alpha a alpha

Alternate solution: XeLaTeX

Running this with XeLaTeX does result in the expected behaviour:

\documentclass{article}
\usepackage[greek,english]{babel}
\usepackage[default]{sourcesanspro}
\begin{document}
α a $\alpha$
\end{document}

alpha a alpha

You can also change the Math font with mathspec:

\documentclass{article}
\usepackage{mathspec}
\usepackage[default]{sourcesanspro}
\defaultfontfeatures
    { Ligatures      = TeX ,
      Numbers        = Proportional ,
      Extension      = .otf ,
      UprightFont    = *-Regular ,
      ItalicFont     = *-RegularIt ,
      BoldFont       = *-Bold , 
      BoldItalicFont = *-BoldIt }
\setmathfont(Digits,Latin){SourceSansPro}
\setmathfont(Greek)[Lowercase = Regular]{SourceSansPro}
\defaultfontfeatures{}
\begin{document}
α a $\alpha$
\end{document}

Greek has been set to regular (ie: not italic) because Source Sans Pro lacks Greek italics.

alpa a better alpha