Text mode PDF

We modify the PDFdevice. I could not manage to include the fonts, so we substitute them with the standard fonts Times, Helvetica and Courier.

I added PDF rendering to page directly. The PDF can just displayed as image. But this works only on Safari.

Javascript Editor

We also need to map the Unicode characters to MacRoman for the standard fonts. Funny there is no javascript function for this.

Javascript Editor

We rewrite the widthshow operator that it can also send the extraspace and not the targetlength. This works better with PDF:

Javascript Editor

Javascript Editor

Seems to work. We check the other text examples

Javascript Editor

Javascript Editor

Text justify works only partially, because the font metrics of the substitute fonts are not exactly the same.

Javascript Editor

ps20241027.js 3421 lines, 122 KB

I tried some minifier that can make 78 KB out of it. It's not really worth gaining 44 KB, when fonts are bigger than the scripts.

My Journey to PostScript