Hi Julian,
I've been very quiet so far this year but here goes :)
I want to get the absolute text width of an RTF for other purposes.
I am using the following code:
WP:=TWPCustomRichText.CreateDynamic;
WP.Header.PageWidth:=280000;
WP.Header.LeftMargin:=0;
WP.Header.RightMargin:=0;
// WP.LayoutMode:=wpLayNormal;
WP.AsString:=S;
WP.ReformatAll;
WPWidth:=WP.Memo.TextWidth/WP.Memo.CurrentXPixelsPerInch;
WPHeight:=WP.Memo.TextHeight/WP.Memo.CurrentXPixelsPerInch;
WPLineCount:=WP.Memo.FirstPar.LineCount;
WP.Free;
My problem is that in some instances the LineCount is more than 1 even though there are no CR in the text. There are multiple fonts. I have set the PageWidth very large to try and avoid this.
Any help greatly appreciated.
Ken