Function heightofbyte (VAR Font: tfont): extended;
VaR
Con: extended;
Num: integer;
Begin
If font. size> = 3 then
Begin
Num: = (font. Size-1) Div 10;
Result: = 6.0743 + 1.32284 * (font. Size-3) + num * 0.0945;
End
Else
Begin
If font. size = 2 then
Begin
Result: = 5.7969;
End
Else
Begin
Result: = 3.3071;
End;
End;
End;
Function widthofbyte (VAR Font: tfont): extended;
VaR
Con: extended;
Num: integer;
Begin
Num: = 0;
If font. size> = 2 then
Num: = (font. Size-2) Div 6 + 1;
Result: = 0.0378 + 0.65252 * font. Size + num * 0.1512;
If font. Style <fsbold> then
Result: = Result + 0.0756;
End;
Function getlength (VAR Font: tfont; width: Extended): integer;
VaR
BW: extended;
Begin
BW: = widthofbyte (font );
Result: = 0;
While result * BW <width do
Begin
Result: = Result + 1;
End;
End;
Procedure disposestring (VAR pstring: string; Plen: integer; WS: twidestrings );
VaR
Data, curdata: string;
Varxx: variant;
Len, len_y: integer;
BW: extended;
Begin
WS. Clear ();
Data: = pstring;
Varxx. bstrval: = data;
Len: = length (varxx );
While Plen <Len do
Begin
Len_y: = 1;
While len_y <Plen do
Begin
If ord (data [len_y])> 127 then
Len_y: = len_y + 1;
Len_y: = len_y + 1;
End;
Curdata: = copy (data, 1, len_y );
WS. Add (curdata );
Data: = copy (data, len_y + 1, Len-Len_Y );
Len: = Len-Len_Y;
End;
WS. Add (data );
End;