Thursday, June 4, 2026

Experimenting with method to support overtyped APL characters using the 1053 Emulator

THE PROBLEM - APL CREATES CHARACTERS WITH TWO TYPEBALL GLYPHS

The earliest APL (A Programming Language) implementations by IBM were for the S/360 and 1130 systems. These used a terminal based on the Selectric typewriter for user interaction. The original Selectric has a type ball that has a maximum of 88 characters that it can produce, spread over two hemispheres, originally hosting upper and lower case letters for the office product typewriters. 

The APL language has more than 88 characters thus IBM chose to create some of the APL characters by combining more than one typeball character. It would type the first, backspace to the same spot on the paper and then type the second. For example, the character  is typed, the carrier is backed up to the same spot and the character ' is typed over it to produce the composite character 

On any terminal emulator, all we would see is the character ' because the backspace would erase the first character before inserting the second one. We want one that combines the black pixels of both characters, as would happen if a type ball were printing on paper. 

IDEA FOR A TERMINAL EMULATOR RUNNING ON WINDOWS THAT SUPPORTS THIS

I envisioned a program that would produce results akin to what we see on paper with a Selectric typewriter. It would form lines of text graphically, updating positions if a second (or more) character were typed in the same column. When a line feed occurs, the next line is prepared in all white, waiting for characters to be typed. 

The Selectric typewriter mechanism for the 1053 console is 120 columns wide, which allows us just 16 pixels width per character in order to fit the entire line on a 1920x1080 monitor. This is sufficient for readability, although more would give a crisper image. Each character being typed is entered into a 16x16 image and then merged into the appropriate column of the 120 column wide line. 

EXPERIMENT WITH PYTHON PILLOW

I began to test ideas to make this happen, using the PILLOW library for Python. I was able to quickly achieve some combined characters by 'typing' the two typeball characters into their own 16x16 images, then merging them to produce the composite character. This combined a Quad symbol with a Divides symbol. 

I am thus comfortable that I can build the terminal emulator under Python, making use of the open source APL385 Unicode font to generate all the APL characters used on the 1130 system. Since this is Python based, the code may be portable enough to run on Mac, Unix and other systems as well, as long as they support the truetype font, PILLOW and Python3.

No comments:

Post a Comment