{"record":{"id":"4135f262e904e3cf","repo":"AvaloniaUI/Avalonia","slug":"specified-family-is-not-supported","errorCode":null,"errorMessage":"Specified family is not supported.","messagePattern":"Specified family is not supported\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Media/FontFamily.cs","lineNumber":210,"sourceCode":"        /// <exception cref=\"ArgumentException\">\n        /// Specified family is not supported.\n        /// </exception>\n        public static FontFamily Parse(string s) => Parse(s, null);\n\n        /// <summary>\n        /// Parses a <see cref=\"T:Avalonia.Media.FontFamily\"/> string.\n        /// </summary>\n        /// <param name=\"s\">The <see cref=\"T:Avalonia.Media.FontFamily\"/> string.</param>\n        /// <param name=\"baseUri\">Specifies the base uri that is used to resolve font family assets.</param>\n        /// <returns></returns>\n        /// <exception cref=\"ArgumentException\">\n        /// Specified family is not supported.\n        /// </exception>\n        public static FontFamily Parse(string s, Uri? baseUri)\n        {\n            if (string.IsNullOrEmpty(s))\n            {\n                throw new ArgumentException(\"Specified family is not supported.\", nameof(s));\n            }\n\n            return new FontFamily(baseUri, s);\n        }\n\n        /// <summary>\n        /// Returns a <see cref=\"string\" /> that represents this instance.\n        /// </summary>\n        /// <returns>\n        /// A <see cref=\"string\" /> that represents this instance.\n        /// </returns>\n        public override string ToString()\n        {\n            if (Key != null)\n            {\n                return Key + \"#\" + FamilyNames;\n            }\n","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Media/FontFamily.cs#L192-L228","documentation":"FontFamily.Parse throws ArgumentException when the input string is null or empty. A font family specification must contain at least a family name or a source identifier (e.g. 'FamilyName', 'avares://...#Family', or '#Source'). Empty/null input cannot identify any font family.","triggerScenarios":"Calling FontFamily.Parse(s, baseUri) where s is null or empty string. Often reached from XAML when a FontFamily attribute is empty or bound to a null/empty value.","commonSituations":"A XAML FontFamily attribute left empty or set to \"{}\". Binding FontFamily to a property that evaluates to null/empty. Loading font family names from config with missing entries. A theme/style that omits the font family value.","solutions":["Provide a non-empty font family string (e.g. a system font name or an avares: source).","Guard against null/empty before parsing: if (string.IsNullOrEmpty(s)) use a fallback family.","Check XAML bindings and resource definitions for empty FontFamily values."],"exampleFix":"// before\nvar ff = FontFamily.Parse(fontNameFromConfig, null); // fontNameFromConfig is \"\"\n\n// after\nvar name = string.IsNullOrEmpty(fontNameFromConfig) ? \"Segoe UI\" : fontNameFromConfig;\nvar ff = FontFamily.Parse(name, null);","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(s))\n    throw new ArgumentException(\"Font family name required.\", nameof(s));\nvar ff = FontFamily.Parse(s, baseUri);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate font family strings are non-empty before parsing.","Guard XAML bindings that could yield null/empty FontFamily values.","Provide fallback family names in config-driven scenarios."],"tags":["font-family","parsing","media","validation"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}