-   Slackware (
-   -   Using the program "bitmap" (

waddles 10-16-2013 07:53 PM

Using the program "bitmap"
I am trying to develop a set of printable/echoable characters for a very simple game. The game is to be composed from these characters so I was led to think that this should be bitmapped characters. I found the bitmap program for Slackware and created a character which seems to be height number of rows and width number of 0s & 1s, which reflect the image I created. I thought there would thus be another program to print these but alas I find none. On reading profusely from the web it appears the font file I created lacks a control file and from that reading I gather that the method would be to use that font file (SOMEHOW??) and just grab a character (SOMEHOW??) and echo it. Before dumping my efforts I would like to know if anyone has used this bitmap program? If so how should I be using it ?? I am completely blind on this and advanced degrees seem to be no help.

KenJackson 10-17-2013 12:15 AM

I don't know about "bitmap", but if I understand what you're doing, I would create XPM files by hand with a text editor and convert them to graphics files with ImageMagick's convert command or with GraphicMagic's gm convert command.

As an example, here's redblack.xpm, a very simple XPM file I created by hand for a website. (It's a text file that can be displayed as either text or directly as graphics, but browsers don't seem to know what to do with them.)

55020 10-17-2013 04:54 AM

If I understand what you want to do, the 'bitmap' program from the Slackware 'bitmap' package isn't relevant. It's a really old, really crude tool for creating X cursors and stuff.

You need to work out what your first "SOMEHOW??" actually is. Everything else flows from that.

If you're writing a text-console-mode game, the first "SOMEHOW??" is the setfont command, and the second "SOMEHOW??" is just to write the right ascii character in the right position like you would have done on a VT100. Therefore you want to create a Linux text-console font.

See these pages:
and the man pages for the relevant commands in Slackware's kbd package: setfont, psfaddtable, etc

UPDATE! UPDATE! UPDATE! (smacks own head)

The dear old VT220 [and therefore, everything that came after it] had the native capability of receiving soft-downloaded graphics characters! Of course! And then you selected and displayed them just like the line-drawing character set that you may already be familiar with. I saw Space Invaders done this way on a text vdu in 1980 :)

I doubt the Linux text console supports enough VT220 emulation to do this, but xterm might well support it. And it may or may not be more difficult than creating a psf font for Linux. But it's another option.

waddles 01-03-2014 04:55 AM

I hope not to be chastised for this long delay as my attention was diverted.
@55020: I hope I have this correct as follow from your initial suggestion:
In /usr/share/consolefonts (is /usr/share/kbd/consolefonts), creates a font of the PSF type (PC Screen Font)
Only psf1 is supported (maximum character width is 8 pixels) so
A) java -jar psfedit.jar (a psf editor)*
or psftools-1.0.7.tar.gz (your 2nd reference)
to create the font.

Finally use:
B) setfont myfont.psf
to put font into /usr/share/kbd/consolefonts.

Each character then is a glyph.

*NOTE: JAVA can have difficulties loading 8bit PNG images when converting to a bitmap.

I am not sure how PNG got involved? Is it the output of the font editor.

The info I have from other reading for installing a font is:
move new fonts (*.ttf) to: "/usr/share/fonts/TTF"

Run these commands in: "/usr/share/fonts"
bash-4.1# mkfontscale
bash-4.1# mkfontdir
bash-4.1# fc-cache -f -v
I am not familiar with setfont so can you clarify my confusion?
My thinking is there are the 2 directories. One for console/terminal ouput and apparently the other for printer fonts.

All times are GMT -5. The time now is 01:39 AM.