8

Something is wrong with \textmu when using the cabin font package with pdflatex:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[sfdefault]{cabin}

\begin{document}
\textmu{}µm
\end{document}

enter image description here

I have checked the Cabin font on Font Squirrel as well as the OpenType version shipped with the cabin package, and they both contain the µ glyph. Uncommenting the first three \usepackage{...} lines and compiling with either lualatex or xelatex works as expected. (I know that the OpenType version is not used when compiling with pdflatex. I just wanted to point out that the glyph should, in principle, exist in this font.)

Do I have to choose some other encoding? Or is there something wrong with the package?

I'm using MikTeX 2.9.6211 on Windows 10 and all packages should be up to date.

2

3 Answers 3

5
+50

The encoding file cbn_cgvdav.enc is faulty. It used /mu but a look in the pdf shows that the name of the glyph is /uni00B5.

That's why pdflatex complains

pdfTeX warning: pdflatex.exe (file c:/texlive/2016/texmf-dist/fonts/type1/impal
lari/cabin/Cabin-Regular.pfb): glyph `mu' undefined

You should notify the author. http://www.ctan.org/pkg/cabin

As a work-around you can make a local copy of cbn_cgvdav.enc and exchange the two line below the %B0 with these lines here

%B0
  /degree /plusminus /uni00B2 /uni00B3 /.notdef /uni00B5 /paragraph /periodcentered
  /.notdef /uni00B9 /ordmasculine /.notdef /onequarter /onehalf /threequarters /Euro
4
  • In Latin-1 encoding, the "mu" glyph is not supposed to be named mu. Instead, that name blongs to a character in the Greek portion of Unicode. Alas, historically the character at Unicode 00B5 was often named either mu or mu1. If you open the font in FontForge, the program will alert you to the fact that the glyph should have been named uni00B5, not mu or mu1. AFAIK most programs know about the name-change that occured when Unicode became the norm. However, in pdflatex, this is the job of font encoding files.
    – user103221
    Apr 2, 2017 at 18:10
  • 1
    @RobtA: The job of font encoding files is not naming of glyphs, but mapping of glyphs to positions. pdflatex doesn't care much about "correct" names -- you could also use "flivatu" as glyph name -- but the name used in an encoding file must be the same as the one used in the pfb. Apr 2, 2017 at 18:17
  • I think the problem is with the pfb (generated by fontforge). I've generated a pfb using cfftot1 and the \textmu glyph is displayed.
    – user51830
    Apr 2, 2017 at 22:27
  • @UlrikeFischer I knew that! I just did not explain it correctly.
    – user103221
    Apr 2, 2017 at 22:38
5

Update

With the release of 2017-04-02, the pfb files for the Cabin fonts have been fixed and the output of

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[sfdefault]{cabin}

\begin{document}

\textmu{}µm

\end{document}

is as expected

enter image description here

Original answer

I tried compiling nfssfont with the following interactive session:

> pdflatex nfssfont
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/nfssfont.tex
LaTeX2e <2017/01/01> patch level 3
Babel <3.9r> and hyphenation patterns for 83 language(s) loaded.
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/size10.clo))
No auxiliary output files.

**********************************************
* NFSS font test program version <v2.2d>
*
* Follow the instructions
**********************************************

Input external font name, e.g., cmr10
(or <enter> for NFSS classification of font):

\currfontname=


*** NFSS classification ***

Font encoding [T1]:

\encoding=TS1
(/usr/local/texlive/2016/texmf-dist/tex/latex/base/ts1enc.def)
Font family [cmr]:

\family=Cabin-TLF
Font series [m]:

\series=
Font shape [n]:

\shape=
Font size [10pt]:

\size=
(/usr/local/texlive/2016/texmf-dist/tex/latex/cabin/TS1Cabin-TLF.fd)
Now type a test command (\help for help):)
*\table\bye
[1{/usr/local/texlive/2016/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]{/usr/
local/texlive/2016/texmf-dist/fonts/enc/dvips/cabin/cbn_cgvdav.enc}</usr/local/
texlive/2016/texmf-dist/fonts/type1/impallari/cabin/Cabin-Regular.pfb

pdfTeX warning: pdflatex (file /usr/local/texlive/2016/texmf-dist/fonts/type1/i
mpallari/cabin/Cabin-Regular.pfb): glyph `mu' undefined


pdfTeX warning: pdflatex (file /usr/local/texlive/2016/texmf-dist/fonts/type1/i
mpallari/cabin/Cabin-Regular.pfb): glyph `onesuperior' undefined


pdfTeX warning: pdflatex (file /usr/local/texlive/2016/texmf-dist/fonts/type1/i
mpallari/cabin/Cabin-Regular.pfb): glyph `threesuperior' undefined


pdfTeX warning: pdflatex (file /usr/local/texlive/2016/texmf-dist/fonts/type1/i
mpallari/cabin/Cabin-Regular.pfb): glyph `twosuperior' undefined
></usr/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb><
/usr/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb></us
r/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmti10.pfb></usr
/local/texlive/2016/texmf-dist/fonts/type1/public/amsfonts/cm/cmtt10.pfb>
Output written on nfssfont.pdf (1 page, 52627 bytes).
Transcript written on nfssfont.log.

If I try the same with cmr, the relevant row in the output is

enter image description here

so the mu should be in slot "B5. However the corresponding row with Cabin-TLF has

enter image description here

according to the warning issued during processing.

The row with CabinCondensed-TLF shows

enter image description here

It's apparent that something went wrong when building the Cabin-Regular.pfb file.

You should file a bug report to Bob Tennent. For the time being, you can obviate by using the condensed version:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp}
\usepackage[sfdefault]{cabin}

\makeatletter
\DeclareRobustCommand{\textmu}{%
  {\usefont{TS1}{CabinCondensed-TLF}{\f@series}{\f@shape}\symbol{"B5}}%
}
\makeatother

\begin{document}

\textmu{}µm

\end{document}

enter image description here

2

The author of the cabin package, Bob Tennent, sent to me a corrected version of the faulty file Cabin-Regular.pfb. (See egreg's answer).

I have uploaded the corrected file here: http://www.wikiupload.com/HWPLWMIV5RG3QJ5.

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.