The 8bit JControl Font Definition Format (JCFD)
-----------------------------------------------

<font>              := <header><lookuptable><fontdata>


------------
<header>            := "JCFD"<revision><size><reserved><offset><chars_num><special_chars_num>

<revision>          := 0x0002 (16bit)
<size>              := font height in pixels <=8 (16bit)
<reserved>          := 0x0000 (16bit)
<offset>            := 0x0010 (16bit)
<chars_num>         := 0x0080 (16bit) number of normal characters, this should always be 128
<special_chars_num> := number of special chars that come after 0x0080, like ,,. (16bit)

------------
The lookup table includes the width and the start index for every character in this font.

<lookuptable>       := <chars>[<special_chars>]

<chars>             := {<width><index>}+             (<chars_num> times)
<special_chars>     := {<unicode><width><index>}+    (<special_chars_num> times)

<width>             := the character width in pixels (8bit)
<index>             := the start index for the characters pixel data (16 bit)
<unicode>           := the unicode for this character (16bit)

------------

<fontdata>          := {<pixel_data>}+

<pixel_data>        := {<byte_value>}+            (<width> times)

<byte_value>        := pixels are stored in a byte, one upon the other, LSB first (8bit each)

Example : font size = 8, character width = 7
                .......
                ..XXX..
                .X...X.
                XX...XX
                XX...XX
                XXXXXXX
                XX...XX
                XX...XX


   LSB  .  .  .  .  .  .  .
        .  .  X  X  X  .  .
        .  X  .  .  .  X  .
        X  X  .  .  .  X  X
        X  X  .  .  .  X  X
        X  X  X  X  X  X  X
        X  X  .  .  .  X  X
   MSB  X  X  .  .  .  X  X

        F8 FC 22 22 22 FC F8


The pixel data for this character would be stored this way:

F8 FC 22 22 22 FC F8


****************************************************************************************





The 16bit JControl Font Definition Format (JCFD)
------------------------------------------------
******************
*** DEPRECATED ***
******************
<font>              := <header><lookuptable><fontdata>


------------
<header>            := "JCFD"<revision><size><reserved><offset><chars_num><special_chars_num>

<revision>          := 0x0001 (16bit)
<size>              := font height in pixels (16bit)
<reserved>          := 0x0000 (16bit)
<offset>            := 0x0008 (16bit)
<chars_num>         := 0x0080 (16bit) number of normal characters, this should always be 128
<special_chars_num> := number of special chars that come after 0x80, like ,,. (16bit)

------------
The lookup table includes the width and the start index for every character in this font.

<lookuptable>       := <chars>[<special_chars>]

<chars>             := {<width><index>}+             (<chars_num> times)
<special_chars>     := {<unicode><width><index>}+    (<special_chars_num> times)

<width>             := the character width in pixels (16bit)
<index>             := the start index for the characters pixel data (16 bit)
<unicode>           := the unicode for this character (16bit)

------------

<fontdata>          := {<pixel_data>}+

<pixel_data>        := {<letter_column>}+            (<width> times)
<letter_column>     := {<short_value>}+              ( if <size> is more than 16, more shorts are needed)

<short_value>       := pixels are stored in a short, one upon the other, LSB first (16bit each)

Example : font size = 20, character width = 13
        .............
	.............
	.............
	.....XXX.....
	.....X.X.....
	....XX.XX....
	....XX.XX....
	....X...X....
	...XX...XX...
	...XX...XX...
	..XX.....XX..
	..XX.....XX..
	.XXXXXXXXXXX.
	.XX.......XX.
	.XX.......XX.
	XX.........XX
	XX.........XX
	.............
	.............
	.............

LSB     .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    X    X    X    .    .    .    .    .
        .    .    .    .    .    X    .    X    .    .    .    .    .
        .    .    .    .    X    X    .    X    X    .    .    .    .
        .    .    .    .    X    X    .    X    X    .    .    .    .
        .    .    .    .    X    .    .    .    X    .    .    .    .
        .    .    .    X    X    .    .    .    X    X    .    .    .
        .    .    .    X    X    .    .    .    X    X    .    .    .
        .    .    X    X    .    .    .    .    .    X    X    .    .
        .    .    X    X    .    .    .    .    .    X    X    .    .
        .    X    X    X    X    X    X    X    X    X    X    X    .
        .    X    X    .    .    .    .    .    .    .    X    X    .
        .    X    X    .    .    .    .    .    .    .    X    X    .
MSB     X    X    .    .    .    .    .    .    .    .    .    X    X
        8000 f000 7c00 1f00 13e0 1078 1008 1078 13e0 1f00 7c00 f000 8000

