In today's day and age, product expiration dates are mandatory on nearly all types of packaging. Some products such as pharmaceuticals require even more data to be on the package. Details such as lot numbers, point of origin, time of day, etc, may also be required in certain cases. To achieve that end they are using the high-density bar code. As for the types of packaging I work with I only need to apply a date code and sometimes a lot number. This is done with the machines you see above. These are called videojet printers. They are aptly named because the ink stream of charged ink drops that shoot out of the end of these print heads are steered up and down much the same way as the electron beam on a CRT monitor.(Anybody remember those?)
The printed head is usually mounted at a right angle to a product conveyor. The electron beam effect gives the character its height. The speed of the horizontal movement of the packaging material or containers gives the character its width. Of course the print rate can be adjusted to change the width but the packaging material or container must be moving or you will never get any width at all. These printers can also be purchased in a configuration where the print head is mounted on a horizontal rail so it can travel back and forth. This rail is a linear positioning device that is indexed by a servomotor. The rail system allows print to be applied in situations where the package must remain stationary. I have repaired and maintained videojet machines and the servo rail systems too.