Figma Support Forum

Get Actual coordinates of Text instead of Bounding box

Is there any way to get only the size taken by the text ?

For E.g :-
The text might take only 50px X 50px but the bounding box might be 100px X 100px but the API returns the size and coordinates of the bounding box instead of text which is right but not for my purpose.
I could select both these options to make the bounding box fit the text but is there any way to automate it while making the API call ?
Screenshot 2021-07-08 at 7.53.26 PM

I guess there’s no right permissions through the API but can we make a call with those settings ?

Do you mean REST API or plugins API? You can change resizing mode of text via plugins API, not sure what permissions you are talking about.

I am talking about REST API. Sorry if the question was unclear.

Got it! I changed the category of your question to the correct one (you placed it in plugins API). In this case I don’t think what you are asking is possible.

Oh Okay. But since Figma is able to perform those text resizing functions then there should be a property of text which allows the bounding box to be resized to fit the text. And I guess it’s not available through Rest API. Can it be made available as a different section ?

Screenshot 2021-07-09 at 12.42.44 PM

I may be asking for a lot, but any help is appreciated !

I don’t work for Figma so I can’t help here. You can send a suggestion to Figma support Submit a request – Figma (or this thread might be enough, idk, the team might be silently reading these threads).

I see, I thought you work for Figma as you previously also helped me :slight_smile:
Currently, I solved this problem locally but it would be beneficial if it becomes available as form of data from API.

I Hope that Figma Team reads this !

1 Like