Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » Text wrapping in QTF Table
Re: Text wrapping in QTF Table [message #56537 is a reply to message #56530] Tue, 23 March 2021 08:13 Go to previous messageGo to previous message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Yes, got your idea of checking the height. And the binary search would be very cool! For time being this code does the job for me:

void TrimQTFTextEllipsis(String& qtf, int width, const String& ellipsis) {
	String str = qtf;
	while(ParseQTF(qtf).GetWidth() > width) {
		str.TrimLast();
		qtf = str + ellipsis;
	}
}


It's not really elegant, will trim ending ']' from QTF if it's there, so that should be added after trimming. However with the width given correctly it works pretty good. Uploading image of output.

index.php?t=getfile&id=6395&private=0

Will try to implement the way you suggested when I can do some optimisation.


Regards,
Pradip
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: search in Report
Next Topic: Bugfix: Report header/footer looks good in dark mode, not dark
Goto Forum:
  


Current Time: Wed May 14 17:21:41 CEST 2025

Total time taken to generate the page: 0.02674 seconds