WrapMode.WordWrap and TrimmingGranularity

Posted by: brian on 19 November 2020, 8:46 am EST

  • Posted 19 November 2020, 8:46 am EST

    Is there a way to get the TextLayout to perform ellipsis trimming if the WrapMode is set to WrapMode.WordWrap.

    We would like our users to be able to type in a box of a specified height and width, but show the ellipsis if it runs outside the containing box (MaxWidth, MaxHeight).
  • Replied 24 November 2020, 7:23 pm EST

    Hi Brian,

    Trimming enables if WrapMode is NoWrap. So, it is not possible to have WrapMode set to WordWrap and be able to show Ellipsis.

    For details on the possible combinations, I would suggest to refer: https://www.grapecity.com/documents-api-imaging/demos/features/text/text-trimming/code-cs

    Regards,
  • Replied 25 November 2020, 4:44 am EST

    I did see the documentation, which is what prompted the question. I'm still familiarizing myself with your library, is there path for me to do this manually? Maybe a combination of MeasureString and something?

    https://www.grapecity.com/documents-api-imaging/docs/online/GrapeCity.Documents.Imaging~GrapeCity.Documents.Drawing.GcGraphics~MeasureString(String,TextFormat,SizeF,TextSplitOptions,Int32).html?highlight=measurestring%2C
  • Replied 26 November 2020, 11:16 pm EST

    Hello,

    I am discussing it with the team [ID: 2595] and will get back to you as soon as I receive information.

    Regards,
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels