{"record":{"id":"0627e1681823e404","repo":"stride3d/stride","slug":"font-does-not-contain-any-glyphs","errorCode":null,"errorMessage":"Font does not contain any glyphs.","messagePattern":"Font does not contain any glyphs\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/SpriteFont/Compiler/OfflineRasterizedFontCompiler.cs","lineNumber":165,"sourceCode":"\n            importer = importFromBitmap ? (IFontImporter) new BitmapImporter() : new FreeTypeFontImporter();\n\n            // create the list of character to import\n            var characters = GetCharactersToImport(options); \n\n            // Import the source font data.\n            importer.Import(options, characters);\n\n            lineSpacing = importer.LineSpacing;\n            baseLine = importer.BaseLine;\n\n            // Get all glyphs\n            var glyphs = new List<Glyph>(importer.Glyphs);\n\n            // Validate.\n            if (glyphs.Count == 0)\n            {\n                throw new Exception(\"Font does not contain any glyphs.\");\n            }\n            if (!importFromBitmap)\n            {\n                foreach (var glyph in importer.Glyphs)\n                    BitmapUtils.ConvertGreyToAlpha(glyph.Bitmap, glyph.Subrect);\n            }\n\n            // Sort the glyphs\n            glyphs.Sort((left, right) => left.Character.CompareTo(right.Character));\n\n\n            // Check that the default character is part of the glyphs\n            if (options.DefaultCharacter != 0)\n            {\n                bool defaultCharacterFound = false;\n                foreach (var glyph in glyphs)\n                {\n                    if (glyph.Character == options.DefaultCharacter)","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/SpriteFont/Compiler/OfflineRasterizedFontCompiler.cs#L147-L183","documentation":"OfflineRasterizedFontCompiler.ImportFont collects the importer's produced glyphs and throws a plain Exception when the resulting list is empty. A compiled sprite font must contain at least one glyph; zero glyphs would produce an unusable texture.","triggerScenarios":"The font importer (FreeType or bitmap) produced no glyphs: empty or invalid character set in the asset, a font whose characters map to nothing, or an importer that silently skipped all characters.","commonSituations":"Sprite font asset with an empty CharacterSet / missing characters; font file lacking the requested characters (e.g. icon-only font with letters requested and no fallback).","solutions":["Ensure the sprite font asset's character set contains at least one character the font actually provides.","Check the font file supports the requested characters (use a font with a broad character map).","Review import logs for glyph loading failures that silently removed all characters."],"exampleFix":"// before\nCharacterSet = \"\"; // empty -> no glyphs\n\n// after\nCharacterSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(fontAsset.CharacterSet))\n    throw new ArgumentException(\"Sprite font character set must not be empty.\");","typeGuard":null,"tryCatchPattern":"catch (Exception ex) when (ex.Message == \"Font does not contain any glyphs.\") { log.Error(\"Character set empty or unsupported by font.\"); }","preventionTips":["Always populate the character set in sprite font assets.","Confirm the font's character map covers the requested characters."],"tags":["fonts","empty-result-set","compiler"],"backgroundTag":"empty-result-set","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"}