Scale the text offset by the device's pixel ratio

Fixes #1918
Merge pull request #1921 from fredj/text-offset

Scale the text offset by the device's pixel ratio