FON
application/octet-stream
Magic Bytes
Offset: 0
4D 5A
The FON file format is a legacy font resource library developed by Microsoft for use within the Windows operating system environment. These files primarily function as executable containers storing fixed-size bitmap font data used for system interfaces, dialog boxes, and command prompt windows. Structurally identical to 16-bit Windows executable libraries, this format has largely been superseded by vector-based TrueType and OpenType standards but remains present for backward compatibility.
Validation Code
How to validate .fon files in Python
def is_fon(file_path: str) -> bool:
"""Check if file is a valid FON by magic bytes."""
signature = bytes([0x4D, 0x5A])
with open(file_path, "rb") as f:
return f.read(2) == signature
How to validate .fon files in Node.js
function isFON(buffer: Buffer): boolean {
const signature = Buffer.from([0x4D, 0x5A]);
return buffer.subarray(0, 2).equals(signature);
}
How to validate .fon files in Go
func IsFON(data []byte) bool {
signature := []byte{0x4D, 0x5A}
if len(data) < 2 {
return false
}
return bytes.Equal(data[:2], signature)
}
API Endpoint
/api/v1/fon
curl https://filesignature.org/api/v1/fon
Related Formats
Frequently Asked Questions
What is a .fon file?
A .fon file is a FON file. The FON file format is a legacy font resource library developed by Microsoft for use within the Windows operating system environment. These files primarily function as executable containers storing fixed-size bitmap font data used for system interfaces, dialog boxes, and command prompt windows. Structurally identical to 16-bit Windows executable libraries, this format has largely been superseded by vector-based TrueType and OpenType standards but remains present for backward compatibility.
What are the magic bytes for .fon files?
The magic bytes for FON files are 4D 5A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .fon file?
To validate a .fon file, read the first bytes of the file and compare them against the known magic bytes (4D 5A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .fon files?
The primary MIME type for .fon files is application/octet-stream.
Is it safe to open .fon files?
FON (.fon) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.