PFB
application/x-font-type1
Magic Bytes
Offset: 0
80 01 FF FF 00 00 25 21 50 53 2D 41 64 6F 62 65 46 6F 6E 74
Printer Font Binary (PFB) is a specialized digital font container developed by Adobe Systems for storing PostScript Type 1 font data. These files primarily facilitate professional typography, graphic design, and high-resolution printing by providing scalable outline information for individual characters. Although largely superseded by OpenType and TrueType formats, PFB remains a legacy standard historically significant for its role in the desktop publishing revolution and Adobe Type Manager software.
Validation Code
How to validate .pfb files in Python
Python
def is_pfb(file_path: str) -> bool:
"""Check if file is a valid PFB by magic bytes."""
signature = bytes([0x80, 0x01, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x21, 0x50, 0x53, 0x2D, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x46, 0x6F, 0x6E, 0x74])
with open(file_path, "rb") as f:
return f.read(20) == signature
How to validate .pfb files in Node.js
Node.js
function isPFB(buffer: Buffer): boolean {
const signature = Buffer.from([0x80, 0x01, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x21, 0x50, 0x53, 0x2D, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x46, 0x6F, 0x6E, 0x74]);
return buffer.subarray(0, 20).equals(signature);
}
Go
func IsPFB(data []byte) bool {
signature := []byte{0x80, 0x01, 0xFF, 0xFF, 0x00, 0x00, 0x25, 0x21, 0x50, 0x53, 0x2D, 0x41, 0x64, 0x6F, 0x62, 0x65, 0x46, 0x6F, 0x6E, 0x74}
if len(data) < 20 {
return false
}
return bytes.Equal(data[:20], signature)
}
API Endpoint
GET
/api/v1/pfb
curl https://filesignature.org/api/v1/pfb