new release of TTF-GDOS

Latest news in the Atari world

Moderators: Mug UK, Silver Surfer, Moderator Team

trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

Faucon2001 wrote: Wed Sep 29, 2021 6:22 pm
I have tried with TimeWorks and FontGDOS drivers.

Do you know if an A4 driver exists ?
I know about fontgdos drivers, but not timeworks drivers.

Fontgdos drivers can be modified with the printer.acc accessory from the fontdos distribution.

Failing that, if you are comfortable with a hex editor:
  • make a backup copy of your fontgdos driver
  • load this backup copy into your hex editor
  • look for the string "_FSM_HDR", it should be near the end
  • count 40 (decimal) bytes further on
  • for letter page size, the 16bit word there should be 0000
  • change this to 0002 (for A4)
  • save changes
  • test
That should make it an a4 driver.

This image shows the 00 02 value for A4 pages just above the 4B 4A in the DESKJET text:

[img]file:///home/trevor/projects/st-archive/driveC/Screenshot_20210930_231043.png[/img]

Hope that helps.
You do not have the required permissions to view the files attached to this post.
Playmobil
Captain Atari
Captain Atari
Posts: 283
Joined: Fri Nov 13, 2015 7:40 pm

Re: new release of TTF-GDOS

Post by Playmobil »

Bon courage Philippe ! :lol: :lol: :lol:

Good Luck Philippe ! :mrgreen: :cheers:
Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: new release of TTF-GDOS

Post by Faucon2001 »

Thanks.
I have switched Fontgdos HP Laserjet driver to A4 with the cpx, but the resulting PCL file is still in Letter.
What puzzle me is that the max printing area of GDOS driver is 278.52 x 278.52 for Letter and A4 paper.

What hex editor do you use? I have not used one in the last 30 years ;-)

Also, does the same trick works with old GDOS drivers?
Philippe

Firebee, Falcon CT60, STE, BeeKey, BeePi.
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/
User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 13285
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: new release of TTF-GDOS

Post by wongck »

Faucon2001 wrote: Sat Oct 02, 2021 5:04 pm Also, does the same trick works with old GDOS drivers?
This is not a trick. This is how GDOS drivers store paper size, quality, dpi, colours, port etc.
Even PHPDF.SYS have this header.... but I don't use any information from the header. it's there to make it looks like a GDOS driver only LOL.
The driver by Rodolfo Thierry that you (IIRC) pass to me documented this as Driver structure.

I think you can load Speedo and add this fontgdos driver to the drivers folder, you can then use Speedo Drivers.ACC to modify it.
I have not tried it but if it is a proper GDOS driver structure, it should work.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff that are no longer for sale due to them over 30 years old - click here for list
User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 13285
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: new release of TTF-GDOS

Post by wongck »

A bunch of TTF don't seems to be showing up in TTF-GDOS using Atari Works while it shows in both NVDI (3.2 ,4.11 & 5.03) & Speedo (5b, 5c & 5.7).
For example segoe print & Palatino linotype family. There seems others,
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff that are no longer for sale due to them over 30 years old - click here for list
User avatar
shoggoth
Nature
Nature
Posts: 1222
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: new release of TTF-GDOS

Post by shoggoth »

Nice work, hats off! I've been browsing the sources though I haven't actually used the new version yet.

Very tidy + very nice utilities to go with it. The TTF->GEM converter which supports hinting etc is a really nice addition.
Ain't no space like PeP-space.
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

Faucon2001 wrote: Sat Oct 02, 2021 5:04 pm Thanks.
I have switched Fontgdos HP Laserjet driver to A4 with the cpx, but the resulting PCL file is still in Letter.
What puzzle me is that the max printing area of GDOS driver is 278.52 x 278.52 for Letter and A4 paper.

What hex editor do you use? I have not used one in the last 30 years ;-)

Also, does the same trick works with old GDOS drivers?
hex editor: I use the linux KDE okteta hex editor. Only necessary if the cpx/acc tools are not available, or if you want to know what is inside the drivers.

The old GDOS drivers do not have the _FSM_HDR, so this trick is not valid for there.

