Código
//este calculo pode mudar de acordo com a fonte usada e o tamanho
function tampxl(str:string):integer;
const
pxl2 = 'ijl| '+chr(39);
pxl3 = 'Ifrt!¨&()-[´`]:;.,³²¹';
pxl4 = '*{}ªº°';
pxl5 = 'Jsyxz"/';
pxl6 = 'abcdeghknopquFL1234567890$_+=§^?<>¬¢£';
pxl7 = 'ABCEKPSTVYXZ~#';
pxl8 = 'mwDGHNOQRU%';
pxl9 = 'M';
pxl11 = '@W';
var
tam,i : integer;
begin
tam := 0;
for i := 1 to length(str) do
begin
if Pos(str[i],pxl2) > 0 Then
begin
tam := tam + 2;
end;
if Pos(str[i],pxl3) > 0 Then
begin
tam := tam + 3;
end;
if Pos(str[i],pxl4) > 0 Then
begin
tam := tam + 4;
end;
if Pos(str[i],pxl5) > 0 Then
begin
tam := tam + 5;
end;
if Pos(str[i],pxl6) > 0 Then
begin
tam := tam + 6;
end;
if Pos(str[i],pxl7) > 0 Then
begin
tam := tam + 7;
end;
if Pos(str[i],pxl8) > 0 Then
begin
tam := tam + 8;
end;
if Pos(str[i],pxl9) > 0 Then
begin
tam := tam + 9;
end;
if Pos(str[i],pxl11) > 0 Then
begin
tam := tam + 11;
end;
end;
result := tam;
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009