Tiny Core Linux

General TC => General TC Talk => Topic started by: PDP-8 on July 12, 2019, 02:32:47 AM

Title: Busybox SETFONT app for console
Post by: PDP-8 on July 12, 2019, 02: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....

Title: Re: Busybox SETFONT app for console
Post by: PDP-8 on July 12, 2019, 04:00:32 AM
This is not looking good me - perusing an arch bug report from 10 years ago about patches to busybox's setfont...


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*  :)
Title: Re: Busybox SETFONT app for console
Post by: Rich on July 12, 2019, 05:20:38 AM
Hi PDP-8
There is a  setfont.tcz  extension in the repository.
Title: Re: Busybox SETFONT app for console
Post by: PDP-8 on July 12, 2019, 12: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..
Title: Re: Busybox SETFONT app for console
Post by: curaga on July 13, 2019, 02:37:46 AM
pcf is an X font. Console fonts are .psf or .psfu.
Title: Re: Busybox SETFONT app for console
Post by: PDP-8 on July 13, 2019, 05: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]
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...

Title: Re: Busybox SETFONT app for console
Post by: PDP-8 on July 14, 2019, 05:35:53 PM

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 !!


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



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.

Title: Re: Busybox SETFONT app for console
Post by: PDP-8 on July 14, 2019, 11:20:30 PM
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:


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

Remove the package material:

***** WARNING *****

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.

Title: Re: Busybox SETFONT app for console
Post by: curaga on July 15, 2019, 12:06:06 AM
There was an extra slash at the beginning of usr in your post. I've edited it away.
Title: Re: Busybox SETFONT app for console
Post by: PDP-8 on July 15, 2019, 01: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:


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

Title: Re: Busybox SETFONT app for console
Post by: PDP-8 on July 02, 2020, 06: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....

Title: Re: Busybox SETFONT app for console
Post by: PDP-8 on July 03, 2020, 06: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. :)