SpeedoFont file viewer / simple GEM font editor

All about the serious stuff.
Post Reply
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

SpeedoFont file viewer / simple GEM font editor

Post by ThorstenOtto »

During some recent experiments with NVDI & font files, i wrote some utilities.

One is (a very simple) Editor for GEM *.fnt files. For now, you can only edit existing fonts, but there is also some support to export/import them from some propietary text file format.

Another is a viewer for SpeedoFont files.

All programs are clean GEM programs, however the SpeedoFont file viewer might need some reasonable high resolution to be usable. A modified version of it is also running as a web service.

Sources, and binaries for a font file viewer for windows&linux, are available as gemfedit-1.0.2-src.zip.

I you find any problems, or wrong mappings in the font files, please let me know.

Have fun,
Thorsten
Last edited by ThorstenOtto on Mon Jul 23, 2018 11:42 pm, edited 2 times in total.
User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2549
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece

Re: SpeedoFont file viewer / simple GEM font editor

Post by christos »

Good work on this. I just loaded it up, seems fairly straightforward. Any chance you can add a function to rearrange a font? I'd like to change the greek one to iso8859-7 and see what it does.

Edit:
Also, I had an idea, if I used the txt export and changed the hex codes for the glyphs, would it rearrange them on input?
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ThorstenOtto »

christos wrote:Any chance you can add a function to rearrange a font? I'd like to change the greek one to iso8859-7 and see what it does.
The editor is mainly designed for making a few adjustments to existing fonts, like e.g. in EmuTOS when we need to change the glyphs that are used by the window gadgets. Rearranging them might be possible, but remember that the current greek font (as well as the latin2 font) has lots of glyphs that are not present in the original font.
Also, I had an idea, if I used the txt export and changed the hex codes for the glyphs, would it rearrange them on input?
Yes, that should work.
nagual
Atari Super Hero
Atari Super Hero
Posts: 526
Joined: Mon Sep 11, 2006 10:15 am
Location: Frankfurt am Main, Germany

Re: SpeedoFont file viewer / simple GEM font editor

Post by nagual »

Nice work, thank you:-)
User avatar
jfl
Atari Super Hero
Atari Super Hero
Posts: 944
Joined: Tue Jul 18, 2006 10:55 pm
Location: Liège, Belgium
Contact:

Re: SpeedoFont file viewer / simple GEM font editor

Post by jfl »

Useful stuff, Thorsten. I only tested the programs quickly on my Firebee and unfortunately spdview.prg froze it. Running it with the 68k emulator works though, and the other two programs ran fine as they are.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ThorstenOtto »

jfl wrote:I only tested the programs quickly on my Firebee and unfortunately spdview.prg froze it.
The TOS programs were all compiled using Pure-C, so that might not work.
Running it with the 68k emulator works though, and the other two programs ran fine as they are.
Maybe pure luck, they are not native CF binaries.You may want to recompile them for the FireBee.
User avatar
Neurotoxic
Captain Atari
Captain Atari
Posts: 169
Joined: Thu Apr 20, 2017 9:29 pm
Location: Bremen (Germany)

Re: SpeedoFont file viewer / simple GEM font editor

Post by Neurotoxic »

All programs just ran fine on my Milan. Thank you very much!
520 ST(M) (TOS 1.02), Falcon030 (16 MHz, 16 MB RAM, CF-Card, MiNT & MyAES), Milan040 (25 MHz, 48 MB RAM, EasyMiNT 1.90), Firebee, PowerMac G5 Late 2005 (2 x 2,3 GHz, Mac OS 10.5), iMac 4K Late 2015 (intel Core i7 4 x 3,3 GHz, Mac OS 10.11.6), IBM XT SFD (640 KB RAM, DR DOS 6.0), Compaq LTE 5300 (Pentium/133 MHz, DR-DOS 7.03), AT-PC (Cyrix 6x86L/200 MHz, Windows 98 SE/MS-DOS 6.22 & Windows 3.11)
arf
Captain Atari
Captain Atari
Posts: 319
Joined: Thu May 17, 2012 9:56 pm
Location: Germany
Contact:

Re: SpeedoFont file viewer / simple GEM font editor

Post by arf »

ThorstenOtto wrote:During some recent experiments with NVDI & font files, i wrote some utilities.

One is (a very simple) Editor for GEM *.fnt files. For now, you can only edit existing fonts, but there is also some support to export/import them from some propietary text file format.

Another is a viewer for SpeedoFont files.

All programs are clean GEM programs, however the SpeedoFont file viewer might need some reasonable high resolution to be usable. A modified version of it is also running as a web service.

Sources, and binaries for a font file viewer for windows&linux, are available as gemfedit-1.0.1-src.zip.