paper size: this is indeed a puzzle. Could the problem be with ghostpcl? Maybe try adding the -sPAPERSIZE=a4 option?

I've attached a dump of the _FSM_HDR for my copy of the laserjet driver. In the last 2 lines, the numbers "095f 0bdd 095f 0f61 0923 0c19 07d9 0a39" are the printable areas for page sizes for US letter, US legal, A4 & B5. So US letter is (hex) 095f x 0bdd dots = (decimal) 2399 x 3037 = 8 x 10.12 inches = 203.2 x 257.2 mm. Similarly, a4 should be 198 x 262.3 mm

Code: Select all

0000d870: 0000 0000 000a fff6 0000 5f46 534d 5f48  .........._FSM_H
0000d880: 4452 0001 043f 0001 0001 0001 0000 0000  DR...?..........
0000d890: 0000 012c 0000 0000 0000 012c 0000 0000  ...,.......,....
0000d8a0: 0000 0000 095f 0bdd 0000 0001 4850 204c  ....._......HP L
0000d8b0: 4153 4552 4a45 5420 0000 0000 0000 0000  ASERJET ........
0000d8c0: 0000 0000 0000 095f 0bdd 095f 0f61 0923  ......._..._.a.#
0000d8d0: 0c19 07d9 0a39 0000 0000 0000 0000 0000  .....9..........
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

wongck wrote: Sun Oct 03, 2021 5:32 am A bunch of TTF don't seems to be showing up in TTF-GDOS using Atari Works while it shows in both NVDI (3.2 ,4.11 & 5.03) & Speedo (5b, 5c & 5.7).
For example segoe print & Palatino linotype family. There seems others,
Hi, I've now tested palatino linotype (from here: https://freefontsvault.com), on Atari works and it is OK for me.

I can think of 2 possibilities:
  1. our versions of the font are different, and yours does not use some font table that ttf-gdos assumes is present
  2. another font is using the same font id as palatino in your setup
My version pala.ttf, is 489884 bytes long, and is dated Jul 20 2016.
Can you try giving this font a different id?
User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 13285
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: new release of TTF-GDOS

Post by wongck »

Thanks for your suggestions.

My Palatino size is different (470084 bytes), so I downloaded a replacement from the freefontsvault.
Replaced the old one, rebooted but still the same. Not sure if it is being cached somewhere, but I don't think so.

I then change the id to id+100, so it is 100 more than what it was. Rebooted, rerun ass-conv for new ttg-gdos.inf file, copied to c:\ root, rebooted.
No dice.

never mind, just need to hunt for new ttf fonts.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff that are no longer for sale due to them over 30 years old - click here for list
Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: new release of TTF-GDOS

Post by Faucon2001 »

trevorbl wrote: Sun Oct 03, 2021 11:49 am paper size: this is indeed a puzzle. Could the problem be with ghostpcl? Maybe try adding the -sPAPERSIZE=a4 option?

I've attached a dump of the _FSM_HDR for my copy of the laserjet driver. In the last 2 lines, the numbers "095f 0bdd 095f 0f61 0923 0c19 07d9 0a39" are the printable areas for page sizes for US letter, US legal, A4 & B5. So US letter is (hex) 095f x 0bdd dots = (decimal) 2399 x 3037 = 8 x 10.12 inches = 203.2 x 257.2 mm. Similarly, a4 should be 198 x 262.3 mm
I have tried with -sPAPERSIZE=a4, but the result is still letter format with fontGDOS HP driver set to A4, which is not surprising as the PCL file is also in letter format.
When I print with NVDI, the page format of the PCL file is A4 and so the pdf. So it's not an issue with ghostPCL, but I believe more in a limitation of GDOS driver.
I have the feeling that GDOS driver always output a letter format (216x279 mm) with for A4 a bigger printing zone that fits on a letter format, and then the printer crops the output to 210mm and a formfeed is sent at the end of the letter printing to spit a A4 format.
Philippe

Firebee, Falcon CT60, STE, BeeKey, BeePi.
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

