Extracting glyphs from an OpenType file
In order to create a compact representation of a monogram, I wanted to get the raw
curve info from the Latim Modern Roman
font, not the rendered glyphs.
This article documents how I did that.
In order to create a compact representation of a monogram, I wanted to get the raw
curve info from the Latim Modern Roman
font, not the rendered glyphs.
This article documents how I did that.
Originally I looked for a Python module to generate barcodes, and I found the treepoem module. This used Pillow to create bitmaps, and I preferred to have PDF or other resolution independant formats. Looking through the README, I found that treepoem is a wrapper for bwipp. This is a set of PostScript procedures to generate barcodes.
Since I’m familiar with using PostScript, I decided to use bwipp
directly.
At work I needed a suitable way to check the calibration of gelcoat spray equipment. Gelcoat requires an initiator (often called “catalyst”) in the form of a peroxide to cure. The peroxide/gelcoat ratio is important, so it is checked regularly by spraying the separate components into suitable containers and weighing them.
For those familiar with gelcoat spraying, this is not a system with coupled gelcoat and peroxide pumps. But rather an external mixing spray gun where the peroxide is simply fed from a pressurized container to the spray gun.
Since we’re handling resins, solvents and peroxide, protective equipment including gloves is a must. That makes it cumbersome to whip out a smartphone to use it as a calculator to check the ratio. Since you don’t want to get gelcoat or peroxide on your expensive phone, you have to take off your gloves to handle it. This would have to be repeated several times.
So I decided to make a diagram where one could relatively easy read off the peroxide percentage given the quantities of both components. This can be printed and laminated between plastic to make it resistant against stains.
The whole thing can be found in a github repo.
PostScript (in the form of ghostscript) was for me the first way to generate vector graphics outside of a CAD program. I have several hundreds of figures written in PostScript for inclusion in e.g. LaTeX document.
Later I’ve started using other programs and modules like asymptote and TikZ. But there are cases (especially if you want a small file) where directly drawing in PostScript is still the best way to go.
When the book Mathematical Illustrations was mentioned on hacker news, this re-kindled my interest in PostScript. And I learned some valuable lessons from it.
As a long-time UNIX user I’m used to programs generating PostScript output, and I’m fluent enough in that …