{"record":{"id":"f622ec0d22e5bf4f","repo":"stride3d/stride","slug":"font-file-not-found-fontpath","errorCode":null,"errorMessage":"Font file not found: {fontPath}","messagePattern":"Font file not found: (.+?)","errorType":"exception","errorClass":"FontNotFoundException","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/SpriteFont/Compiler/BitmapImporter.cs","lineNumber":117,"sourceCode":"        // Properties hold the imported font data.\n        public IEnumerable<Glyph> Glyphs { get; private set; }\n\n        public float LineSpacing { get; private set; }\n\n        public float BaseLine { get { return 0; } }\n\n        public void Import(SpriteFontAsset options, List<char> characters)\n        {\n            // Load the source bitmap.\n            Image<Rgba32> bitmap;\n\n            try\n            {\n                bitmap = Image.Load<Rgba32>(options.FontSource.GetFontPath());\n            }\n            catch\n            {\n                throw new FontNotFoundException(options.FontSource.GetFontPath());\n            }\n\n            // What characters are included in this font?\n            int characterIndex = 0;\n            char currentCharacter = '\\0';\n\n            // Split the source image into a list of individual glyphs.\n            var glyphList = new List<Glyph>();\n\n            Glyphs = glyphList;\n            LineSpacing = 0;\n\n            foreach (Rectangle rectangle in FindGlyphs(bitmap))\n            {\n                if (characterIndex < characters.Count)\n                    currentCharacter = characters[characterIndex++];\n                else\n                    currentCharacter++;","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/SpriteFont/Compiler/BitmapImporter.cs#L99-L135","documentation":"BitmapImporter.Import attempts to load the font source bitmap with Image.Load<Rgba32>; any failure (missing file or unreadable image) is converted into a FontNotFoundException carrying the resolved font path. This is the bitmap (offline-rasterized, image-based) font import path.","triggerScenarios":"SpriteFontAsset.FontSource points to a path that does not exist, or Image.Load throws for a corrupt/unsupported bitmap file.","commonSituations":"Moving assets between machines so relative paths break; deleting a source .png/.bmp while keeping the .sdfont asset; unsupported image format.","solutions":["Check File.Exists(options.FontSource.GetFontPath()) and correct the FontSource path in the sprite font asset.","Re-add the font bitmap to the asset project so the path resolves again.","Validate the bitmap opens in an image viewer; re-export it if corrupt."],"exampleFix":"// before\nfontSource = \"old/fonts/mybitmap.png\";\n\n// after\nfontSource = \"assets/fonts/mybitmap.png\"; // path verified to exist","handlingStrategy":"validation","validationCode":"var path = options.FontSource.GetFontPath();\nif (string.IsNullOrEmpty(path) || !File.Exists(path))\n    throw new FileNotFoundException(path);","typeGuard":null,"tryCatchPattern":"try { ImportBitmapFont(options); } catch (FontNotFoundException ex) { log.Error($\"Fix FontSource path: {ex.FontPath}\"); }","preventionTips":["Keep font bitmaps inside the project and under source control.","Use project-relative asset references, not absolute paths."],"tags":["fonts","file-not-found","assets"],"backgroundTag":"file-not-found","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}