Thanks and good luck
:r cfn.txt
------------------------------------------------------------------------
.CFN fileformaat
1. Header (28 bytes) 00--1C
CFN_header
byte[10] id "CALAMUSCFN"
byte[2] version? veranderd als kerning informatie wordt toegevoegd
byte[4] creator "DID\0" bij Didot
longword serial serie nummer 0000 als geen.
byte[2] unknown
word no_char aantal karakters in font
word first_char `ASCII'-code eerste karakter
word spacing normale ruimte tussen karakters (vaak 0)
2. Fontinfo (114 bytes) 1C--8E
CFN_info
word id 1
CFN_name fontname
CFN_name copyright
CFN_name firma
CFN_name author
CFN_name
word size lengte van string in gebruik
byte[26] text text van lengte size niet '\0' terminated
3. Bitmap (326 bytes, variabel?) 8E--1D4
CFN_bitmap
word id 2
longword width
longword height
byte[(width * height) / 8] data
Bitmap een kale bitmap links->rechts boven->onder
4. Steunlijnen (vast?) 1D4--2B0
CFN_supportlines
word id 3
word[122] height ? slechts eerste paar gebruikt mogelijk is
hier ook iets anders
5. Automatische kerning informatie (variabel?) 2B0--10B4
CFN_charcontours
word id 4
word size
CFN_charcontour[size]
CFN_charcontour
byte[8] left wat is referentie punt voor deze informatie?
byte[8] right
6. Offset tabel (10B4)
CFN_offsets
word id 5
longword mask initieel masker voor decodering offsets
word size
longword[size] offset gecodeerd als CFN_header.serial != 0000
De offset is als volgt te decoderen:
offset[0] = offset[0] XOR mask + CFN_header.serial
while n < size
offset[n] = offset[n] XOR offset[n-1] + CFN_header.serial
endwhile
offset -2 == bestaat niet
7. Outlines
Wat is maat-eenheid? (als URW: 15000 eenheden op een em?)
CFN_outlines
word id 6
longword size van volgende data in words
word[size] data
CNF_start start nieuwe contourlijn
word id 0
int x of word?
int y
CNF_line rechte lijn tussen vorig en dit punt
word id 1
int x
int y
CNF_curve bezier-kromme tussen vorig en dit punt
word id 2
int x
int y
int x1 steunpunten
int y1
int x2
int y2
CNF_end
word id 15
8. Karakter breedtes
Wat is referentie punt, wat is eenheid?
CNF_widths
word id 7
word size aantal karakters
CNF_width[size]
CNF_width
byte left 7F7F == niet gedefinieerd
byte right
9. Kerning paren
CNF_kernpairs
word id 8
word size
word[size] ?
word size
word[size] ?
??
10. Einde
CNF_end
word id FFFF
-------------------------------------------------------------------
:r cnf_font.h
-------------------------------------------------------------------
/*
* This aer some structures,
* I use in combination with calamus fonts
*
* I.M. Coosen.
* Created: 21/04/91
*
*
*/
#define FONT_ID "CALAMUSCFN"
#define ID_SIZE 10
#define CFN_VERSION 1000
#define START_INFO 0x001C
#define START_KERN 0x02B0
#define START_OFFSET 0x10B4
#define START_DESCR 0x143C
enum Block_Type
{
Blk_Info = 1, Blk_Kern = 4, Blk_Offset, Blk_Descr, Blk_End = 0xFFFF
};
enum Line_Type
{
Ln_Start = 0, Ln_line, Ln_Bezier, Ln_End = 15
};
struct Font_Header
{
char font_id[10];
int version;
char extra[4];
unsigned long serial;
int unknown_1;
int number_chars;
int start_char;
int char_spacing;
};
struct Info_Name
{
int size;
char text[26];
};
struct Info_Block
{
enum Block_Type type;
struct Info_Name font_name;
struct Info_Name copyright;
struct Info_Name firma;
struct Info_Name author;
};
struct Kern_Char
{
unsigned char left[8];
unsigned char right[8];
};
struct Kern_Block
{
enum Block_Type type;
int size;
struct Kern_Char kern[/* size */];
};
struct Offset_Block
{
enum Block_Type type;
unsigned long serial;
int size;
long offset[/* size */];
};
struct Descr_Block
{
enum Block_Type type;
unsigned long size;
int list[/* size */];
};
struct Line_Start
{
enum Line_Type type;
int x;
int y;
};
struct Line_Line
{
enum Line_Type type;
int x;
int y;
};
struct Line_Bezier
{
enum Line_Type type;
int x1;
int y1;
int x2;
int y2;
int x3;
int y3;
};
struct Font_File
{
char *file;
struct Font_Header *header;
struct Info_Block *info;
struct Kern_Block *kern;
struct Offset_Block *offset;
struct Descr_Block *descr;
};
----------------------------------------------------------------
end of posting