% !TEX TS-program = lualatex

\documentclass{article}

\usepackage{cmgraded}
\usepackage{newunicodechar}
\usepackage{accsupp}

\pagestyle{empty}

% German low quotes by lowering a closing quote to comma height.
% Used to be how already the pre-babel german.sty file did it since about 1987.
\newcommand{\CMGlowquote}[2]{% #1 = ActualText (hex)  #2 = high quote to lower
  \BeginAccSupp{method=hex,unicode,ActualText=#1}%
    \leavevmode
    \setbox0=\hbox{,}\setbox2=\hbox{#2}%
    \dimen0=\ht2 \advance\dimen0 by -\ht0
    \lower\dimen0\box2\relax
  \EndAccSupp{}}
\newunicodechar{„}{\CMGlowquote{201E}{\textquotedblright}}% „ = lowered ”
\newunicodechar{‚}{\CMGlowquote{201A}{\textquoteright}}%   ‚ = lowered ’

% French guillemets by raising small math ≪ and ≫ slightly.
% Is how babel does it at least in PDFLaTeX since about 1996.
\newcommand{\CMGguillemet}[2]{% #1 = ActualText (hex)  #2 = \ll or \gg
  \BeginAccSupp{method=hex,unicode,ActualText=#1}%
    \leavevmode\raise0.25ex\hbox{$\scriptscriptstyle#2$}%
  \EndAccSupp{}}
\newunicodechar{«}{\CMGguillemet{00AB}{\ll}}% « opening
\newunicodechar{»}{\CMGguillemet{00BB}{\gg}}% » closing

\begin{document}

\section*{\textsf{Computer Modern Graded – Emulate Glyphs}}

How to assemble some glyphs in ways in which they
were assembled in the past by some language packages,
such that you can use the Unicode characters
directly in the source
and also get correct Unicode characters
when copying text from the resulting PDF,
at least with many mainstream PDF viewers.

See the \LaTeX\ source of this document for how it is done.

And copy the lines below out of the PDF:
With a reader that honours \texttt{/ActualText}
you get the corresponding Unicode characters
\texttt{\small U+201E}, \texttt{\small U+201A},
\texttt{\small U+00AB} and \texttt{\small U+00BB};
the visible glyphs are closing quotes ” and ’ lowered to the baseline
and small, slightly raised math symbols $\ll$ and $\gg$.

\subsection*{\textsf{German low Quotes}}

\begin{itemize}

\item „Ein Wort und ein Satz.“

\item „Er sagte ‚ja‘ dazu.“

\end{itemize}

\subsection*{\textsf{French Guillemets}}

\begin{itemize}

\item «\,un mot\,» et «\,une phrase\,».

\end{itemize}

\noindent
\textsf{Sans works too: „Wort“, ‚wort‘, «\,mot\,».}

\end{document}
