# Change the Courier default font in pst-barcode (or make it embed)

When I use \pstbarcode command from pst-barcode package, it print a barcode using Helvetica and Courier as fonts, but this fonts are they are not free are not included in the PDF.

As you can see, with the following MWE:

\documentclass{article}
\usepackage{pst-barcode}

\begin{document}

\psbarcode{0-00000-000}{includetext}{isbn}

\end{document}


I get the following rendering:

And, as you can see with pdffonts tool, the two fonts are not embed in the pdf:

% pdffonts main.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
UNUFWV+LMRoman10-Regular-Identity-H  CID Type 0C       Identity-H       yes yes yes     13  0
Helvetica                            Type 1            Standard         no  no  no       8  0
Courier                              Type 1            Standard         no  no  no       9  0


# The current state

For the moment, I solve the problem just with Helvetica, usign the \pstbarcode’s option textfont="Liberation Sans" like this:

\psbarcode{0-00000-000}{includetext  textfont="Liberation Sans"}{isbn}


Then, the bottom text font is fixed, but the upper one is not, as you can see with pdffonts:

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
XSRAXK+LMRoman10-Regular-Identity-H  CID Type 0C       Identity-H       yes yes yes     15  0
Courier                              Type 1            Standard         no  no  no       8  0
EZVLBQ+"Liberation                   Type 1C           WinAnsi          yes yes no      11  0


So, how can I change the default courier font for another one, like CMU Typewriter or Anonymous Pro and make this font embed in the final pdf ?

Use the pst-barcode option isbntextfont.

See the reference here:

https://github.com/bwipp/postscriptbarcode/wiki/ISBN

You should use the PostScript font name with these options which this post may help you to identify:

https://apple.stackexchange.com/a/275493

• Yes the solution was just to do \psbarcode{0-00000-000}{includetext textfont="Liberation Sans" isbntextfont="Anonymous Pro"}{isbn}. So, it’s a problem because this option isn’t at all documented in the manual. – fauve Jul 26 at 21:34
• – Terry Burton Jul 26 at 21:37
• The manual is produced automatically from the wiki content. – Terry Burton Jul 26 at 21:37
• Note my edit concerning PS font names. – Terry Burton Jul 26 at 21:43