GRASP font

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
Line 22: Line 22:
 
|0  || byte      || Always 0x10?
 
|0  || byte      || Always 0x10?
 
|-
 
|-
|1  || byte[13]  || Font name / filename, NUL-terminated
+
|1  || byte[13]  || Font name / filename, terminated by a NUL byte
 
|-
 
|-
 
|16  || byte      || Number of valid characters, minus 1. The maximum allowed might be 94 (meaning 95).
 
|16  || byte      || Number of valid characters, minus 1. The maximum allowed might be 94 (meaning 95).
Line 39: Line 39:
 
|}
 
|}
  
Based on this interpretation of the format, the first character in the tables is ASCII 32 (space). However, it seems that sometimes the first character does not have valid data, so maybe it should be ignored.
+
Based on this interpretation of the format, the first character in the tables is ASCII 32 (space). However, it seems that sometimes the first character does not have valid bitmap data, so maybe it should be ignored.
  
 
Each glyph's bitmap, as stored in the file, is the same size. The "widths table" tells how many columns are meaningful.
 
Each glyph's bitmap, as stored in the file, is the same size. The "widths table" tells how many columns are meaningful.
Line 52: Line 52:
 
* [http://cd.textfiles.com/vgaspectrum/animate/gl/duck.gl duck.gl] → rome25.set
 
* [http://cd.textfiles.com/vgaspectrum/animate/gl/duck.gl duck.gl] → rome25.set
 
* [http://cd.textfiles.com/vgaspectrum/animate/gl/v7vga.gl v7vga.gl] → book.set
 
* [http://cd.textfiles.com/vgaspectrum/animate/gl/v7vga.gl v7vga.gl] → book.set
 +
* [http://cd.textfiles.com/gamefest2/SOFT/ED/PRO10/AMULT.GL AMULT.GL] → gaston.set, helvet20.set, mysmall.set
 +
* [http://cd.textfiles.com/gamefest2/SOFT/ED/PRO12/ACLOCK.GL ACLOCK.GL] → lcd.set
  
 
== Links ==
 
== Links ==
 
* {{EGFF|grasp|GRASP File Format Summary}}, from the [[Encyclopedia of Graphics File Formats]] ("Font File" section)
 
* {{EGFF|grasp|GRASP File Format Summary}}, from the [[Encyclopedia of Graphics File Formats]] ("Font File" section)
 
* [http://www.textfiles.com/programming/FORMATS/glformat.txt glformat.txt] ("Font Files" section)
 
* [http://www.textfiles.com/programming/FORMATS/glformat.txt glformat.txt] ("Font Files" section)

Revision as of 17:22, 31 December 2016

File Format
Name GRASP font
Ontology
Extension(s) .set, .fnt

GRASP font is a bitmap font format associated with the GRASP animation software. Some GRASP GL archive files contain one or more GRASP font files.

See GRASP GL for more information about GRASP, and related formats.

It appears that there is a second GRASP font format, that is significantly different from the one that is documented. We'll call the documented format "original format", and the other format "new format".

Contents

Format details

Original format

Files have a 7-byte header with no identifying signature, followed by the glyph bitmap data. See the Links section for documentation.

New format

This is a partial decoding of the format, based on reverse engineering and guesswork.

Offset Type Description
0 byte Always 0x10?
1 byte[13] Font name / filename, terminated by a NUL byte
16 byte Number of valid characters, minus 1. The maximum allowed might be 94 (meaning 95).
19 byte Glyph (maximum) pixel width
20 byte Glyph pixel height
21 byte Number of bytes per row in a glyph bitmap
25 int16 File size
59 int16[95] Table of glyph bitmap offsets, relative to the beginning of the file
249 byte[95] Table of glyph logical pixel widths

Based on this interpretation of the format, the first character in the tables is ASCII 32 (space). However, it seems that sometimes the first character does not have valid bitmap data, so maybe it should be ignored.

Each glyph's bitmap, as stored in the file, is the same size. The "widths table" tells how many columns are meaningful.

Sample files

Original format

New format

Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox