{"record":{"id":"fc40fc3097fe6cac","repo":"OpenRA/OpenRA","slug":"requested-font-font-was-not-found","errorCode":null,"errorMessage":"Requested font '{Font}' was not found.","messagePattern":"Requested font '(.+?)' was not found\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"OpenRA.Mods.Common/Widgets/LabelWidget.cs","lineNumber":74,"sourceCode":"\t\t\tVAlign = other.VAlign;\n\t\t\tFont = other.Font;\n\t\t\tTextColor = other.TextColor;\n\t\t\tContrast = other.Contrast;\n\t\t\tContrastColorDark = other.ContrastColorDark;\n\t\t\tContrastColorLight = other.ContrastColorLight;\n\t\t\tContrastRadius = other.ContrastRadius;\n\t\t\tShadow = other.Shadow;\n\t\t\tWordWrap = other.WordWrap;\n\t\t\tGetText = other.GetText;\n\t\t\tGetColor = other.GetColor;\n\t\t\tGetContrastColorDark = other.GetContrastColorDark;\n\t\t\tGetContrastColorLight = other.GetContrastColorLight;\n\t\t}\n\n\t\tpublic void IncreaseHeightToFitCurrentText()\n\t\t{\n\t\t\tif (!Game.Renderer.Fonts.TryGetValue(Font, out var font))\n\t\t\t\tthrow new ArgumentException($\"Requested font '{Font}' was not found.\");\n\n\t\t\tvar line = GetText();\n\t\t\tif (WordWrap)\n\t\t\t\tline = WidgetUtils.WrapText(line, Bounds.Width, font);\n\t\t\tBounds.Height = Math.Max(Bounds.Height, font.Measure(line).Y);\n\t\t}\n\n\t\tpublic override void Draw()\n\t\t{\n\t\t\tif (!Game.Renderer.Fonts.TryGetValue(Font, out var font))\n\t\t\t\tthrow new ArgumentException($\"Requested font '{Font}' was not found.\");\n\n\t\t\tvar text = GetText();\n\t\t\tif (text == null)\n\t\t\t\treturn;\n\n\t\t\tif (WordWrap)\n\t\t\t\ttext = WidgetUtils.WrapText(text, Bounds.Width, font);","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/OpenRA/OpenRA/blob/a520984d91eda9de48a62b1d15c1e3bad0d4fb1a/OpenRA.Mods.Common/Widgets/LabelWidget.cs#L56-L92","documentation":"Thrown by LabelWidget.IncreaseHeightToFitCurrentText when the widget's Font property names a font not registered in Game.Renderer.Fonts. Fonts are defined in the mod's fonts.yaml and loaded at engine startup. This method is typically called during chrome layout to auto-size label height.","triggerScenarios":"A LabelWidget has a Font value not matching any key in the loaded font dictionary, and IncreaseHeightToFitCurrentText is invoked (usually during panel initialization via headerLabel.IncreaseHeightToFitCurrentText()).","commonSituations":"Font name typo in chrome layout YAML, referencing a font removed in a mod update, or fonts.yaml doesn't define the referenced font.","solutions":["Check the Font value in the widget's chrome YAML against the mod's fonts.yaml keys","Add the missing font definition to fonts.yaml","Use one of the known font names already defined by the mod"],"exampleFix":"# before (chrome.yaml)\nLABEL:\n  Font: TinyBold  # not defined in fonts.yaml\n\n# after\nLABEL:\n  Font: TinyRegular","handlingStrategy":"validation","validationCode":"// Before calling IncreaseHeightToFitCurrentText, verify the font is loaded\nif (!Game.Renderer.Fonts.ContainsKey(Font))\n    Console.Error.WriteLine($\"Font '{Font}' not found. Available: {string.Join(\", \", Game.Renderer.Fonts.Keys)}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cross-check font names in chrome YAML against fonts.yaml definitions","Test all UI panels after font configuration changes","Maintain a documented list of available font names for chrome authors"],"tags":["openra","widget","font","ui","yaml","config"],"backgroundTag":null,"analyzedSha":"a520984d91eda9de48a62b1d15c1e3bad0d4fb1a","analyzedAt":"2026-08-13T15:30:14.787Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}