# Fix Kerning Internal to a Unicode Character

Is there any way to drill down into the code that defines, for example, to fix the kerning of the diacritics? It's worse in ebgaramond; it's not very much better in computer modern.

\documentclass{standalone}

\usepackage{ebgaramond}
\usepackage[greek]{babel}

\begin{document}

\textgreek{Ἄνθρωπε, οὐκ οἶδα ὃ λέγεις.}

\end{document}

• with lualatex it is better (then without \textgreek). Feb 4 at 10:34

The character in question is U+1F0C GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA and we find, in lgrenc.dfu,

\DeclareUnicodeCharacter{1F0C}{\ensuregreek{\accpsilioxia\textAlpha}}        % Ἄ

and in lgrenc.def we see

\DeclareTextCompositeCommand{\accpsilioxia}{LGR}{\textAlpha}{>'A}

Thus the character translates directly in the combination >'A. In the Greek fonts, >' is a ligature and some fonts may provide a kerning between this character and the letter A (which is used to transliterate the Greek Alpha). For instance, if I remove the call to ebgaramond, the tracing by TeX shows

....\LGR/cmr/m/n/10 ^ (ligature >')
....\kern-0.83313
....\LGR/cmr/m/n/10 A

But when ebgaramond is used the same combination produces

....\LGR/EBGaramond-OsF/regular/n/10 ^ (ligature >')
....\LGR/EBGaramond-OsF/regular/n/10 A

No kerning. Can we add it in this case? Yes, we can.

\documentclass{article}

\usepackage{ebgaramond}
\usepackage[greek]{babel}

\DeclareTextCompositeCommand{\accpsilioxia}{LGR}{\textAlpha}{>'\kern-0.15em A}

\begin{document}

\textgreek{Ἄνθρωπε, οὐκ οἶδα ὃ λέγεις.}

\end{document}

You'll need to fix other composite commands, I believe, but the idea is the same.

• Definitely the letter of the question. Thanks. Feb 4 at 15:08

No need to drill down to anything. As @UlrikeFischer has already suggested in a comment, if you are willing and able to do so, by all means consider switching to either LuaLaTeX or XeLaTeX, and don't use \textgreek wrappers.

% !TEX TS-program = xelatex  %% or 'lualatex'
\documentclass[border=2pt]{standalone}
\usepackage{ebgaramond}
\usepackage[greek]{babel}
\begin{document}
Ἄνθρωπε, οὐκ οἶδα ὃ λέγεις.
\end{document}
• Up-voted because the spirit is right, and I probably will switch to XeLaTeX. Feb 4 at 15:09