WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Busybox SETFONT app for console  (Read 6670 times)

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Busybox SETFONT app for console
« on: July 12, 2019, 05:32:47 AM »
Before I request that the busybox SETFONT application be added to TinyCore, I'm testing the following project..

Objective: my *console* fonts are butt-ugly, no matter what size I configure them to.  So I want to use the Terminus console fonts in the console for say virtual terminals, or in micro-core.

This is not about X, where I am already happily running Terminus fonts.

Tools gathered:
1) Since the SETFONT application is not part of TinyCore, I downloaded the latest binary for it from the official Busybox site.

2) I am successfully using Terminus console fonts in Porteus, so I grabbed the console fonts I used from it (from a slackware package actually) - just to make sure that I didn't blow it with some error in my own compilation attempts from the official Terminus fonts site.

When running the following, I get an error (as a normal user or as root)

Code: [Select]
setfont ./ter-132n.pcf.gz
Here is the error:

Code: [Select]
setfont: input file : Bad length or unsupported font type
I get this same error when ungzipping the font as just an uncompressed pcf file.

I'm pretty sure that pcf is a supported font type with Tinycore.  Or is there some sort of terminal configuration in the kernel itself, like terminal=linux or something that is the blocker?

I don't know since I'm not a kernel hacker..

To be able to run Terminus console fonts with Tinycore (remember my terminus fonts in X are doing fine) would just rock my world since I consider my standard fonts in the console, no matter how I configure them for size, are too ugly for comfort.

Any tips appreciated....

« Last Edit: July 12, 2019, 05:40:14 AM by PDP-8 »
That's a UNIX book! - cool  -- Garth

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Busybox SETFONT app for console
« Reply #1 on: July 12, 2019, 07:00:32 AM »
This is not looking good me - perusing an arch bug report from 10 years ago about patches to busybox's setfont...

https://bugs.archlinux.org/task/19109

It may not be valid these days, but unless someone else has Terminus console fonts running in TinyCore, I'm throwing in the towel  *right now*  :)
That's a UNIX book! - cool  -- Garth

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11643
Re: Busybox SETFONT app for console
« Reply #2 on: July 12, 2019, 08:20:38 AM »
Hi PDP-8
There is a  setfont.tcz  extension in the repository.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Busybox SETFONT app for console
« Reply #3 on: July 12, 2019, 03:35:48 PM »
Thanks Rich!

That will save me a lot of headache trying to get the busybox version to work.  Heh, would be nice if it did.  Wonder when setfont.tcz was built and if setfont has been fixed in busybox since..

I'll make the request for a 64-bit version since I don't see it on any of the repo's..
That's a UNIX book! - cool  -- Garth

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11047
Re: Busybox SETFONT app for console
« Reply #4 on: July 13, 2019, 05:37:46 AM »
pcf is an X font. Console fonts are .psf or .psfu.
The only barriers that can stop you are the ones you create yourself.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Busybox SETFONT app for console
« Reply #5 on: July 13, 2019, 08:53:05 PM »
Roger that!  Jaunito got the 64-bit version up and running nicely, but wanted to thank you for the original 32 compilation.

I tested out the 64-bit version, and it works great!  And simple, even though I have been to the wiki...

I simply perused the

Code: [Select]
/usr/local/share/consolefonts
directory, and for my high native-res monitor and grandpa type eyes:

Code: [Select]
setfont sun12x22
OHHH  so much better!

Here's what's really promising - spurred by success, I tried the latest busybox binary of setfont to load it - and it DID!

Code: [Select]
busybox_SETFONT /usr/local/share/consolefonts/sun12x22.psfu.gz
TADA!  So that looks promising that *maybe* the busybox version is getting it's act together.

Later when I have time, of course I'm going to see what's up with terminus console fonts (psfu types) and why I can't bring them up with either your setfont, or either the busbox version.

Still, this makes micro-core oh so much more beautiful and a pleasure to use...

That's a UNIX book! - cool  -- Garth

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Busybox SETFONT app for console
« Reply #6 on: July 14, 2019, 08:35:53 PM »
FOUND THE PERFECT COMBO!

Ok, using either the setfont provided in the tcz package, OR the latest busybox setfont applet, works just great with psfu fonts without a lot of hassle.

So I found some more from our Slackware friends in sizes applicable to very large resolution monitors !!

https://slackware.pkgs.org/14.2/slackonly-i486/ttf-console-fonts-20170403_abc5771-noarch-1_slonly.txz.html

