georgd / EB-Garamond

Digitization of the Garamond shown on the Egenolff-Berner specimen
http://www.georgduffner.at/ebgaramond
SIL Open Font License 1.1
902 stars 68 forks source link

Oblique styling #165

Open mikkelee opened 1 year ago

mikkelee commented 1 year ago

It would probably be too much to ask for a complete oblique variant, so here is what I use in case others are interested. The slant value of 0.3 was chosen as a best guess from measurments of long verticals in the italic.

\documentclass{article}

\RequirePackage{fontspec} % note fontspec requires lualatex
\newcommand{\oblique}[1]{{\slshape#1}}

\setmainfont[
    SlantedFont={EB Garamond}, % for some reason, it needs to be specified even if it is at the end of the command, otherwise it just shows as italics
    SlantedFeatures={
        FakeSlant=0.3,
    },
]{EB Garamond}

\begin{document}

\emph{Here is an example of Latin: \oblique{Lorem ipsum etc,} and so on}

\end{document}

Renders as:

Screenshot 2023-03-24 at 18 37 07

Treat this "issue" as you wish :)

georgd commented 1 year ago

Thanks a lot! As you might guess, oblique and unslanted styles are not a priority for me or would be automaticaly generated only.

I’ll leave this issue open for now until I know where to best document this.

amarakon commented 1 year ago

I think you can use \textsl instead of defining a \oblique command. Or, if you want to use \oblique, define it using \let\oblique\textsl.

mikkelee commented 1 year ago

I can never remember if \textXX or \XXshape is the right one to use so I just group stuff. Honest thanks I'm probably gonna refer back to this lol