[Tex/LaTex] How to insert these unicode symbols u2400 to u2421

symbolsunicode

Please how can I insert these unicode symbols in the range u2400 to u2421. They are names of control characters.

You can see them here:
http://unicode.org/charts/PDF/U2400.pdf

I could find the package keystroke which has very nice keys, but that is not what I want.

Thanks!


Edited:

Quoting Marco: "The problem is to find a font that contains these characters."

Best Answer

It mostly depends on your setup. If you're using XeLaTeX or LuaLaTeX and fontspec it all boils down to

\newfontfamily{\lowasciifont}{Free Sans}
\newcommand{\lowascii}[1]{{\lowasciifont\char\string"#1}}

in the preamble and \lowascii{2400} and so on in the document. Example:

\documentclass{article}
\usepackage{fontspec}
\newfontfamily{\lowasciifont}{Free Sans}
\newcommand{\lowascii}[1]{{\lowasciifont\char\string"#1}}

\begin{document}
\lowascii{2400} \lowascii{2401}
\end{document}

enter image description here

Without XeLaTeX or LuaLaTeX I don't know of any font that has those symbols. One might conceive to create suitable Type1 fonts from FreeSans, but it's quite a job and probably its easier to fake those symbols with some low level trick.

Here's an example:

\usepackage{lmodern}
\newcommand{\lowascii}[1]{\innerlowascii#1\relax}
\def\innerlowascii#1#2#3\relax{%
  $\vcenter{
  \fontsize{4}{4}\sffamily
  \offinterlineskip
  \kern-1.2ex
  \sbox0{#1}\dimen0=\wd0 \box0
  \sbox0{#2}\moveright\dimen0\copy0 \advance\dimen0\wd0
  \if\relax\detokenize{#3}\relax\else\moveright\dimen0\hbox{#3}\fi}$}

In the text you can say

A \lowascii{NUL} \lowascii{LF} B

and get

enter image description here