Community
Participate
Working Groups
In order to support markup in widgets (see bug 355861) we need first to extend the text size determination with a possibility to measure the dimensions of rich text (including images).
I would prefer if we could avoid measuring markup on the client. It feels like creating a dependency on browser-based clients.
(In reply to comment #1) > I would prefer if we could avoid measuring markup on the client. It feels like > creating a dependency on browser-based clients. But with the current implementation (with or without RichTextToHtmlTransformer) we have this dependency on browser-based (HTML) clients anyway. Rich text (markup) on widgets requires HTML capable client.
(In reply to comment #1) > I would prefer if we could avoid measuring markup on the client. It feels like > creating a dependency on browser-based clients. What would be the alternative to measuring markup? If we're going to support markup in widgets (even if it's just a bold text range in a label), I think we need to respect the markup in the measurement. Otherwise we'll get cut off text, wrong line wrapping and the like. If a client does not support markup, it would display and measure the text as-is. Applications written for those clients will therefore not use the markup feature anyway.
A new internal method TextSizeUtil#markupExtent has been introduced. The measurement mode (string, text or markup) has been included in MeasurementItem and respected in TextSizeStorageUtil key generation. For markup size estimation all <br/> tags are replaced with "\n" and all other tags are removed. Changes are in CVS HEAD.