Implementing font texture atlas with json data in three.js

I managed to get it somewhat working with the following code:

  colorTexture.wrapS = colorTexture.wrapS = RepeatWrapping;
  colorTexture.repeat.set(
    letterData[2] / 256,
    letterData[3] / 136 + letterData[4] / 136
  );

  colorTexture.offset.x = letterData[0] / 256;
  colorTexture.offset.y =
    lineYOffsets[getLineNum(props.letter)] - letterData[4] / 136;

where letterData is the array provided for each glyph. What’s left to figure out is the y offset, for which I temporarily use hand-picked values.