Código Delphi
[-]
unit LpFont;
interface
uses Graphics,sysutils, types,windows;
function FontHeight(const Fuente:TFont;const Texto:string):Integer;
function FontWidth(const Fuente:TFont;const Texto:string):Integer;
implementation
uses shellapi;
function FontWidth(const Fuente:TFont;const Texto:string):Integer;
var c:TCanvas;
begin
try
c:= TCanvas.Create;
c.Handle := GetDC(0);
c.Font.Assign(Fuente);
Result := c.TextWidth(Texto);
finally
FreeAndNil(c);
end;
end;
function FontHeight(const Fuente:TFont;const Texto:string):Integer;
var c:TCanvas;
begin
try
c:= TCanvas.Create;
c.Handle := GetDC(0);
c.Font.Assign(Fuente);
Result := c.TextHeight(Texto);
finally
FreeAndNil(c);
end;
end;
asignas el tamaño a los qrlabels y despues llamas a estas funciones para ver cuanto ocupan, así le das el tamaño.
Código Delphi
[-]
QRLABEL4.Font.Size := 23;
QRLABEL4.Height := lpfont.FontHeight(QRLabel4.Font,qrlabel4.caption);
Puede que haya otra forma más fácil, pero no la he probado, esta forma la tenía más a mano
.
Saludos