In scenarios where text metrics are desired for formatted text, but text wrapping is not needed, the measureFormattedText API must be called with a wrapWidth second parameter of sufficiently large size so that the API doesn't attempt to wrap the text. This is because the scenarios for getting formatted text metrics and for calculating wrapping positions are tied together in this single API call.
Early experimentation suggests it may be useful to make the 2nd parameter to measureFormattedText optional and have it default (when not provided) to +Infinity, such that no line-breaking is attempted when computing line metrics.
Copied from: https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/371
In scenarios where text metrics are desired for formatted text, but text wrapping is not needed, the
measureFormattedText
API must be called with awrapWidth
second parameter of sufficiently large size so that the API doesn't attempt to wrap the text. This is because the scenarios for getting formatted text metrics and for calculating wrapping positions are tied together in this single API call.Early experimentation suggests it may be useful to make the 2nd parameter to
measureFormattedText
optional and have it default (when not provided) to +Infinity, such that no line-breaking is attempted when computing line metrics.