algorithm to shorten a string

From: Mike Lischke (public@lischke-online.de)
Date: Sun Feb 04 2001 - 10:28:26 EST


Hi all,

does anybody have a description of an algorithm to shorten a Unicode string to a particular width? What I want is to implement the DT_END_ELLIPSIS functionality of the DrawTextW Windows API also for Win9x and Linux. The implementation I have so far works quite well except that it might lead to wrong strings because formerly inner letters can become final letters which can be of totally different form as we know. Additionally, where are the usual three points to be drawn for right-to-left strings, on the left of the string or still on the right?

Ciao, Mike

Dipl. Ing. Mike Lischke
Senior software developer

--
Homepage: http://www.lischke-online.de
GraphicEx: http://www.lischke-online.de/Graphics.html
Virtual Treeview: http://www.lischke-online.de/VirtualTreeview.html
Unicode Edit and library: http://www.lischke-online.de/Unicode.html



This archive was generated by hypermail 2.1.2 : Tue Jul 10 2001 - 17:21:18 EDT