Kind misleading as these are adaptations of TTF fonts converted for use in the console - and with some sizes that I need.  They include

dejavusansmono-11x19.psfu.gz
dejavusansmono-13x23.psfu.gz
dejavusansmono-15x30.psfu.gz
dejavusansmono-8x12.psfu.gz

liberationmono-regular-10x19.psfu.gz
liberationmono-regular-13x23.psfu.gz
liberationmono-regular-15.28.psfu.gz
liberationmono-regular-8x12.psfu.gz

Do columns, top and so forth line up ok?  Yes.

THANK YOU CURAGA and JUANITO for getting me off the ground with this.

Virtual terminals and micro-core now absolutely ROCK MY WORLD.

That's a UNIX book! - cool  -- Garth

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Busybox SETFONT app for console
« Reply #7 on: July 15, 2019, 02:20:30 AM »
How did I extract and install the fonts from the Slackware package?

I'ts just an xz format, and Busybox tar can handle it.  I'll break it out from within my home /home/tc directory , grab the files and move them, and delete the slackware package structure.

From /home/tc

Code: [Select]
tar -Jxvf ttf-console-fonts-20170403_abc5771-noarch-1_slonly.txz
That's a capital J.

The psfju fonts we want are broken out into this subdirectory:

/home/tc/usr/share/kbd/consolefonts

Move these new dejavu and liberation console fonts into a directory that suits you for recall later.

Remove the package material:

***** WARNING *****
DO NOT BLINDLY FOLLOW RM COMMANDS ON THE NET UNLESS YOU KNOW
*******************


From within your /home/tc directory (IMPORTANT, STUDY CAREFULLY)
Code: [Select]
rm -rf usr
Obviously one DOES NOT want to rm the normal /usr filesystem.  Just the one inside /home/tc/usr that breaking out this package does if you untar it from within your home directory.

For now, until I find what best suits me, I just call the fonts up manually for testing from within my home directory

Code: [Select]
setfont ./dejavusansmono-15x30.psfu.gz
This is not meant to be a comprehensive guide, but a quick proof-of-concept that works for me.

« Last Edit: July 15, 2019, 03:05:47 AM by curaga »
That's a UNIX book! - cool  -- Garth

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11047
Re: Busybox SETFONT app for console
« Reply #8 on: July 15, 2019, 03:06:06 AM »
There was an extra slash at the beginning of usr in your post. I've edited it away.
The only barriers that can stop you are the ones you create yourself.

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Busybox SETFONT app for console
« Reply #9 on: July 15, 2019, 04:41:31 AM »
Thanks!  I'm just tiptoeing around usr since fat-fingering that one wouldn't be good if one was root...

There's also the official homepage for it:

http://urchlay.naptime.net/repos/ttf-console-fonts/about/

Which gives more info on what they are about, how to build etc etc.  The license is, um, interesting.


That's a UNIX book! - cool  -- Garth

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Busybox SETFONT app for console
« Reply #10 on: July 02, 2020, 09:06:31 PM »
So now that enough time has passed, I'm able to very simply grab consolefonts from other distros, and use the setfont utility in my own busybox itself, rather than rely on an external tcz.

Anyone having issues with the latest Busybox "setfont" utility?  I know the external tcz works, but so far, I've had no issues with BB's version these days with console fonts compiled on machines newer than 1998. :)

So count me in on requesting BB's own setfont utility be compiled in these days.  Unless I'm missing something critical....



That's a UNIX book! - cool  -- Garth

Offline PDP-8

  • Hero Member
  • *****
  • Posts: 915
Re: Busybox SETFONT app for console
« Reply #11 on: July 03, 2020, 09:38:18 PM »
SOLVED!!!  It's all about the gzip.

Simply don't worry about the loss of setfont at all.  Use LOADFONT instead, although it will cost you a little bit of ram.  Most likely you'll be dealing with a small handful of font sizes anyway, and not the whole collection of say the entire Terminus fonts for example.

Basically if you are using the typical consolefonts grabbed from somewhere else in their /usr/share/consolefonts (or wherever you find them) directly, and have the compressed .psf.gz extension:

Move them to your TC box.  Simply gunzip the font you want.  Now it's just a simple <font>.psf

Redirect it into loadfont

Code: [Select]
loadfont < Terminus-20x12-rocks.psf
tada.  Put that into a shell-script or other tool of your making to get some nice fonts using only the supplied busybox.

All this time man - like discovering a diamond. :)

That's a UNIX book! - cool  -- Garth