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;