readSubrs static method

void readSubrs(
  1. Uint8List data,
  2. int offset,
  3. Map obj
)

Implementation

static void readSubrs(Uint8List data, int offset, Map obj) {
  List<int> gsubinds = [];
  offset = readIndex(data, offset, gsubinds);

  int bias, nSubrs = gsubinds.length;
  if (nSubrs < 1240)
    bias = 107;
  else if (nSubrs < 33900)
    bias = 1131;
  else
    bias = 32768;
  obj["Bias"] = bias;

  obj["Subrs"] = [];
  for (int i = 0; i < gsubinds.length - 1; i++){
    obj["Subrs"].add(
      TyprBin.readBytes(data, offset + gsubinds[i], gsubinds[i + 1] - gsubinds[i])
    );
  }
}