Faucon2001 wrote: Mon Oct 04, 2021 6:29 pm I have the feeling that GDOS driver always output a letter format (216x279 mm) with for A4 a bigger printing zone that fits on a letter format, and then the printer crops the output to 210mm and a formfeed is sent at the end of the letter printing to spit a A4 format.
I now have investigated this, and my conclusions are slightly different: the fontgdos drivers do not say they are outputting a4 size pages.

I pre-pended the printout file with the command <esc>&l26A then converted to a bitmap file and then BINGO! - it's an a4 image.
Except the last band is missed, so still more to do.
Also, I needed to specify the page size in my lpr command.

I wonder, does the nVDI driver issue a set page size command? Could that explain why nVDI worked successfully?

I have written a small test program, tv4.c, and will upload that to sourceforge soon https://sourceforge.net/projects/ttf-gd ... utils.dir/.

here are the comands that I used:

Code: Select all

   echo -n -e "\e&l26A" | cat - ~/.config/hatari/hatari.prn > temp
   gpcl6 -o out.bmp -LPCL -sPAPERSIZE=a4 -sDEVICE=bmpmono -r300 temp
   lpr -o media=a4 out.bmp
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2372
Joined: Sun Aug 03, 2014 5:54 pm

Re: new release of TTF-GDOS

Post by ThorstenOtto »

trevorbl wrote: Fri Oct 08, 2021 10:17 am I wonder, does the nVDI driver issue a set page size command? Could that explain why nVDI worked successfully?
NVDI has a v_page_size() function. But normally, i think you don't need to use that. Instead, you can specify the pagesize in workin[11] of the v_opnwk() function. But maybe FontGDOS drivers do not support that?
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

ThorstenOtto wrote: Fri Oct 08, 2021 10:28 am you can specify the pagesize in workin[11] of the v_opnwk() function. But maybe FontGDOS drivers do not support that?
I think what is happening, is the fontgdos drivers assume that if the driver is configured for A4, then your printer is too. So they do not need to send the page size command.

My setup is fontgdos driver -> hatari -> pcl commands -> ghostpcl -> bitmap file -> lpr -> printer.
The driver and printer are both configured for a4, but ghostpcl and lpr both need to be told that the bitmap is an a4 bitmap.

ghostpcl has an -sDevice=a4 option, but that didn't help me. Also, the linux printing system (CUPS) is set for a4 printing, but that that didn't help either.

The fontGDOS drivers do support page size in v_opnwk(), but I suspect that sets the size of the image. Then the driver emits a formfeed when that image is sent. Again here both ghostpcl and lpr won't know the size of the bitmap.
Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: new release of TTF-GDOS

Post by Faucon2001 »

trevorbl wrote: Fri Oct 08, 2021 10:17 am

Code: Select all

   echo -n -e "\e&l26A" | cat - ~/.config/hatari/hatari.prn > temp
   gpcl6 -o out.bmp -LPCL -sPAPERSIZE=a4 -sDEVICE=bmpmono -r300 temp
   lpr -o media=a4 out.bmp
In fact you don't need to use the bmp format, you can do it directly in pdf :

Code: Select all

   echo -n -e "\e&l26A" | cat - ~/.config/hatari/hatari.prn > temp
   pcl6 -sOutputFile=printout.pdf -sDEVICE=pdfwrite -dNOPAUSE temp
I viewed the PCL file and it's in A4 format after your first line. What does this code do ?
Philippe

Firebee, Falcon CT60, STE, BeeKey, BeePi.
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

Faucon2001 wrote: Sun Oct 10, 2021 6:33 pm In fact you don't need to use the bmp format, you can do it directly in pdf :

Code: Select all

   echo -n -e "\e&l26A" | cat - ~/.config/hatari/hatari.prn > temp
   pcl6 -sOutputFile=printout.pdf -sDEVICE=pdfwrite -dNOPAUSE temp
That's a neat trick, I'll do that.

I viewed the PCL file and it's in A4 format after your first line. What does this code do ?

Code: Select all

