glyphStart method

int glyphStart(
  1. int index
)

Returns the first codeunit index of the glyph cluster containing index.

Implementation

int glyphStart(int index) {
  if (index <= 0 || index >= indices.length) {
    return index;
  }
  var value = indices[index];
  while (index > 0 && indices[index - 1] == value) {
    index--;
  }
  return index;
}