[Previous] [Contents] [Index] [Next]

bdf_2_phf

Convert BDF fonts to Photon fonts

Syntax:

bdf_2_phf [-A offset] [-E end_character] [-N num_chars]
          [-O output_file] [-o output_path] [-S start_character]
          bdf_file

Options:

-A offset
Offset character encodings.
-E end_character
Set ending character code.
-N num_chars
The maximum number of characters to convert.
-O output_file
Write the converted file to output_file. Overrides the -o option.
-o output_path
Write the converted file to output_path.
-S start_character
Set starting character code.
bdf_file
Name of the BDF file to convert.

Description:

The bdf_2_phf utility converts BDF font files into Photon font files.

The size of a .phf bitmap font file is limited to 64K because of the 16-bit offset used for indexing characters within the font file. So if your resultant .phf file is greater than 64K (for example, when you use Asain fonts), you'll have to create a .phf family. A .phf family is a collection of several individual .phf files. For information on creating .phf families, see "Creating a .phf family" in the Examples section below.

Examples:

Convert all the BDF Courier font files in the /font/bdf directory to Photon font files in the /home/fred/font directory:

bdf_2_phf -o /home/fred/font /font/bdf/cour*.bdf

Creating a .phf family

The following script utilizes bdf_2_phf to create a .phf family. When bdf_2_phf is invoked from the script, the size of each individual .phf file is restricted by manipulating the -S (start) and -N (amount) switches.

#!/bin/sh
# Usage: makefonts unbdf_filename
#
# If you change the size, you'll probably have to modify
# the ranges to keep the files below 64k apiece.

SIZE=16
BDF_FILE=uk16cM.bdf
CMD_BDF2PHF=/usr/photon/bin/bdf_2_phf

$CMD_BDF2PHF  -S0x20    -N0x1Fe0  -Ouk00-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x2000  -N0xC00   -Ouk20-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x3000  -N0x1000  -Ouk30-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x4000  -N0x1600  -Ouk40-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x5600  -N0x400   -Ouk56-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x5a00  -N0x400   -Ouk5A-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x5e00  -N0x500   -Ouk5E-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x6300  -N0x500   -Ouk63-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x6800  -N0x700   -Ouk68-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x6F00  -N0x500   -Ouk6F-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x7400  -N0x500   -Ouk74-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x7900  -N0x500   -Ouk79-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x7E00  -N0x500   -Ouk7E-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x8300  -N0x500   -Ouk83-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x8800  -N0x600   -Ouk88-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x8E00  -N0x600   -Ouk8E-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x9400  -N0x500   -Ouk94-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0x9900  -N0xA00   -Ouk99-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xa300  -N0xA00   -OukA3-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xad00  -N0x500   -OukAD-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xb200  -N0x500   -OukB2-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xb700  -N0x500   -OukB7-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xbc00  -N0x500   -OukBC-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xc100  -N0x500   -OukC1-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xc600  -N0x500   -OukC6-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xd000  -N0x500   -OukD0-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xd500  -N0x1b00  -OukD5-$SIZE.phf $BDF_FILE
$CMD_BDF2PHF  -S0xF000  -N0xFE6   -OukF0-$SIZE.phf $BDF_FILE

After you've successfully created your .phf "family," perform the following steps to install it:

  1. Put the files in $PHOTON_PATH/font
  2. In fontcfg, install using the Fonts tab
  3. In fontcfg, install using the Extension tab.

Note: The Extension installation is necessary only if you want this font to be searched for characters not found (such as Asain/Latin fonts) in other font files.

Caveats:

This utility works only with Unicode BDF files. A .phf file can't be larger than 64K.


[Previous] [Contents] [Index] [Next]