Ticket T1047620
Visible to All Users

Plain text and markup text word wrap location is inconsistent (XRLabel, etc.)

created 3 years ago
  1. Create two equally sized XRLabels containing the text "111111-222222222", with the width being small enough to trigger word wrap.
  2. Now for one of the XRLabels, enable markup text and encapsulate the text in a color tag.
  3. Print/Preview the document.

Notice the location of the word wrap within the text is different between the two. For all intents and purposes, the text is the exact same so the location of the word wrap should also be the same.

It appears the plain text's word wrap is "smart" (e.g. wrapping on the hyphen), and the markup text wrapping is "dumb" (e.g. wraps exactly when about to overflow).

Example output with label width = 100:
Clipboard-File-1.png

Expected output:
Clipboard-File-2.png

Answers approved by DevExpress Support

created 3 years ago

Hello Dane,

We researched this issue on our side and found that it is caused by the GDI library specifics. This library is used to cut and measure text blocks when the markup text is used. This library does not allow wrapping text in the same way as it is wrapped by the System.Drawing (GDI+) library, which is used to draw and measure text in regular plain text mode.

There is no easy way to avoid this limitation. So, it is not possible to achieve the same word wrap behavior when the AllowMarkupText property is enabled for the XRLabel control.

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.