Hi Onder, I just added a tool to the Community Library at Comps/Comp Size/Change Comp Size and Scale Content.xml
which does this with each currently selected text layer of the active comp: -measures the width of the text layer - changes the font size such that the layer width is X% of the width of the comp. (where X can be entered in a dialog)
PS: manipulating text details is a bit tricky, but the tool contains some clever workarounds. In a nutshell, the keyframes blocks can give you a text in json format with all text attribute details. The tool includes - a function which retrieves these text attributes - a function which reads the font size from the text attributes - a function which sets the font size of the text attribues
Those functions are probably also useful in other tools - and you should be able to write functions to get/set other text attributes in the same way.