Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:35 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : bdf2fnt - Convert bdf/X11 fonts

Author Message
mbramwel

Regular Member

Joined: 10/07/2013
Location: Canada
Posts: 42
Posted: 09:39am 26 Jul 2013
Copy link to clipboard 
Print this post

bdf2fnt - X11/BDF Font Converter for Maximite/mmbasic
by Mark Bramwell, July 2013

website: http://www.foxhollow.ca/maximite

The purpose of this script is to read a BDF formatted
font file and create a new font file that is usable by
the Maximite SBC running mmbasic

To use this script, you must have php running on your computer.
This script was tested on Ubuntu Linux.

Usage: ./bdf2fnt fontname.bdf
Example: ./bdf2fnt 8x14.fnt

4 files will be created

fontname-symbols.txt -- Not usable by mmbasic.
It is for humans to see ALL available symbols in a font

fontname.fnt -- mmbasic loadable font containing symbols 32-126
fontname-p2.fnt -- mmbasic loadable font containing symbols 160-254
fontname-p3.fnt -- mmbasic loadable font containing symbols 1-32 & 128-159

Refer to the mmbasic programmers manual on how to use loadable fonts.

Note: The php script must have *execute* permission
To set the perms, type: chmod 755 bdf2fnt

A second zip file named "sample-fonts.zip" is available at the website
Included is a Windows program named bdfviewer (not written by me) that
allows you to browse/view the font on your PC. This is useful when a
font has a large number of symbols and you want to verify if a particular
glyph is included.

As an example, dice.fnt was created by using bdfviewer to find the dice
symbols in the unicode font (over 5000 symbols) and then I copy/pasted
just those 6 glyphs from the bdf2fnt generated symbols into a new file.
 
mbramwel

Regular Member

Joined: 10/07/2013
Location: Canada
Posts: 42
Posted: 09:44am 26 Jul 2013
Copy link to clipboard 
Print this post

Included in the ZIP files is fontdemo.bas
It simply displays the contents of the font on the screen.
Makes it easy to view what is available.

Here is the fontdemo.bas

Cls
myFont$ = "8x16-2.fnt"
Print "FONT Listing for ";myFont$

Font Load myFont$ As #5

For x=32 To 126
If (x Mod 8) = 0 Then Print:Print
Font #1
Print x;":";
Font #5
Print Chr$(x);
Font #1
Print " ";
If x<100 Then Print " ";
Next x

Print:Print:Print
a$ = "Now is the time for all good men to come to the aid of the party."
Font #1
Print a$
Font #5
Print a$
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024