If anyone has been able to do this, some explanation as to how would be helpful.
You will need to create some form of a listener to adjust the size of the text using parameters such as width to height ratio. You can check if JavaFx has a library which also allows you to do that.