next up previous contents index
Next: Subscripts and fonts: Embedded Up: Text Previous: Special characters   Contents   Index

Creating new fonts

To create a new font for tnimage, do the following:

  1. Using your favorite word processor, create a text file containing the desired characters. Make sure the characters are far enough apart so they don't touch each other.
  2. Convert the text file to TIFF or some other image format. This can be done by displaying the text file and capturing a screen image with xwd or tnimage, or by creating a PDF or PostScript file and converting it to an image format. For example, here is the script I use to convert .dvi files from LaTeX to PDF format:

       dvips -Pamz -Pcmz -o $1.ps $1.dvi
       ps2pdf -dMaxSubsetPct=100 -dCompatibilityLevel=1.2  \
           -dSubsetFonts=true -dEmbedAllFonts=true \
           -dAutoFilterColorImages=false -dAutoFilterGrayImages=false \
           -dColorImageFilter=/FlateEncode -dGrayImageFilter=/FlateEncode \
           -dModoImageFilter=/FlateEncode  $1.ps
    

    Alternatively, you could use ps2gif to create a .GIF file.

  3. Use tnimage to convert the font image file to 8 bits/pixel and grayscale.
  4. If any symbols in the font image are touching each other, separate them using the "sketch" function in tnimage to place pixels with a value of 255 (white) between them. All symbols must be completely surrounded by white pixels.
    1. Click on the font image.
    2. Use "About the image" to make sure it is 8-bit grayscale. If not, change it to grayscale first, then change the image depth to 1 byte/pixel (=8 bits/pixel).
    3. Check the color of the background between the symbols. If it is less than 255, increase the contrast so the background is uniformly 255.
    4. Click on the font image and set the foreground (drawing) color to 255.
    5. Open the floating magnifier.
    6. Move to the point that needs to be fixed, and press F2 to go into sketch mode.
    7. Use the arrow keys to set pixels to 255 between the overlapping symbols.
  5. If any of the symbols consist of two or more parts, connect the two parts together by adding pixels of a value of 253 or less between the parts, using the procedure described above.
  6. Save the font image file in /.tnimage or wherever convenient.

The font image file acts as a menu from which any number of symbols can be selected.


next up previous contents index
Next: Subscripts and fonts: Embedded Up: Text Previous: Special characters   Contents   Index
root 2006-11-13