Hello mohamed, you wrote on Tue, 6 Aug 2019 16:35:58 +0000:
> Suppose you have a simplewidget with bound_x=490, If you want to > fill it's frame.caption with '-' the number of chars must be 125 then > the width of char is 490/125=3,92 wich is not the width of the font? That's because you probabely use a proportional font, where all the characters have their individual width and font.width returns that of a "representative" character, often an "m". If you used a monospaced font, the font.width would be the same for all characters, although, of course, it looks different. But maybe you can make use of one of the "textrect" functions of the "msedrawtext" unit, which generally take a canvas object as their first parameter (implicitely specifying the font to check) and several other parameters, often a string to be evaluated. They return a "rectty" record, where the "cx" field contains the width value you are looking for. You probabely will have to select the appropriate version of the function according to your needs; the unit is located in the "mse.common/graphics" directory, the file name is "msedrawtext.pas". -- -- (Weitergabe von Adressdaten, Telefonnummern u.ä. ohne Zustimmung nicht gestattet, ebenso Zusendung von Werbung oder ähnlichem) ----------------------------------------------------------- Mit freundlichen Grüßen, S. Schicktanz ----------------------------------------------------------- _______________________________________________ mseide-msegui-talk mailing list mseide-msegui-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk