Fix line labels for wide characters

Ref: issue #1453

This is a patch on `js/id/svg/labels.js` to solve the issue of Chinese labels, modifying the calculation of `textWidth()` taking into account wide characters.  Tested locally and the labels displayed correctly.