LSB     X    X    .    .    .    .    .    .    .    .    .    X    X
        .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    .    .    .    .    .    .    .    .
        0001 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0001



The pixel data for this character would be stored this way:

80 00 00 01 f0 00 00 01 7c 00 00 00 1f 00 00 00
13 e0 00 00 10 78 00 00 10 08 00 00 10 78 00 00
13 e0 00 00 1f 00 00 00 7c 00 00 00 f0 00 00 01
80 00 00 01

**************************************************************************************



The NEW 16bit JControl Font Definition Format V.2(JCFD)
-------------------------------------------------------

<font>              := <header><lookuptable><fontdata>

------------
<header>            := "JCFD"<revision><size><height><spacing><baseline><style><lined><offset><chars_num><special_chars_num>

<revision>          := 0x0003 (16bit)
<size>              := font height in pixels (16bit)
<height>            := space between baselines (16bit)
<spacing>           := spacing between characters (16bit SIGNED integer).
                       Default value is 0x0001. <spacing> is a SIGNED integer value, 
                       because it may be negative.
<baseline>          := number of pixels from top to baseline (16bit)
                       "Baseline" is needed for alignung the the chars at baseline

<style>             := the font styles (16bit)
                      (0x0000 : plain)
                       0x0001 : bold
                       0x0002 : italic
                       0x0004 : monospace
                       0x0008 : system

<lined>             := underlined or not underlined (16bit)
                       0x0000 : no
                       0x0001 : underlined

<offset>            := 0x000c (16bit) offset of lookup table (is index of short array[])
<chars_num>         := 0x0080 (16bit) number of standard characters. Should always be 128
<special_chars_num> := number of special characters placed behind 0x0080, like ,,. (16bit)

------------
The lookup table includes the width and the start index for every character in this font.

<lookuptable>       := <chars>[<special_chars>]

<chars>             := {<width><index>}+             (<chars_num> times)
<special_chars>     := {<unicode><width><index>}+    (<special_chars_num> times)

<width>             := the character width in pixels (16bit)
<index>             := the start index for the characters pixel data (16 bit)
<unicode>           := the unicode for this character (16bit)

------------

<fontdata>          := {<pixel_data>}+

<pixel_data>        := {<letter_column>}+            (<width> times)
<letter_column>     := {<short_value>}+              ( if <size> is more than 16, more shorts are needed)

<short_value>       := pixels are stored in a short, one upon the other, LSB first (16bit each)

Example : font size = 20, character width = 13
    .............
	.............
	.............
	.....XXX.....
	.....X.X.....
	....XX.XX....
	....XX.XX....
	....X...X....
	...XX...XX...
	...XX...XX...
	..XX.....XX..
	..XX.....XX..
	.XXXXXXXXXXX.
	.XX.......XX.
	.XX.......XX.
	XX.........XX
	XX.........XX
	.............
	.............
	.............

LSB     .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    X    X    X    .    .    .    .    .
        .    .    .    .    .    X    .    X    .    .    .    .    .
        .    .    .    .    X    X    .    X    X    .    .    .    .
        .    .    .    .    X    X    .    X    X    .    .    .    .
        .    .    .    .    X    .    .    .    X    .    .    .    .
        .    .    .    X    X    .    .    .    X    X    .    .    .
        .    .    .    X    X    .    .    .    X    X    .    .    .
        .    .    X    X    .    .    .    .    .    X    X    .    .
        .    .    X    X    .    .    .    .    .    X    X    .    .
        .    X    X    X    X    X    X    X    X    X    X    X    .
        .    X    X    .    .    .    .    .    .    .    X    X    .
        .    X    X    .    .    .    .    .    .    .    X    X    .
MSB     X    X    .    .    .    .    .    .    .    .    .    X    X
        8000 f000 7c00 1f00 13e0 1078 1008 1078 13e0 1f00 7c00 f000 8000

LSB     X    X    .    .    .    .    .    .    .    .    .    X    X
        .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    .    .    .    .    .    .    .    .
        .    .    .    .    .    .    .    .    .    .    .    .    .
        0001 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 0001



The pixel data for this character would be stored this way:

80 00 00 01 f0 00 00 01 7c 00 00 00 1f 00 00 00
13 e0 00 00 10 78 00 00 10 08 00 00 10 78 00 00
13 e0 00 00 1f 00 00 00 7c 00 00 00 f0 00 00 01
80 00 00 01

-------------------------------------------------------
(c) Domologic Home Automation GmbH. All Rights Reserved.










                        