I you find any problems, or wrong mappings in the font files, please let me know.

Have fun,
Thorsten
Thanks for providing it! Finally a tool to quickly have a glance at fonts without “installing” ’em first.

I just tried it on TOS 2.06 with WINX 2.3n, and I’m getting "AES ERROR - Application: FONTDISP | Function ID: wind_update | END_: … underflow", when loading a new font with ^O, in front of the file selector: https://s1.hoffart.de/~goetz/Schnipsel/1515878064.png

I think it’d be cool if the font would be display enlarged and in original size (perhaps with changeable text strings) for an easier judgement. <edit> Ops, this is built in, but I didn’t notice for the first fonts I tried, because the preview at 1× showed the system font, not the loaded font.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ThorstenOtto »

arf wrote: I just tried it on TOS 2.06 with WINX 2.3n, and I’m getting "AES ERROR - Application: FONTDISP | Function ID: wind_update | END_: … underflow", when loading a new font with ^O
That seems to be caused by your file selector. I think that does not happen when using the menu instead. Should be fixed now, but that is
Ops, this is built in, but I didn’t notice for the first fonts I tried, because the preview at 1× showed the system font, not the loaded font.
Yes, the viewer shows the system font in the preview on the left side, because you can scale the loaded font down to its original size. That was done by intention, so you can easily check which characters might be missing, or changed. OTOH, the editor will display the loaded font instead.
User avatar
Eero Tamminen
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3993
Joined: Sun Jul 31, 2011 1:11 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by Eero Tamminen »

ThorstenOtto wrote:
jfl wrote:I only tested the programs quickly on my Firebee and unfortunately spdview.prg froze it.
The TOS programs were all compiled using Pure-C, so that might not work.
Running it with the 68k emulator works though, and the other two programs ran fine as they are.
Maybe pure luck, they are not native CF binaries.You may want to recompile them for the FireBee.
AHCC is Pure-C compatible and supports CF, so for CF build you would just need to add PRJ file for AHCC.

Some of my programs are built with AHCC and have PRJ files both for m68k & CF, which you can use as examples if you haven't used AHCC earlier:
http://eerott.mbnet.fi/hatari/programs.shtml
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ThorstenOtto »

Eero Tamminen wrote:AHCC is Pure-C compatible and supports CF, so for CF build you would just need to add PRJ file for AHCC.
I know, but to be honest i don't trust AHCC. When the developer thinks he can use the 16bit library when compiling for 32bit-ints by just declaring all standard functions taking short arguments instead of int, he obviously did not understand some key concepts of integer promotion. And the GUI is a real mess, with the log window popping up all the time, and that monster configuration dialog...

But you can just hack the Makefile in the tos directory to add the necessary flags for CF, and (cross)-compile it using gcc instead. The resulting binaries would of just be larger, due to the overhead of mintlib.
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ThorstenOtto »

Update: link to archive (in first post) changed to current version.

And a new function has been made available on the web: you can now also view most truetype font formats.

Gives some strange results yet with fonts that use lots of combining diacrits, but should otherwise work. But be warned: as for now, every glyph is rendered as a single image. Since truetype fonts usually contain lots of them, your browser will request a few thousands images.
User avatar
Rajah Lone
Atari Super Hero
Atari Super Hero
Posts: 591
Joined: Wed Aug 07, 2002 12:27 pm
Location: Lyon / France
Contact:

Re: SpeedoFont file viewer / simple GEM font editor

Post by Rajah Lone »

ThorstenOtto wrote: Sat Dec 30, 2017 12:58 pmAll programs are clean GEM programs
I you find any problems, or wrong mappings in the font files, please let me know
- "Can't open ../fonts/tos/system10.fnt", but it's because I extracted .prg+.rsc from the whole archive to use it in some production mode/folder.
- suggestion: c:/gemsys/ for default convenient .fnt folder

- gemfedit.prg: complety messy with redraws, on multitasking mode, moving window ontop the charset view. See snapshot (V4SA, 720p, TC32).
- fontdisp.prg: issue to see chars at bottom, if screen height is not enough.

- gemfedit adding new char seems not possible. My favorite "Verdana Bitmap" has no "°" (0xFB) and I would be happy to add it with some tool.

Don't bother. Searching for a similar tool.


IMG_9228.JPG
IMG_9229.JPG
You do not have the required permissions to view the files attached to this post.
ragnar76
Atari Super Hero
Atari Super Hero
Posts: 511
Joined: Thu Apr 07, 2011 3:01 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ragnar76 »

Any chance of an update? I've stumbled on libpng and later curl

Code: Select all

In file included from spdview.c:9:
../include/writepng.h:59:10: fatal error: libpng12/png.h: Datei oder Verzeichnis nicht gefunden
   59 | #include <libpng12/png.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:26: spdview.o] Fehler 1
