ID:2036252
 
Resolved
The new client.MeasureText() proc can be used to determine the dimensions of maptext on a client. (This is a client proc because the server has no way of measuring maptext itself.) This can be used to either find the full width required to display text without wrapping, or the height of the text. Because this involves a client query it will sleep the current proc until a response is received.
Applies to:DM Language
Status: Resolved (513.1490)

This issue has been resolved.
it would be EXTREMELY convenient to be able to have a set of 2 read only variables that tell us exactly how wide and tall the actual maptext drawn on the screen is.

primary use:
-Text background for tooltips that actually sizes itself proportionately to the amount of text
Lummox JR resolved issue (Not Feasible)
This can't be done as a var, because those values depend entirely on how the client renders the text.
There's a hacky sort of way to calculate it, but it's not 100% reliable and requires you to ensure that quite a lot of style-based data must be synced between a browser element and the map element.

You need to hide a browser element in a client's interface.

Then you can create a javascript function that will update a DIV element inside of the browser's DOM with the text that should be displayed as a part of maptext, as well as setting the DIV's width and height to the maptext_width/height of the atom being calculated.

When the DIV has been updated and the proper text/style appended, you can then get the inner width/height of the content within the DIV element and send that information back to the server using a verb.
Lummox JR resolved issue with message:
The new client.MeasureText() proc can be used to determine the dimensions of maptext on a client. (This is a client proc because the server has no way of measuring maptext itself.) This can be used to either find the full width required to display text without wrapping, or the height of the text. Because this involves a client query it will sleep the current proc until a response is received.