parseCmapTableFormat12 function

dynamic parseCmapTableFormat12(
  1. Map<String, dynamic> cmap,
  2. dynamic p
)

Implementation

parseCmapTableFormat12(Map<String, dynamic> cmap, p) {
    //Skip reserved.
    p.parseUShort();

    // Length in bytes of the sub-tables.
    cmap["length"] = p.parseULong();
    cmap["language"] = p.parseULong();

    var groupCount;
    cmap["groupCount"] = groupCount = p.parseULong();
    cmap["glyphIndexMap"] = {};

    for (var i = 0; i < groupCount; i += 1) {
        var startCharCode = p.parseULong();
        var endCharCode = p.parseULong();
        var startGlyphId = p.parseULong();

        for (var c = startCharCode; c <= endCharCode; c += 1) {
            cmap["glyphIndexMap"][c] = startGlyphId;
            startGlyphId++;
        }
    }
}