# File Format

As of version 4.0, GtkLife has a native file format, GLF. This is a text-based format similar to RLE. The standard extension is .glf, although it is not required.

The specification is as follows:

- DOS or Unix line breaks are acceptable.

- The file begins with the identifying line "#GLF <format version>". Current version is 1.0.

- This is followed by 0 or more lines starting with "#D", which contain the pattern description. Description lines may be of arbitrary length. Leading whitespace (after #D) and trailing whitespace is ignored.

- Next is a header specifying the dimensions of the pattern:

  > x = $x, y = $y, width = $w, height = $h

  $x and $y are signed integers which specify the upper-left corner of the pattern (the center of the grid is 0,0). $w and $h are unsigned integers specifying the dimensions of the pattern. Arbitrary whitespace is allowed between terms.

- The rest of the file consists of an RLE encoding of the pattern. GtkLife does not write RLE lines longer than 70 characters, though it will read lines of any length.