12

I would like to use CASIO fonts here. enter image description here

1 - I would like to create a way to use LaTeX to get these "icon"s. For example, use \On for the ON button, and ect. Assuming we have to do some more work here to find the mapping of those icons here...

2 - As you can see that target computers (final PDF verwiers) may not have the font installed. I know that we can embed font into PDF. Can this be done using latex too?

enter image description here

3 - I don't mind using a normal .tex to enable me to do so, or creating a package. But I have minimal experience in creating one, so quick-and-easy would be the best.

  • Have a look at fontspec. You can easily define a new font family with the fonts (assuming they are TTF/OTF). Then just use your font family as in {\myfontfamily\char"...} where ... is the unicode code point of the symbol you want to use. And then you can create macros for every shorthand you need. – TeXnician May 31 '18 at 15:52

2 Answers2

12

It's really not hard to do, but it would make sense to make it a package.

Update

I've now packaged this as a package with command names for all the keys. It is now on CTAN. Since I don't use the calculator, suggestions are welcome for more appropriate names for some of the keys. You can submit them at https://github.com/amunn/casiofont/.

Sample document

Here's a sample document. Fonts are embedded by default so any viewer should be able to view the resultant file.

\documentclass{article}
\usepackage{casiofont}
\begin{document}
{\casio \Shift\Alpha\UpArrow\DownArrow\LeftArrow\RightArrow}

\textcasio{\UpArrow}
\end{document}

output of code

Alan Munn
  • 218,180
9

You can call the glyphs by number rather than “by character”. With the following code we can gather the number of each glyph in the font:

\documentclass{article}
\usepackage[a4paper,margin=2cm,heightrounded]{geometry}
\usepackage{fontspec}
\usepackage{multicol}

\newfontface{\casio}{CASIO ClassWiz}[
  Extension=.ttf,
  Path=./ClassWizSeriesFontSet/,
]

\begin{document}

{\casio\xdef\casiofont{\the\font}}

\begin{multicols}{4}
\count255=32

\loop\ifnum\count255<"10FFFF
\advance\count255 1
  \iffontchar\casiofont\count255 \the\count255\ {\casio\char\count255}\endgraf\fi
\repeat

\end{multicols}

\end{document}

enter image description here

For your document you can look up the characters you need and define

\newfontface{\casio}{CASIO ClassWiz}[
  Extension=.ttf,
  Path=./ClassWizSeriesFontSet/,
]

(if you install the font system wide, you don't need those options, of course; otherwise, adjust the path).

Next, assign macros to the glyphs you need:

\newcommand{\casiosymbol}[1]{{\normalfont\casio\symbol{#1}}
\newcommand{\CLeft}{\casiosymbol{33}}
\newcommand{\CEquiv}{\casiosymbol{34}}
\newcommand{\CFactorial}{\casiosymbol{37}}

You can improve the list at any time.

egreg
  • 1,121,712