2

I want to use following font in my current document with pdflatex and lualatex

https://ctan.org/tex-archive/fonts/cryst

Following MWE compiles successfully

\documentclass{article}
\usepackage{tikz}

\DeclareFontFamily{U}{cry}{\hyphenchar\font=-1}
\DeclareFontShape{U}{cry}{m}{n}{ <-> cryst}{}
\newcommand{\cry}[1]{{\usefont{U}{cry}{m}{n} \symbol{#1}}}

\begin{document}
    \begin{tikzpicture}
     \node (a) at (0,0) {\cry{2}};
    \end{tikzpicture}
\end{document}

However, right now I get only a bitmap font

enter image description here

Log file contains only a single line to a cryst file:

/Users/hotschke/Library/texlive/2018/texmf-var/fonts/pk
/ljfour/public/cryst/cryst.600pk

And most importantly my printer prints only following error

ERROR: limitcheck
OFFENDING COMMAND: imagemask

STACK:

(r)
(Sys/Start)
(Sys/Start)

enter image description here

I have MacTeX 2018 on macOS 10.14 installed.

As far as I understand the question load custom font in miktex 2.9 concerning using 'cryst' on MikTeX, the description given in the README of the font 'cryst' is outdated.

Can one help me to configure it properly in a texmf local directory?

Afaik, the texmf local base directory on macOS by default is

$HOME/Library/texmf
/usr/local/texlive/texmf-local/

See here for details why you should not install fonts into your home folder. Other files such as packages are probably be fine (http://tug.org/mactex/faq/faq.html#atqm05down).

General description of how to install a font is given here:

https://www.tug.org/fonts/fontinstall.html

The site https://www.tug.org/fonts/fontinstall-personal.html also warns twice about installing fonts into a personal folder.

I have followed the README the first four steps copying the relevant files into the texmf local tree:

❯ mkdir -p /usr/local/texlive/texmf-local/{tfm,source,afm,type1}/cryst1
❯ cp /usr/local/texlive/2018/texmf-dist/fonts/tfm/public/cryst/cryst.tfm /usr/local/texlive/texmf-local/fonts/tfm/cryst1
❯ cp /usr/local/texlive/2018/texmf-dist/fonts/source/public/cryst/cryst.mf /usr/local/texlive/texmf-local/fonts/source/cryst1
❯ cp /usr/local/texlive/2018/texmf-dist/fonts/afm/public/cryst/cryst.afm /usr/local/texlive/texmf-local/fonts/afm/cryst1
❯ cp /usr/local/texlive/2018/texmf-dist/fonts/type1/public/cryst/cryst.pfb /usr/local/texlive/texmf-local/fonts/type1/cryst1

/usr/local/texlive/texmf-local
❯ tree -P '*cryst*' --prune
.
└── fonts
    ├── afm
    │   └── cryst1
    │       └── cryst.afm
    ├── source
    │   └── cryst1
    │       └── cryst.mf
    ├── tfm
    │   └── cryst1
    │       └── cryst.tfm
    └── type1
        └── cryst1
            └── cryst.pfb

9 directories, 4 files

Now, I am not sure how to update the files

  • config.ps (for dvips) with p +cryst1.map
  • pdftex.cfg for pdftex with map +cryst1.map
  • and what I have to do for lualatex.

UPDATE Extract of the README (without the 'trivial' steps of copying files):

Tell dvips (for PostScript output) where to find the files.
To this end, insert the following line into the file config.ps:
p +cryst1.map
(config.ps is in a directory like \texmf\dvips\config
or /usr/share/texmf/dvips/config).
If you use pdfTeX, insert
map +cryst1.map
to your pdftex.cfg file
(in \texmf\pdftex\config or /usr/share/texmf/pdftex/config).

Create a new file cryst1.map in a new subdirectory of the directory
of map files (e.g. \texmf\dvips\cryst1 or /usr/share/texmf/dvips/cryst1).
The file cryst1.map consists of one line:
cryst cryst1 <cryst.pfb

Finally, tell TeX which new files and directories exist. This is done
by a command like
initexmf -u  for MikTeX under Windows
or run texhash under root in the shell of Linux RedHat.
  • Is there no .map file? You need that and then run updmap-user. – Herb Schulz Feb 13 at 15:43
  • No, there is not one. The README says I have to create it myself "Create a new file cryst1.map in a new subdirectory of the directory of map files. The file cryst1.map consists of one line: cryst cryst1 <cryst.pfb". – Hotschke Feb 13 at 15:44
4

The easy method is to add this line to your document:

 \pdfmapline{=cryst cryst1 <cryst.pfb}

To setup the map file create a small file cryst.map with the content

 cryst cryst1 <cryst.pfb

Put it in texmf-local/fonts/map/cryst

Then run on a command line

 mktexlsr

and

 updmap-sys --enable Map=cryst.map
  • Thank you for your answer. It pointed me into the right direction. However, I had to run $ updmap -user --enable Map=cryst.map so that the pfb file under /Users/hotschke/Library/texmf/fonts/type1/cryst1/cryst.pfb was found by pdflatex/lualatex. – Hotschke Feb 13 at 17:47
  • Does your first suggestion require that I have to place the pfb file in the same directory as the tex file? – Hotschke Feb 13 at 17:48
  • on my system the pfb is in texmf-dist from texlive 2018. And normally you shouldn't use updmap --user but only the -sys variant. But now that you did it, remember that you have now local map-files and probably will have to run updmap regularly to update them. See also tex.stackexchange.com/questions/255709/… – Ulrike Fischer Feb 13 at 17:52
  • Yes, I know I should not have invoked in the past updmap --user. There was a big warning when I did it. However, I felt that the directory ~/Library/texmf is the correct one for my local additions and not under /usr/local/texlive/texmf-local. Anyhow, your advice & help is very welcome. – Hotschke Feb 13 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.