Is perhaps `textHScale` missing here? I.e. shouldn't the line read:
```javascript
x += -glyph * fontSize * 0.001 * textHScale;
```