{"record":{"id":"f1bb474470be2324","repo":"unoplatform/uno","slug":"no-supported-cmap-subtable-found-platform-3-encod","errorCode":null,"errorMessage":"No supported cmap subtable found (Platform 3/Encoding 1 or 10, or Platform 0)","messagePattern":"No supported cmap subtable found \\(Platform 3/Encoding 1 or 10, or Platform 0\\)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/FontFallbackPreprocessor/Program.cs","lineNumber":317,"sourceCode":"\t\t\tif (platformId == 3 && (encodingId == 1 || encodingId == 10))\n\t\t\t{\n\t\t\t\tif (selectedPlatformId != 3 || (encodingId == 10 && selectedEncodingId == 1))\n\t\t\t\t{\n\t\t\t\t\tselectedSubtableOffset = offset;\n\t\t\t\t\tselectedPlatformId = platformId;\n\t\t\t\t\tselectedEncodingId = encodingId;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (platformId == 0 && selectedPlatformId != 3)\n\t\t\t{\n\t\t\t\tselectedSubtableOffset = offset;\n\t\t\t\tselectedPlatformId = platformId;\n\t\t\t\tselectedEncodingId = encodingId;\n\t\t\t}\n\t\t}\n\n\t\tif (selectedSubtableOffset == 0)\n\t\t\tthrow new Exception(\"No supported cmap subtable found (Platform 3/Encoding 1 or 10, or Platform 0)\");\n\n\t\t// 4. Parse subtable\n\t\t// The offset in the encoding record is relative to the beginning of the cmap table.\n\t\tlong subtablePosition = cmapOffset + selectedSubtableOffset;\n\t\tfs.Seek(subtablePosition, SeekOrigin.Begin);\n\t\tushort format = ReadUInt16Be(reader);\n\n\t\tif (format == 4)\n\t\t{\n\t\t\treturn ReadFormat4(reader);\n\t\t}\n\t\telse if (format == 12)\n\t\t{\n\t\t\treturn ReadFormat12(reader);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception($\"cmap format {format} not supported (only 4 and 12)\");","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/unoplatform/uno/blob/04183404888ea21b4e5bfa3493e8d5f15e972c3a/src/FontFallbackPreprocessor/Program.cs#L299-L335","documentation":"The cmap table exists but none of its encoding records matched the selector: Platform 3 (Windows) Encoding 1 (Unicode BMP) or 10 (Unicode full), or Platform 0 (Unicode). If selectedSubtableOffset stays 0 after scanning all subtable records, the tool throws. Fonts with only legacy platform encodings (e.g. Platform 1 Macintosh only) or malformed encoding records hit this.","triggerScenarios":"A cmap table whose encoding records are exclusively legacy (Macintosh/Platform 1, or custom platform IDs), or whose Platform-3/0 records have offsets of 0, leaving no selectable Unicode subtable.","commonSituations":"Parsing older legacy fonts (early Mac TTFs, symbol fonts) that predate Unicode cmap subtables; an OTF with only format-0/2 subtables on Macintosh platform; a font whose Windows Unicode subtable was stripped.","solutions":["Replace the font with a Unicode-encoded version (Noto fonts ship Platform 3/Encoding 1 subtables).","Extend the selector to accept Macintosh Platform 1 as a last-resort fallback if Unicode coverage is acceptable.","Skip fonts with no usable Unicode cmap when generating fallback maps."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// After scanning subtables, fall back to Macintosh Platform 1 if no Unicode subtable\nif (selectedSubtableOffset == 0 && macSubtableOffset != 0) { selectedSubtableOffset = macSubtableOffset; }","typeGuard":null,"tryCatchPattern":"try { ReadCmap(path); }\ncatch (Exception ex) when (ex.Message.Contains(\"No supported cmap subtable\")) { Log.Warn($\"{path} has no Unicode cmap; skipping.\"); }","preventionTips":["Prefer fonts with Platform 3/Encoding 1 cmap subtables (Noto fonts).","Skip legacy Mac-only-platform fonts in fallback-map generation.","Extend the selector with a Macintosh fallback only if Unicode coverage is acceptable."],"tags":["font","build-tool","fontfallbackpreprocessor","truetype","cmap"],"backgroundTag":null,"analyzedSha":"04183404888ea21b4e5bfa3493e8d5f15e972c3a","analyzedAt":"2026-08-13T21:08:11.651Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}