algorithm to shorten a string

From: Mike Lischke (
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

Virtual Treeview:
Unicode Edit and library:

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