make[1]: Verzeichnis „/home/ragnar/Downloads/speedo-fonts-editor/spdview“ wird verlassen
make: *** [Makefile:8: all] Fehler 2
ragnar@tower:~/Downloads/speedo-fonts-editor$ sudo su
[sudo] Passwort für ragnar:         
root@tower:/home/ragnar/Downloads/speedo-fonts-editor# apt install libpng
libpng16-16              libpng++-dev             libpng-dev               libpnglite0              libpnglite-dev           libpng-sixlegs-java      libpng-sixlegs-java-doc  libpng-tools
root@tower:/home/ragnar/Downloads/speedo-fonts-editor# apt install libpng-dev 
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut… Fertig
Statusinformationen werden eingelesen… Fertig
libpng-dev ist schon die neueste Version (1.6.39-2).
libpng-dev wurde als manuell installiert festgelegt.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
root@tower:/home/ragnar/Downloads/speedo-fonts-editor# dpkg -l | grep -e "libpng"
ii  libpng-dev:amd64                               1.6.39-2                               amd64        PNG library - development (version 1.6)
ii  libpng-tools                                   1.6.39-2                               amd64        PNG library - tools (version 1.6)
ii  libpng16-16:amd64                              1.6.39-2                               amd64        PNG library - runtime (version 1.6)
ii  libpng16-16:i386                               1.6.39-2                               i386         PNG library - runtime (version 1.6)
After linking from libpng16 to libpng12 i got this error:

Code: Select all

cgiutil.c: In function ‘curl_download’:
cgiutil.c:784:9: error: ‘CURLOPT_PROTOCOLS’ is deprecated: since 7.85.0. Use CURLOPT_PROTOCOLS_STR [-Werror=deprecated-declarations]
  784 |         curl_easy_setopt(curl, CURLOPT_PROTOCOLS, ALLOWED_PROTOS);
      |         ^~~~~~~~~~~~~~~~
In file included from cgiutil.h:1,
                 from cgiutil.c:7:
/usr/include/x86_64-linux-gnu/curl/curl.h:1749:3: note: declared here
 1749 |   CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
      |   ^~~~~~~~~~~~~~~~~
cgiutil.c:813:9: error: ‘CURLINFO_SIZE_DOWNLOAD’ is deprecated: since 7.55.0. Use CURLINFO_SIZE_DOWNLOAD_T [-Werror=deprecated-declarations]
  813 |         curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD, &size);
      |         ^~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/curl/curl.h:2841:3: note: declared here
 2841 |   CURLINFO_SIZE_DOWNLOAD
      |   ^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [<eingebaut>: cgiutil.o] Fehler 1
make[1]: Verzeichnis „/home/ragnar/Downloads/speedo-fonts-editor/spdview“ wird verlassen
make: *** [Makefile:8: all] Fehler 2
• FireBee • Falcon030/040/060 • MiSTer • TT • (Mega)STe • Suska III-B • Suska III-C • (Mega)ST •
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ThorstenOtto »

Should already be fixed in the repo. Please update your local repo and try again.
ragnar76
Atari Super Hero
Atari Super Hero
Posts: 511
Joined: Thu Apr 07, 2011 3:01 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ragnar76 »

ThorstenOtto wrote: Mon Dec 30, 2024 6:01 am Should already be fixed in the repo. Please update your local repo and try again.
i didn't know there was a repo, i used the zip file from above
• FireBee • Falcon030/040/060 • MiSTer • TT • (Mega)STe • Suska III-B • Suska III-C • (Mega)ST •
ThorstenOtto
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3413
Joined: Sun Aug 03, 2014 5:54 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ThorstenOtto »

I didn't make a new release yet, so there is no new source archive. The repo is available at https://github.com/th-otto/gemfedit/. Unfortunately the source archive is too large to attach it here, so if you can't use the repo, let me know, then i'll make an intermediate archive available for download.
ragnar76
Atari Super Hero
Atari Super Hero
Posts: 511
Joined: Thu Apr 07, 2011 3:01 pm

Re: SpeedoFont file viewer / simple GEM font editor

Post by ragnar76 »

ThorstenOtto wrote: Mon Dec 30, 2024 8:04 am I didn't make a new release yet, so there is no new source archive. The repo is available at https://github.com/th-otto/gemfedit/. Unfortunately the source archive is too large to attach it here, so if you can't use the repo, let me know, then i'll make an intermediate archive available for download.
Works, until m68k-atari-mint-gcc comes to play which is not installed yet. Will do it this evening
• FireBee • Falcon030/040/060 • MiSTer • TT • (Mega)STe • Suska III-B • Suska III-C • (Mega)ST •
Post Reply

Return to “Applications”