{"success":true,"data":{"ext":"afm","name":"AFM","description":"Adobe Font Metrics (AFM) is a plain-text font metrics format developed by Adobe Systems for describing the character spacing and layout properties of PostScript fonts. It is used by typesetting systems, desktop publishing software, and font management tools to calculate text layout without embedding glyph data. AFM is a legacy format and is generally safe to process, though older parsers may have limited support for malformed files.","mime":["application/x-font-adobe-metric"],"risk_level":"Safe","signatures":[{"hex":"53 74 61 72 74 46 6F 6E 74 4D 65 74 72 69 63 73","offset":0,"sources":[{"name":"Apache Tika","url":"https://raw.githubusercontent.com/apache/tika/main/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml"}]}],"related":["acfm","amfm","eot","otf","pfa","pfb"],"usage":{"python":"def is_afm(file_path: str) -> bool:\n    \"\"\"Check if file is a valid AFM by magic bytes.\"\"\"\n    signature = bytes([0x53, 0x74, 0x61, 0x72, 0x74, 0x46, 0x6F, 0x6E, 0x74, 0x4D, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73])\n    with open(file_path, \"rb\") as f:\n        return f.read(16) == signature","node":"function isAFM(buffer: Buffer): boolean {\n  const signature = Buffer.from([0x53, 0x74, 0x61, 0x72, 0x74, 0x46, 0x6F, 0x6E, 0x74, 0x4D, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73]);\n  return buffer.subarray(0, 16).equals(signature);\n}","go":"func IsAFM(data []byte) bool {\n    signature := []byte{0x53, 0x74, 0x61, 0x72, 0x74, 0x46, 0x6F, 0x6E, 0x74, 0x4D, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73}\n    if len(data) < 16 {\n        return false\n    }\n    return bytes.Equal(data[:16], signature)\n}"},"category":"Fonts"}}