Skip to content

Instantly share code, notes, and snippets.

@tannewt
Created July 6, 2023 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tannewt/e9de3849acfa27a0edad6789a2c64629 to your computer and use it in GitHub Desktop.
Save tannewt/e9de3849acfa27a0edad6789a2c64629 to your computer and use it in GitHub Desktop.
Start of a Kaitai struct definition for the FNT font file format
meta:
id: fnt
file-extension: fnt
endian: le
bit-endian: le
seq:
- id: df_version
type: u2
- id: df_size
type: u4
- id: df_copyright
type: str
size: 60
encoding: ASCII
- id: df_type
type: u2
- id: df_points
type: u2
- id: df_vert_res
type: u2
- id: df_horiz_res
type: u2
- id: df_ascent
type: u2
- id: df_internal_leading
type: u2
- id: df_external_leading
type: u2
- id: df_italic
type: b1
- type: b7
- id: df_underline
type: b1
- type: b7
- id: df_strike_out
type: b1
- type: b7
- id: df_weight
type: u2
- id: df_char_set
type: u1
- id: df_pix_width
type: u2
- id: df_pix_height
type: u2
- id: pitch
type: b1
- type: b3
- id: family
type: b4
enum: font_family
- id: df_average_width
type: u2
- id: df_max_width
type: u2
- id: df_first_char
type: u1
- id: df_last_char
type: u1
- id: df_default_char
type: u1
- id: df_break_char
type: u1
- id: df_width_bytes
type: u2
- id: df_device
type: u4
- id: df_face
type: u4
- id: df_bits_pointer
type: u4
- id: df_bits_offset
type: u4
- type: u1
- id: dff_fixed
type: b1
- id: dff_proportional
type: b1
- id: dff_abcfixed
type: b1
- id: dff_abcproportional
type: b1
- id: dff_1color
type: b1
- id: dff_16color
type: b1
- id: dff_256color
type: b1
- id: dff_rgbcolor
type: b1
- type: b24
- id: bf_aspace
type: u2
- id: bf_bspace
type: u2
- id: bf_cspace
type: u2
- id: df_color_pointer
type: u4
enums:
font_family:
0: ff_dontcare
1: ff_roman
2: ff_swiss
3: ff_modern
4: ff_script
5: ff_decorative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment