SmallsomeFormats · Language · ArchitectureJörg Burbach

LeXA Format definition

Generation 26 contract

The generation-26 container has an 8-byte common header and a kind discriminator: 1 for text and 2 for fonts. Text entries use compact six-byte metadata for identifier and block lengths. Font metadata extends the header to 20 bytes. Text methods are Raw (0) and BriefLZ (1); font methods are Raw (0), LZSS (1) and column LZSS (2). The reference validates table bounds, methods and glyph geometry.

This is a concise format overview. The bundled reference module is the authoritative field-by-field and bitstream definition; it includes the required structures, constants, encoder and decoder. Input and output are memory buffers. File access and playback or rendering belong to the host application.

Public operations

  Declare.i DetectMemory(*Memory, MemorySize.i)
  Declare.i InspectMemory(*Memory, MemorySize.i, *Info.LEXAInfo)
  Declare.i EncodeUTF8Memory(*UTF8, Bytes.i, *OutSize.Integer = #Null)
  Declare.i EncodeTextsMemory(List Texts.TextEntry(), *OutSize.Integer = #Null)
  Declare.i EncodeFontMemory(*Font, Bytes.i, *OutSize.Integer = #Null)
  Declare.i EncodeBitmapFontMemory(*Font, Bytes.i, GlyphWidth.i, GlyphHeight.i, *OutSize.Integer = #Null)
  Declare.i DecodeTextUTF8Memory(*Memory, MemorySize.i, TextIndex.i = 0, *OutSize.Integer = #Null)
  Declare.i DecodeFontMemory(*Memory, MemorySize.i, *OutSize.Integer = #Null)
  Declare.i TextCount(*Memory, MemorySize.i)
  Declare.s GetText_LeXAInfo()
  Declare.i BriefLZEncode(*source, sourceSize.i, *OutSize.Integer)
  Declare.i BriefLZDecode(*source, sourceSize.i, expected.i, *OutSize.Integer)

The source bundle preserves the include paths and contains all literal include dependencies and the MIT license. The individual module is not advertised as a dependency-free distribution.

C and JavaScript

The memory ports encode and decode generation-26 streams. The port contracts specify dependencies, buffer ownership, data structures, encoder differences and exchange-format boundaries. The complete C/JavaScript source bundle preserves shared dependency paths. Browser file conversion is separate from the codec core.