GlyphNames constructor

GlyphNames(
  1. Map<String, dynamic> post
)

Implementation

GlyphNames(Map<String, dynamic> post) {
  var _v = post["version"];

  if (_v == 1.0) {
    this.names = standardNames.sublist(0);
  } else if (_v == 2) {
    this.names = List<String>.filled(post["numberOfGlyphs"], "");
    for (var i = 0; i < post["numberOfGlyphs"]; i++) {
      if (post["glyphNameIndex"][i] < standardNames.length) {
        this.names[i] = standardNames[post["glyphNameIndex"][i]];
      } else {
        this.names[i] = post["names"][post["glyphNameIndex"][i] - standardNames.length];
      }
    }
  } else if (_v == 2.5) {
    this.names = List<String>.filled(post["numberOfGlyphs"], "");
    for (int i = 0; i < post["numberOfGlyphs"]; i++) {
      int _pi = post["glyphNameIndex"][i];
      int _ii = i + _pi;
      this.names[i] = standardNames[_ii];
    }
  } else if (_v == 3.0) {
    this.names = [];
  } else {
    this.names = [];
  }
}