[Tex/LaTex] Replacing a glyph in one font with a glyph from another

charactersfontslatin-modern

I am a newbie with LaTeX when it comes to fonts. I would like to replace the double story "a" in Latin Modern for a single story "a" version (and similarly for the "g"). I just prefer my typeset output to look more in line with my handwritten output, aesthetics be damned. Last year, when I asked this question most people thought I was crazy to mess with the font design, but I want to do it anyway (I am stubborn that way).

To partly alleviate the mixing and matching ugliness of the output (I am not totally deaf to the wise comments of my detractors from yesteryear), I wish to use as a substitute Latin Modern italics, upright version, but only for the characters "a" and "g" (in all available font sizes and weights). I would hope that the clash would be thus minimized, as both fonts are Latin Modern, and so share some familiarity with each other.

First: how do I get access to this hidden font version of Latin Modern?
Second: how do I make the change using LaTeX for these two glyphs only? A partial answer was suggested to me last year, using XeTeX (and I need to study it further in order to understand it), but I gather XeTeX is not completely compatible with microtype, and I would rather not learn a new paradigm for my typesetting if I can help it.

Thank you all for your answers. This forum is always very helpful to me.

UPDATE

Well, here is a partial answer to my question.

I have the following in my document header:

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{cfr-lm}
\DeclareTextFontCommand{\upa}{\fontencoding{T1}\fontfamily{clm2j}\selectfont\textui{a}}
\DeclareTextFontCommand{\upaa}{\fontencoding{T1}\fontfamily{clm2j}\selectfont\textui{á}}
\DeclareTextFontCommand{\upg}{\fontencoding{T1}\fontfamily{clm2j}\selectfont\textui{g}}
\DeclareUnicodeCharacter{0061}{\upa}
\DeclareUnicodeCharacter{00E1}{\upaa}
\DeclareUnicodeCharacter{0067}{\upg}

Now the actual upright italic letters ARE created.
But somehow the \DeclareUicodeCharacter commands have no effect whatsoever. Anyone knows why?

Best Answer

The code you are using for your declarations is equivalent to

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{cfr-lm}
\newcommand*{\upa}{\textui{a}}
\newcommand*{\upaa}{\textui{á}}
\newcommand*{\upg}{\textui{g}}
\begin{document}
 a \upa á \upaa g \upg
\end{document}

There is no need to declare a text font command for a single character and it is not appropriate. Loading lmodern and then loading cfr-lm is pointless because the latter overwrites or duplicates everything from the former. Loading fontenc with option T1 is also pointless because cfr-lm does it anyway.

Note that this approach is going to give you some very bad typographical results.

Text becomes more difficult to read because it becomes less clear where words begin and end, for example. Even without surrounding text, you can appreciate the difficulties:

yuck

Note that the kerning issues here. (Admittedly the kerning in the upright italic doesn't help, as can be seen in the ui version of 'gyroscope'.)

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{cfr-lm}
\newcommand*{\upa}{\textui{a}}
\newcommand*{\upaa}{\textui{á}}
\newcommand*{\upg}{\textui{g}}
\begin{document}
 Vat

 V\upa t

 \textui{Vat}

 gyroscope buggy

 \upg yroscope bu\upg\upg y

 \textui{gyroscope buggy}
\end{document}