{"record":{"id":"3c80971e755e204c","repo":"spectreconsole/spectre.console","slug":"invalid-figlet-font-header","errorCode":null,"errorMessage":"Invalid Figlet font header","messagePattern":"Invalid Figlet font header","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Spectre.Console/Widgets/Figlet/FigletFontParser.cs","lineNumber":107,"sourceCode":"        {\n            index = index.ReplaceExact(\"0x\", string.Empty);\n            style = NumberStyles.HexNumber;\n        }\n\n        return int.TryParse(index, style, CultureInfo.InvariantCulture, out result);\n    }\n\n    private static FigletHeader ParseHeader(string text)\n    {\n        if (string.IsNullOrWhiteSpace(text))\n        {\n            throw new InvalidOperationException(\"Invalid Figlet font\");\n        }\n\n        var parts = text.SplitWords(StringSplitOptions.RemoveEmptyEntries);\n        if (parts.Length < 6)\n        {\n            throw new InvalidOperationException(\"Invalid Figlet font header\");\n        }\n\n        if (!IsValidSignature(parts[0]))\n        {\n            throw new InvalidOperationException(\"Invalid Figlet font header signature\");\n        }\n\n        int? fullLayout = null;\n        if (parts.Length > 7 && int.TryParse(parts[7], NumberStyles.Integer, CultureInfo.InvariantCulture, out var fl))\n        {\n            fullLayout = fl;\n        }\n\n        return new FigletHeader\n        {\n            Hardblank = parts[0][5],\n            Height = int.Parse(parts[1], CultureInfo.InvariantCulture),\n            Baseline = int.Parse(parts[2], CultureInfo.InvariantCulture),","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/spectreconsole/spectre.console/blob/0acc92fada6c42f13984e79c2b5f3d993bdfb099/src/Spectre.Console/Widgets/Figlet/FigletFontParser.cs#L89-L125","documentation":"Thrown by ParseHeader after splitting the header line into whitespace-delimited tokens when fewer than 6 parts are present. A valid FIGlet header has at least 6 fields (signature+hardblank, height, baseline, max length, old layout, comment lines). Too few tokens means the header is truncated.","triggerScenarios":"Passing a FIGlet font whose header line is incomplete or where fields are joined together preventing proper SplitWords tokenization.","commonSituations":"Manual editing of a font header that deleted fields, a font in a non-standard variant, or whitespace normalization that merged fields.","solutions":["Open the font file and verify the header line has at least 6 space-separated fields.","Use a FIGlet font from the standard distribution known to parse correctly.","Regenerate or re-download the font file if it is truncated."],"exampleFix":"// before (header has too few fields)\n// flf2a$ 5\n\n// after (complete header)\n// flf2a$ 5 4 16 15 11 0 24463","handlingStrategy":"validation","validationCode":"var parts = headerLine.SplitWords(StringSplitOptions.RemoveEmptyEntries);\nif (parts.Length < 6) throw new ArgumentException(\"Figlet header must have >= 6 fields\");","typeGuard":"static bool HasEnoughHeaderFields(string headerLine) => headerLine.SplitWords(StringSplitOptions.RemoveEmptyEntries).Length >= 6;","tryCatchPattern":null,"preventionTips":["Use fonts from the standard FIGlet distribution.","Avoid hand-editing font header lines."],"tags":["figlet","font-parsing","validation","spectre-console"],"backgroundTag":null,"analyzedSha":"0acc92fada6c42f13984e79c2b5f3d993bdfb099","analyzedAt":"2026-08-13T18:27:21.983Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}