FOMI - Font Migrator

Data Formats

Beschreibung
Kurzanleitung
Daten Formate
Download/Preise

Fujitsu Graphic Controller "Jasmine"
The letters for Fujitsu Graphic Controllers are saved in ANSI C data structures. Of course generated structures may be implemented for other targets too.

Include font structures to be used in a font look up table array for easy font access. Text drawing function gets letter by letter from the data structure. Consider that the letter width is dynamic in proportional fonts.

            
/*****************************************************************************
font look up table array
*/          
const void* FontLUT[] = {
 &sVerdana20,
 &sVerdana20_VU,
 &sVerdana20_VD
};
            
/*****************************************************************************
draw a single char using the specified font
*/          
void DrawFontChar(uchar cLayer, int x, int y, uchar d, uchar cFont, long color)
{
  uchar cYSize, cXSize;                                // temps for char data
  const struct FONT *pFont;                            // used to store ptr to font 
  const struct FONT_INTERVALINFO *pIntInfo;            // used to store ptr to interval info
  const struct FONT_CHARINFO *pCharInfo;               // used to store ptr to character data

  pFont = FontLUT[cFont];                              // get ptr to font from FontLUT
  pIntInfo = pFont->pInfo;                             // get ptr to first interval info

  while(d < pIntInfo->cFirst || d > pIntInfo->cLast) { // check interval for character
    pIntInfo = pIntInfo->pNextInfo;                    // get ptr to next interval info
    if(pIntInfo == 0) return;                          // character not available
  }
  pCharInfo = pIntInfo->pChar+(d-pIntInfo->cFirst);    // load ptr to current char - add offset
  cXSize = pCharInfo->cXSize;                          // get X size of the char from charinfo
  cYSize = pFont->cYSize;                              // get Y size of the font from fontinfo

  GDC_CMD_TxBM(x, x+cXSize-1, y-cYSize+1, y, color, 0, 0, 0, 0, cLayer); // command for PP
  GDC_FIFO_INP((ulong *)pCharInfo->pCharData, pCharInfo->cLongsPerChar); // data of bmp to FIFO
  GDC_CMD_NOP();
}
            

            
          


Binary Font File
The letters in the Binary Font file are saved in bitmap data streams. (Big-Endian-First-Byte-Order).

Position Size Data Type Description
0 2 Bytes Char Constant used to identify the file format:0x42 0x46 (Hex code for B and F)
2 4 Bytes DWord Size of the file in bytes
6 2 Bytes Word Number of vectors in the vector table
8 2 Bytes Word Vertical char size in pixel
10 2 Bytes - Reserved
12 2 Bytes - Reserved
14 2 Bytes - Reserved
16 N Bytes Stream Vector table
A two byte vector points to each char data stream. For ordinal index with no char data stream the vector points to the first valid char data stream.
16 +N X Bytes Stream Char data streams
Each char data stream begins with one byte for char width. The data stream starts scanning from top left and saves pixel by pixel in data words. Remaining places are filled up with 0.
Size -4 4 Bytes DWord Checksum over the whole file: Checksum = Σ(0..n)