This question builds upon my attempt to include custom, vectorial, LaTeX symbols inside Python plots via tikz, which (so far) is failing due to the impossibility (my inability ?) to attach proper font metric elements to the symbols.
Hence, I am now attempting to use FontForge to create an actual font for my custom symbols, which I then want/need to properly package in the hope to facilitate their installation via CTAN.
But I cannot seem to properly "bundle" the FontForge products into a LaTeX package. I have tried to follow the FontForge documentation, as well as these step-by-step explanations. There are many other FontForge-LateX related posts and questions out there, but I could find none clarifying a full (and clean) procedure to go from font creation to a fully-fledged package assembly.
What I have done so far:
Creation of
.pfb,.asm,.otf,.enc, and.tfmfiles from FontForge, with encoding set to TeX, and one test symbol (a simple circle) as the0glyph.Compiling the following test document, which does display my symbol just fine:
\documentclass{article}\pdfmapline{=mysymb mysymb <mysymb.pfb}
\begin{document} \font\test=mysymb \test 0 \end{document}
Creation of
umysymb.fdwith the following content:\ProvidesFile{umysymb.fd} \DeclareFontFamily{U}{mysymb}{} \DeclareFontShape{U}{mysymb}{m}{n}{<-> mysymb}{}Edit 24.08.2021: mind the
uat the start of the.fdfile name! See @Marcel Krüger's comment. This solves the following error message (otherwise issued when compiling the test document below):LaTeX Font Warning: Font shape `U/mysymb/m/n' undefinedCreation of
mysymb.stywith the following content:\newcommand{\mysymbol}{{\usefont{U}{mysymb}{m}{n} 0}}Creation of
mysymb.mapwith the following content:mysymb mysymb <mysymb.pfbUpdate of the system map info via the command:
sudo updmap-sys --enable Map=mysymb.mapThis solves the following error message (otherwise issued when trying to compile the test document shown at the next point):
kpathsea: Running mktexpk --mfmode / --bdpi 600 --mag 1+0/600 --dpi 600 mysymb mktexpk: don't know how to create bitmap font for mysymb. mktexpk: perhaps mysymb is missing from the map file.At this point, the following test document compiles without issue, and does display my symbol:
\documentclass{article} \usepackage{mysymb}\begin{document} Hello World. Here's a new symbol: \mysymbol \end{document}
Placement of the following files with my TeX-tree in the appropriate location. In my case, my
tex_locis/usr/local/texlive/2020/texmf-dist/, but this is clearly user/OS dependent:cp metsymb.tfm tex_loc/fonts/tfm/public/metsymb/ cp metsymb.afm tex_loc/fonts/afm/public/metsymb/ cp metsymb.pfb tex_loc/fonts/type1/public/metsymb/ cp metsymb.otf tex_loc/fonts/opentype/public/metsymb/ cp umetsymb.fd tex_loc/tex/latex/metsymb/ cp metsymb.sty tex_loc/tex/latex/metsymb/ cp metsymb.map tex_loc/fonts/map/dvips/metsymb/ cp metsymb.enc tex_loc/fonts/enc/dvips/metsymb/At this point, the package and associated test symbol can be seen by my Python scripts.
Open question: How do I then properly package all of these files to allow for a solid CTAN install ?
As of 24.08.2021, I have created the necessary .ins, .dtx and can successfully generate the .sty file from these.
The last remaining step is to figure out whether all of it can be placed as-is (or not) on CTAN, to be handled automatically by package managers.
mysymb.fdshould be calledumysymb.fd. – Marcel Krüger Aug 23 '21 at 15:54sudo updmap-sys --enable Map=mysymb.mapfollowing this hint. I'm now moving on to the proper packaging of all these elements ... – fpavogt Aug 24 '21 at 06:17