ESC&l26A
is the pcl code to set page size to a4.
echo -n -e "\e&l26A" sends that code to stdut, -e means \e is escape, -n means don't output a cr.

Code: Select all

cat - file
means concatenate stdin and the file, ie put the escape sequence in front of the file.

So ghostpcl sees a pagesize=a4 command at the beginning of the input file.

There is a -sPAPERSIZE=a4 command line option, but that seems to be ignored.
Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: new release of TTF-GDOS

Post by Faucon2001 »

The escape code works only with FontGDOS drivers, not with the legacy GDOS drivers like the one from TimeWorks. That's not an issue with TTF GDOS as there is the same behaviour with GDOS, so I guess it's an issue with the driver itself.
Atari seems to have discovered the A4 format only end of the 80s ;-)
One major issue of fontGDOS drivers is that when you print a document with several pages, they are all printed over the same page. I don't think that's an issue with GhostPCL conversion as the PCL file itself is like that. So, or it is an issue with time works (and other soft I have tested, Kandinsky for example) or it is an issue with FontGDOS driver. So for now I am stuck with legacy HP LaserJet driver and a letter format.

An issue, this time with TTF GDOS, is that accents are not recognised. With GDOS accents and dead keys are fully recognised, but with TTF GDOS none. Is it a limitation of TTF GDOS or of the TTF font itself?

So far, excepted this limitations,TTF GDOS has been working great with various GDOS apps, like Timeworks 1 and 2, Gem draw, Gem Paint, WordFlair, microsoft write, Word Up and LDWPower (with metafile fonts !), as far as the language and format are English.
It's fun to revive these old softwares. Do you know other GDOS apps?
Philippe

Firebee, Falcon CT60, STE, BeeKey, BeePi.
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

Faucon2001 wrote: Tue Oct 12, 2021 9:44 am One major issue of fontGDOS drivers is that when you print a document with several pages, they are all printed over the same page. I don't think that's an issue with GhostPCL conversion as the PCL file itself is like that. So, or it is an issue with time works (and other soft I have tested, Kandinsky for example) or it is an issue with FontGDOS driver. So for now I am stuck with legacy HP LaserJet driver and a letter format.
try adding %d to the name of your output file, for example:

Code: Select all

gpcl6 -r300 -o out%d.bmp -LPCL -sPAPERSIZE=a4 -sDEVICE=bmpmono file
This puts page 1 in out1.bmp, page 2 goes to out2.bmp, etc. I haven't tried with pdf's yet, but it should work.
An issue, this time with TTF GDOS, is that accents are not recognised. With GDOS accents and dead keys are fully recognised, but with TTF GDOS none. Is it a limitation of TTF GDOS or of the TTF font itself?
It's a limitation of ttf-gdos, i'm afraid. They are compound characters, and were not well described in the ttf spec at the time. Maybe in the future I will revisit this.
So far, excepted this limitations,TTF GDOS has been working great with various GDOS apps, like Timeworks 1 and 2, Gem draw, Gem Paint, WordFlair, microsoft write, Word Up and LDWPower (with metafile fonts !), as far as the language and format are English.
It's fun to revive these old softwares. Do you know other GDOS apps?
Pleased to hear that it's working well.
Other apps? I've used these: EasyDraw, Atari works, K-Spread, and CAB browser (used by the fast club catalog).
Thanks for your feedback, it's very valuable.
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

minor update to ttf-gdos 2.3b

Changes are as follows ...

ttf2gem:
- point size in filename was incorrect when making intel format fonts
- updated freetype version. Previous version sometimes misplaced pixels. New version fixes this.

Some utilities updated

P.S.
ttf-gdos now works with emutos since version emutos-512k-20211019-015317-99c493ec
Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Sat Oct 26, 2013 11:19 pm
Location: France
Contact:

Re: new release of TTF-GDOS

Post by Faucon2001 »

Epilogue of this thread, in the end I have been able to configure ghost PCL to print A4 pdf files from GDOS PCL printer output.
Ghost PCL assumes letter format as default size and didn't recognize the esc code for paper size.
-sPAPERSIZE=a4 works only with ghost script, not with ghost PCL.

