Hey folks! I am not a web developer, but had a question about the possibility/feasibility of potential project that I might want to hire one for. Essentially, I'm trying to build a tool for my website that allows users to input text, and then depending on the selected size of the font, it calculates the total width and height of the entered text. Mainly, the only part of this tool that I had a question about was the possibility/feasibility of actually calculating the dimensions of the rendered text based on the size option that was selected.
For instance, you can calculate the dimensions of text pretty simply in Photoshop by just cropping the canvas to the edges of the text, and then looking at the Image Size window. Based on the point size of the font, it will show how wide and large the text is. I'm looking to see if this same functionality is able to be built into this prospective website tool.
Below are some very rough mock-ups of what I'm trying to achieve.
Here's an example of sizing the rendered text in the "Small" size (which would be based on the point size of the font), and here's an example of the "Medium" size (for all the other size options, the calculation could literally just take the whatever dimensions the "Small" size ended up being and scaling that up by a specified percentage).
Really, the only answer I'm looking for is if this dimension calculating is possible to do on a custom web tool, and how difficult of a project this would be for a developer. Any insight would be massively appreciated. Thanks so much!