I recently polished my fit-to-width code and added it as a new fit-to-width GitHub repository
. The published code is a development of the method I first presented in this Skia demo
from November 2016, and is available under the Apache open source license.
From the README:
Comments welcome, particularly from people using it.