You need to specify the paper size in pixel for a given dpi :

Code: Select all

gpcl6 -sOutputFile=printout.pdf -r300 -g2480x3508 -sDEVICE=pdfwrite -dNOPAUSE printout.pcl
Philippe

Firebee, Falcon CT60, STE, BeeKey, BeePi.
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/beebox68k/
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

This is very interesting, I'll try this out.

An alternative is to prepend the pcl file with the set page size = a4 escape code

Code: Select all

 esc & l 26 A 
This means that ghostpcl does include the logic for the a4 page size, it's just not connected to the command line option.

I used a .bmp file, and as an added non-bonus, the image was still offset on the page, so I needed to shift the image up a little with

Code: Select all

 esc & l -430Z 
Finally, I needed to set the page margins to zero in the lpr command:

Code: Select all

lpr -o quality=3 \
               -o media=a4 \
               -o natural-scaling=100 \
               -o position=centre \
               -o page-right=0 \
               -o page-left=0 \
               -o page-top=0 \
               -o page-bottom=0 \
               out1.bmp
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

I have now released a minor upgrade of ttf-gdos here: https://sourceforge.net/projects/ttf-gdos/
  • added a selection of free/libre fonts
  • 3 minor bug fixes
  • info on selecting font id numbers
  • documents now include hints on editing font files to reduce their size
Here's the full list of changes:
fonts:
- now includes a selection of free/libre fonts
+ these font files are reduced in size to make them suitable for standard Atari ST machines
- documentation now includes sections on:
+ choosing font id (as per GST recommendation)
+ fixing fonts that are too large or are missing required character maps

ttf-gdos:
- fixed bug that incorrectly displayed font style name
- recognise fonts with ttf family symbolic id
- new rename.sh, a linux shell script to rename true type fonts

ttf2gem
- now compiled with 32 bit ints.
Generating large printer fonts caused an overflow for short ints.
- added ttconv. This is a command line ttf to gem font converter, useful
for mass converting fonts with a shell script.
Compiles for Atari and for linux (possible others as well)

freetype
- now patched to fix a rare calculation overflow bug

trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

Faucon2001 wrote: Fri Nov 11, 2022 11:10 am Epilogue of this thread, in the end I have been able to configure ghost PCL to print A4 pdf files from GDOS PCL printer output.
Ghost PCL assumes letter format as default size and didn't recognize the esc code for paper size.
-sPAPERSIZE=a4 works only with ghost script, not with ghost PCL.

You need to specify the paper size in pixel for a given dpi :

Code: Select all

gpcl6 -sOutputFile=printout.pdf -r300 -g2480x3508 -sDEVICE=pdfwrite -dNOPAUSE printout.pcl
This works for me as well.
Also I tried a page at 150 dpi, that worked correctly with exactly the same command line - so the -r & -g options correct each other.

Been looking at the PCL code, AFAICS -g is the only option recognised for changing the page size.

The default page size is set up in file

Code: Select all

pl/pjparse.c
If you're comfortable editing and compiling, search for

Code: Select all

 {"paper", "letter"}
change this to

Code: Select all

{"paper", "a4"}
then rebuild and install. Just tested this & it seems to work.

Have raised a bug report -> https://bugs.ghostscript.com/show_bug.cgi?id=706207

Let's see what happens.
trevorbl
Atariator
Atariator
Posts: 27
Joined: Fri Sep 17, 2021 10:05 am

Re: new release of TTF-GDOS

Post by trevorbl »

Response from the pcl team:

This should work:

gpcl6.exe -J"@PJL SET PAPER=A4" -sOutputFile=out.pdf -r300 -sDEVICE=pdfwrite -dNOPAUSE a4test.pcl

But I'm out of the office and didn't test it.

PCL is not intended to be a finished product so doesn't have a configuration file. The default for "paper" is set to "letter" in the PJL source code, pcl/pl/pjparse.c. There is a C struct for PJL defaults.
I tried it and it works.

... and of course for linux, it's gplc6, not gplc6.exe.
Post Reply

Return to “News & Announcements”